{"$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":"D7","name":"Architectural Integrity","shortDescription":{"text":"Architectural Integrity"},"helpUri":"https://codehealth.canine.dev/dimensions/D7"},{"id":"D13","name":"Secret Scanning","shortDescription":{"text":"Secret Scanning"},"helpUri":"https://codehealth.canine.dev/dimensions/D13","relationships":[{"target":{"id":"CWE-798","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-259","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-798","CWE-259"]}},{"id":"D15","name":"Churn \u00D7 Complexity Hotspots","shortDescription":{"text":"Churn \u00D7 Complexity Hotspots"},"helpUri":"https://codehealth.canine.dev/dimensions/D15"},{"id":"D16","name":"Bus Factor","shortDescription":{"text":"Bus Factor"},"helpUri":"https://codehealth.canine.dev/dimensions/D16"},{"id":"D19","name":"Documentation Quality","shortDescription":{"text":"Documentation Quality"},"helpUri":"https://codehealth.canine.dev/dimensions/D19"},{"id":"D20","name":"ADR Quality","shortDescription":{"text":"ADR Quality"},"helpUri":"https://codehealth.canine.dev/dimensions/D20"},{"id":"D21","name":"Naming Consistency","shortDescription":{"text":"Naming Consistency"},"helpUri":"https://codehealth.canine.dev/dimensions/D21"},{"id":"D25","name":"ADR Conformance","shortDescription":{"text":"ADR Conformance"},"helpUri":"https://codehealth.canine.dev/dimensions/D25"},{"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":"D37","name":"Vulnerability-disclosure Policy","shortDescription":{"text":"Vulnerability-disclosure Policy"},"helpUri":"https://codehealth.canine.dev/dimensions/D37","relationships":[{"target":{"id":"CWE-1059","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-1059"]}},{"id":"D38","name":"OSV Dependency Vulnerabilities","shortDescription":{"text":"OSV Dependency Vulnerabilities"},"helpUri":"https://codehealth.canine.dev/dimensions/D38","relationships":[{"target":{"id":"CWE-1395","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-937","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-1395","CWE-937"]}}]}},"results":[{"ruleId":"D1","level":"warning","message":{"text":"AlterTableSpec.Restore (cyclomatic 197): AlterTableSpec.Restore has cyclomatic complexity 197 (threshold 15). Of this number, 194 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":"pkg/parser/ast/ddl.go"},"region":{"startLine":3616}}}],"partialFingerprints":{"codehealthFindingId/v1":"b82f8ed8c35fb4c8eb8087a5068a32b3112e81175f8f62e3b019b67c86234cf0"}},{"ruleId":"D1","level":"warning","message":{"text":"SimpleExec.executeAlterUser (cyclomatic 141): SimpleExec.executeAlterUser has cyclomatic complexity 141 (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":"pkg/executor/simple.go"},"region":{"startLine":1731}}}],"partialFingerprints":{"codehealthFindingId/v1":"b27e97a68308e97ee31cf85518cca350712ac94feb4d6650066ef742c7a253fe"}},{"ruleId":"D1","level":"warning","message":{"text":"executor.constructResultOfShowCreateTable (cyclomatic 132): executor.constructResultOfShowCreateTable has cyclomatic complexity 132 (threshold 15). Of this number, 130 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":"pkg/executor/show.go"},"region":{"startLine":1052}}}],"partialFingerprints":{"codehealthFindingId/v1":"234c5db7bb10d5f925f1a6a7d57870ab0196de67cc64f189243276f741eaeb22"}},{"ruleId":"D1","level":"warning","message":{"text":"ShowStmt.Restore (cyclomatic 129): ShowStmt.Restore has cyclomatic complexity 129 (threshold 15). Of this number, 121 points are the body\u0027s own statements and 8 belong to 4 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":"pkg/parser/ast/dml.go"},"region":{"startLine":3296}}}],"partialFingerprints":{"codehealthFindingId/v1":"5a62f290308af8bab82679bea57f6bc1e6f6b3ba9961eb9d6c28bd093d97561b"}},{"ruleId":"D1","level":"warning","message":{"text":"task.runSnapshotRestore (cyclomatic 126): task.runSnapshotRestore has cyclomatic complexity 126 (threshold 15). Of this number, 99 points are the body\u0027s own statements and 27 belong to 8 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":"br/pkg/task/restore.go"},"region":{"startLine":1303}}}],"partialFingerprints":{"codehealthFindingId/v1":"905f0961ed87a5f9936936fefaeaa663b5614f590d7d761d496b07484ab72ba0"}},{"ruleId":"D1","level":"warning","message":{"text":"executor.getStmtDbLabel (cyclomatic 119): executor.getStmtDbLabel has cyclomatic complexity 119 (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":"pkg/executor/compiler.go"},"region":{"startLine":234}}}],"partialFingerprints":{"codehealthFindingId/v1":"31f318afbc9d8c018915cb6a871772453dd31d4cbd0a32d1251f75d807152776"}},{"ruleId":"D1","level":"warning","message":{"text":"executor.AlterTable (cyclomatic 117): executor.AlterTable has cyclomatic complexity 117 (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":"pkg/ddl/executor.go"},"region":{"startLine":1707}}}],"partialFingerprints":{"codehealthFindingId/v1":"95c60d59306cfd293b7a17ec063d46f6f8ec041eb7ead0477b43f2bd18946b1e"}},{"ruleId":"D1","level":"warning","message":{"text":"Plan.initOptions (cyclomatic 102): Plan.initOptions has cyclomatic complexity 102 (threshold 15). Of this number, 95 points are the body\u0027s own statements and 7 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/importer/import.go"},"region":{"startLine":767}}}],"partialFingerprints":{"codehealthFindingId/v1":"5ca541a05905b7b4261fb3b478ceb9100d52b1affd941c3d57ef6dd6e8461b11"}},{"ruleId":"D1","level":"warning","message":{"text":"core.findBestTask4LogicalDataSource (cyclomatic 96): core.findBestTask4LogicalDataSource has cyclomatic complexity 96 (threshold 15). Of this number, 84 points are the body\u0027s own statements and 12 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":"pkg/planner/core/find_best_task.go"},"region":{"startLine":2009}}}],"partialFingerprints":{"codehealthFindingId/v1":"d7bf10a71cd16fd552ebdc4892891d4fd9811d4cb9089be2c9b741a741bf8994"}},{"ruleId":"D1","level":"warning","message":{"text":"worker.runOneJobStep (cyclomatic 94): worker.runOneJobStep has cyclomatic complexity 94 (threshold 15). Of this number, 86 points are the body\u0027s own statements and 8 belong to one function literal inside it that branches. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. 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/ddl/job_worker.go"},"region":{"startLine":837}}}],"partialFingerprints":{"codehealthFindingId/v1":"a893866afc63c35627cb6340ab171985587ca27908d5137d4b7334e8a94b80fb"}},{"ruleId":"D1","level":"warning","message":{"text":"PlanBuilder.buildDDL (cyclomatic 94): PlanBuilder.buildDDL has cyclomatic complexity 94 (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":"pkg/planner/core/planbuilder.go"},"region":{"startLine":5300}}}],"partialFingerprints":{"codehealthFindingId/v1":"cd34d4a03d40d82395975f960ae6487c081dae9595da83d49fcf60019cf4c08d"}},{"ruleId":"D1","level":"warning","message":{"text":"core.toString (cyclomatic 90): core.toString has cyclomatic complexity 90 (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/planner/core/stringer.go"},"region":{"startLine":86}}}],"partialFingerprints":{"codehealthFindingId/v1":"69f6487db4b797388672e898783e01e69d984eab56a7150a00b742d921d84435"}},{"ruleId":"D1","level":"warning","message":{"text":"worker.onReorganizePartition (cyclomatic 88): worker.onReorganizePartition has cyclomatic complexity 88 (threshold 15). Of this number, 78 points are the body\u0027s own statements and 10 belong to 10 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":"pkg/ddl/partition.go"},"region":{"startLine":3234}}}],"partialFingerprints":{"codehealthFindingId/v1":"4bc22e647fed33a9d70dcb64c1e53f698a479e029fcc37ed436da569c28cbf02"}},{"ruleId":"D1","level":"warning","message":{"text":"addSubDateFunctionClass.getFunction (cyclomatic 88): addSubDateFunctionClass.getFunction has cyclomatic complexity 88 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/builtin_time.go"},"region":{"startLine":3755}}}],"partialFingerprints":{"codehealthFindingId/v1":"f49ea51998ca25ceb8c54f66552d3d1588d76057b699768b6f961e693303051f"}},{"ruleId":"D1","level":"warning","message":{"text":"TableOption.Restore (cyclomatic 88): TableOption.Restore has cyclomatic complexity 88 (threshold 15). Of this number, 86 points are the body\u0027s own statements and 2 belong to 2 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":"pkg/parser/ast/ddl.go"},"region":{"startLine":2889}}}],"partialFingerprints":{"codehealthFindingId/v1":"f01ea764df10af2f2d347e7c6d235d0098d42c7ad13250b501323ce2cb58ed99"}},{"ruleId":"D1","level":"warning","message":{"text":"PlanBuilder.buildSelect (cyclomatic 87): PlanBuilder.buildSelect has cyclomatic complexity 87 (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":"pkg/planner/core/logical_plan_builder.go"},"region":{"startLine":4260}}}],"partialFingerprints":{"codehealthFindingId/v1":"8e56d2e08979953c7959286eef4c989d5bed953006bc9336b7d17289a401c796"}},{"ruleId":"D1","level":"warning","message":{"text":"RPCClient.SendRequest (cyclomatic 86): RPCClient.SendRequest has cyclomatic complexity 86 (threshold 15). Of this number, 54 points are the body\u0027s own statements and 32 belong to 19 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":"pkg/store/mockstore/unistore/rpc.go"},"region":{"startLine":76}}}],"partialFingerprints":{"codehealthFindingId/v1":"a455b9fd0974ba2aaafa83caa061d2543392cda2d8e24bd3f8064e0bb29df2ab"}},{"ruleId":"D1","level":"warning","message":{"text":"PlanBuilder.buildDataSource (cyclomatic 82): PlanBuilder.buildDataSource has cyclomatic complexity 82 (threshold 15). Of this number, 80 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":"pkg/planner/core/logical_plan_builder.go"},"region":{"startLine":4930}}}],"partialFingerprints":{"codehealthFindingId/v1":"119cbda1778931bd092a3f6a9cc5baed649321444d081bd110e79e490d6faff9"}},{"ruleId":"D1","level":"warning","message":{"text":"index.create (cyclomatic 80): index.create has cyclomatic complexity 80 (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":"pkg/table/tables/index.go"},"region":{"startLine":301}}}],"partialFingerprints":{"codehealthFindingId/v1":"adb9584582ddadb918b7cb6062f01afa6b4154386ba1bbf54a77c93cc394a0a1"}},{"ruleId":"D1","level":"warning","message":{"text":"SimpleExec.executeCreateUser (cyclomatic 79): SimpleExec.executeCreateUser has cyclomatic complexity 79 (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":"pkg/executor/simple.go"},"region":{"startLine":1049}}}],"partialFingerprints":{"codehealthFindingId/v1":"c86a2922d47edf7f654213ec19357f3f6ea5237dcca54b8de2c5aaa0482a7270"}},{"ruleId":"D1","level":"warning","message":{"text":"main.main1 (cyclomatic 78): main.main1 has cyclomatic complexity 78 (threshold 15). Of this number, 67 points are the body\u0027s own statements and 11 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":"pkg/parser/goyacc/main.go"},"region":{"startLine":244}}}],"partialFingerprints":{"codehealthFindingId/v1":"d0f481a05a16674920f3f1f3476d1a1962041bab2da4e5b8226ceefd40518e8e"}},{"ruleId":"D1","level":"warning","message":{"text":"Config.ParseFromFlags (cyclomatic 76): Config.ParseFromFlags has cyclomatic complexity 76 (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":"dumpling/export/config.go"},"region":{"startLine":417}}}],"partialFingerprints":{"codehealthFindingId/v1":"a9e4704e9a2b6b8d97e48d309b77757c99970af05f1624babe23a7dae28d1e80"}},{"ruleId":"D1","level":"warning","message":{"text":"cardinality.Selectivity (cyclomatic 76): cardinality.Selectivity has cyclomatic complexity 76 (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":"pkg/planner/cardinality/selectivity.go"},"region":{"startLine":51}}}],"partialFingerprints":{"codehealthFindingId/v1":"7ff3034d6d67333afeff9728aad7efbadf8b46c50cb6d6a76a6b454801b64c17"}},{"ruleId":"D1","level":"warning","message":{"text":"preprocessor.Enter (cyclomatic 75): preprocessor.Enter has cyclomatic complexity 75 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/preprocess.go"},"region":{"startLine":259}}}],"partialFingerprints":{"codehealthFindingId/v1":"07f120d3a1dd594c93dad53b22a2547f900bf3a4a3fdb90e0adff14f7f1b3cdd"}},{"ruleId":"D1","level":"warning","message":{"text":"DecorrelateSolver.optimize (cyclomatic 75): DecorrelateSolver.optimize has cyclomatic complexity 75 (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":"pkg/planner/core/rule_decorrelate.go"},"region":{"startLine":215}}}],"partialFingerprints":{"codehealthFindingId/v1":"60f5ae98d601a89a4025025b0732a51ddbb35ba1fdeb7d72db5c1a2de6bfa4a2"}},{"ruleId":"D1","level":"warning","message":{"text":"types.parseDatetime (cyclomatic 75): types.parseDatetime has cyclomatic complexity 75 (threshold 15). Of this number, 73 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":"pkg/types/time.go"},"region":{"startLine":952}}}],"partialFingerprints":{"codehealthFindingId/v1":"fd28034d2f86553b9bd7b7cc00e0fade4abb1cad7f3a52d7a2a390b8ba38c8aa"}},{"ruleId":"D1","level":"warning","message":{"text":"codec.HashChunkSelected (cyclomatic 75): codec.HashChunkSelected has cyclomatic complexity 75 (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":"pkg/util/codec/codec.go"},"region":{"startLine":919}}}],"partialFingerprints":{"codehealthFindingId/v1":"e95a31a7f707acd3f21e26a2dbd70196bceea970a7e0c836b632cf9a7bef37f3"}},{"ruleId":"D1","level":"warning","message":{"text":"Config.Valid (cyclomatic 74): Config.Valid has cyclomatic complexity 74 (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":"pkg/config/config.go"},"region":{"startLine":1717}}}],"partialFingerprints":{"codehealthFindingId/v1":"92546dc5522b71c51e9313374446151a053b2b8c75a92ce8014baa73eed7061d"}},{"ruleId":"D1","level":"warning","message":{"text":"executor.ResetContextOfStmt (cyclomatic 73): executor.ResetContextOfStmt has cyclomatic complexity 73 (threshold 15). Of this number, 71 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":"pkg/executor/select.go"},"region":{"startLine":923}}}],"partialFingerprints":{"codehealthFindingId/v1":"b3ba2ac0fe4a2120a4ea5b88899d69b58434a2783b592241b8612f5c5e2013da"}},{"ruleId":"D1","level":"warning","message":{"text":"ErrorManager.ReplaceConflictKeys (cyclomatic 71): ErrorManager.ReplaceConflictKeys has cyclomatic complexity 71 (threshold 15). Most of this is not in the body itself: 9 of the 71 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 748, 549, 914). 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":"lightning/pkg/errormanager/errormanager.go"},"region":{"startLine":512}}}],"partialFingerprints":{"codehealthFindingId/v1":"a58453980abd79c0c957f44a18b37ac986631a310d2effe28b30b935d3993404"}},{"ruleId":"D1","level":"warning","message":{"text":"checkIndexWorker.HandleTask (cyclomatic 71): checkIndexWorker.HandleTask has cyclomatic complexity 71 (threshold 15). Of this number, 63 points are the body\u0027s own statements and 8 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":"pkg/executor/check_table_index.go"},"region":{"startLine":474}}}],"partialFingerprints":{"codehealthFindingId/v1":"adb3894b6aecfdd0d05805912f81d18acfe9b8fcd9a696cb082259395722aba0"}},{"ruleId":"D1","level":"warning","message":{"text":"core.getPossibleAccessPaths (cyclomatic 71): core.getPossibleAccessPaths has cyclomatic complexity 71 (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":"pkg/planner/core/planbuilder.go"},"region":{"startLine":1320}}}],"partialFingerprints":{"codehealthFindingId/v1":"3689d9556f420f66d60a4ae972151947fc5bbff45ad0a50f5745f9b4b6dd5891"}},{"ruleId":"D1","level":"warning","message":{"text":"main.overrideConfig (cyclomatic 69): main.overrideConfig has cyclomatic complexity 69 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/tidb-server/main.go"},"region":{"startLine":758}}}],"partialFingerprints":{"codehealthFindingId/v1":"633ba2f2810944845e521828939d9f6eadbeabc989d4528a53beec156b99de19"}},{"ruleId":"D1","level":"warning","message":{"text":"compareFunctionClass.generateCmpSigs (cyclomatic 68): compareFunctionClass.generateCmpSigs has cyclomatic complexity 68 (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/expression/builtin_compare.go"},"region":{"startLine":1994}}}],"partialFingerprints":{"codehealthFindingId/v1":"55d5f7c5c80e61b2ee79c2a70a22c62df8521fad4655f60f3ceba61a453e0b15"}},{"ruleId":"D1","level":"warning","message":{"text":"SelectStmt.Restore (cyclomatic 68): SelectStmt.Restore has cyclomatic complexity 68 (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":"pkg/parser/ast/dml.go"},"region":{"startLine":1330}}}],"partialFingerprints":{"codehealthFindingId/v1":"9d48798c8020ecb32482c47a4d9618bc4710103099556c44a0719fd413226fd4"}},{"ruleId":"D1","level":"warning","message":{"text":"tables.partitionedTableUpdateRecord (cyclomatic 67): tables.partitionedTableUpdateRecord has cyclomatic complexity 67 (threshold 15). Of this number, 60 points are the body\u0027s own statements and 7 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/table/tables/partition.go"},"region":{"startLine":1911}}}],"partialFingerprints":{"codehealthFindingId/v1":"3f006a9d304cfa4cc86a676856b3c4181260e47a59aa2b8f687a9d11593674d6"}},{"ruleId":"D1","level":"warning","message":{"text":"executor.updateRecord (cyclomatic 65): executor.updateRecord has cyclomatic complexity 65 (threshold 15). Of this number, 52 points are the body\u0027s own statements and 13 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":"pkg/executor/write.go"},"region":{"startLine":81}}}],"partialFingerprints":{"codehealthFindingId/v1":"8354f66323b709b68b0404967e721f628c8ba2cb83517d4cd63fe04e52e1e0bc"}},{"ruleId":"D1","level":"warning","message":{"text":"core.extractJoinGroupImpl (cyclomatic 65): core.extractJoinGroupImpl has cyclomatic complexity 65 (threshold 15). Of this number, 60 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":"pkg/planner/core/rule_join_reorder.go"},"region":{"startLine":58}}}],"partialFingerprints":{"codehealthFindingId/v1":"ba3f798fd249b00fbd4778b33894a02b61d538e4162fbd68c4c1b7b39fecdce8"}},{"ruleId":"D1","level":"warning","message":{"text":"VecGroupChecker.evalGroupItemsAndResolveGroups (cyclomatic 64): VecGroupChecker.evalGroupItemsAndResolveGroups has cyclomatic complexity 64 (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":"pkg/executor/internal/vecgroupchecker/vec_group_checker.go"},"region":{"startLine":350}}}],"partialFingerprints":{"codehealthFindingId/v1":"d19bca5c43283183533f210da69f9ceef47a22be7325eed39b4d8e55b9d5bd91"}},{"ruleId":"D1","level":"warning","message":{"text":"session.executeStmtImpl (cyclomatic 64): session.executeStmtImpl has cyclomatic complexity 64 (threshold 15). Of this number, 59 points are the body\u0027s own statements and 5 belong to 4 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":"pkg/session/session.go"},"region":{"startLine":2428}}}],"partialFingerprints":{"codehealthFindingId/v1":"f7e7be89460c5e1d37d51819b0161c2fecfe4ece55de2cf90da72d5a4f1eea3d"}},{"ruleId":"D1","level":"warning","message":{"text":"BatchPointGetExec.initialize (cyclomatic 63): BatchPointGetExec.initialize has cyclomatic complexity 63 (threshold 15). Of this number, 55 points are the body\u0027s own statements and 8 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":"pkg/executor/batch_point_get.go"},"region":{"startLine":253}}}],"partialFingerprints":{"codehealthFindingId/v1":"6080f927966154acbbfb375da57b3c9eabf4d1965070ed5e5c7a1a71a86691a7"}},{"ruleId":"D1","level":"warning","message":{"text":"core.tryToGetMppHashJoin (cyclomatic 63): core.tryToGetMppHashJoin has cyclomatic complexity 63 (threshold 15). Of this number, 62 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":"pkg/planner/core/exhaust_physical_plans.go"},"region":{"startLine":1939}}}],"partialFingerprints":{"codehealthFindingId/v1":"dc53eda223b9666787644a7eceaa8dac88066202ae8f64bfc72e5c6354bdbd35"}},{"ruleId":"D1","level":"warning","message":{"text":"expressionRewriter.Leave (cyclomatic 63): expressionRewriter.Leave has cyclomatic complexity 63 (threshold 15). Of this number, 61 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":"pkg/planner/core/expression_rewriter.go"},"region":{"startLine":1672}}}],"partialFingerprints":{"codehealthFindingId/v1":"1e20c285b17cb348083aee3e315b40984df0625580b8f9971311e6dc89410f50"}},{"ruleId":"D1","level":"warning","message":{"text":"AdminStmt.Restore (cyclomatic 63): AdminStmt.Restore has cyclomatic complexity 63 (threshold 15). Of this number, 58 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":"pkg/parser/ast/misc.go"},"region":{"startLine":2817}}}],"partialFingerprints":{"codehealthFindingId/v1":"bc40c6c131c006e1bcdb979462fb28fa5427e27fca7ca03e8ac16e86b5471717"}},{"ruleId":"D1","level":"warning","message":{"text":"hint.ParsePlanHints (cyclomatic 62): hint.ParsePlanHints has cyclomatic complexity 62 (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":"pkg/util/hint/hint.go"},"region":{"startLine":826}}}],"partialFingerprints":{"codehealthFindingId/v1":"4df58b3c0f61353bdeaace90c1a29c93af341ac09ad9839c22d070c73ce7c398"}},{"ruleId":"D1","level":"warning","message":{"text":"task.RunBackup (cyclomatic 61): task.RunBackup has cyclomatic complexity 61 (threshold 15). Of this number, 46 points are the body\u0027s own statements and 15 belong to 6 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":"br/pkg/task/backup.go"},"region":{"startLine":392}}}],"partialFingerprints":{"codehealthFindingId/v1":"015b3ad51eab3a276a78a2836c4ee2ca50cc2fe2cba25df2ac9624abdbfcccfd"}},{"ruleId":"D1","level":"warning","message":{"text":"TableImporter.preprocessEngine (cyclomatic 60): TableImporter.preprocessEngine has cyclomatic complexity 60 (threshold 15). Of this number, 42 points are the body\u0027s own statements and 18 belong to 4 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":"lightning/pkg/importer/table_import.go"},"region":{"startLine":660}}}],"partialFingerprints":{"codehealthFindingId/v1":"022d2afbd0e7145a5cf1819b8c1bb87939569ddaf140210dd2dd7b49508d8b43"}},{"ruleId":"D1","level":"warning","message":{"text":"GrantExec.Next (cyclomatic 60): GrantExec.Next has cyclomatic complexity 60 (threshold 15). Of this number, 58 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":"pkg/executor/grant.go"},"region":{"startLine":74}}}],"partialFingerprints":{"codehealthFindingId/v1":"025c6b63c63241f24981a0c139c271274453ba6df4615d360c00a7447589c797"}},{"ruleId":"D1","level":"warning","message":{"text":"memtableRetriever.retrieve (cyclomatic 60): memtableRetriever.retrieve has cyclomatic complexity 60 (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/executor/infoschema_reader.go"},"region":{"startLine":114}}}],"partialFingerprints":{"codehealthFindingId/v1":"a724ba6d6e9323fb7ecf4c735d1c48efadea877af8eb9e257c3d8bfa804a159b"}},{"ruleId":"D1","level":"warning","message":{"text":"testutil.genRandomColumn (cyclomatic 60): testutil.genRandomColumn has cyclomatic complexity 60 (threshold 15). Of this number, 53 points are the body\u0027s own statements and 7 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/internal/testutil/testutil.go"},"region":{"startLine":371}}}],"partialFingerprints":{"codehealthFindingId/v1":"1ee57b29055fa9c798be4414b2fb67debf43998dca4b5806fc8b327d5bb25aab"}},{"ruleId":"D1","level":"warning","message":{"text":"core.buildShowSchema (cyclomatic 60): core.buildShowSchema has cyclomatic complexity 60 (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/planner/core/planbuilder.go"},"region":{"startLine":5918}}}],"partialFingerprints":{"codehealthFindingId/v1":"4c2ce96ddc5220e5e29faf8012e3ad2e1613da45c710b96a9e7c3fc0392f04f4"}},{"ruleId":"D1","level":"warning","message":{"text":"Controller.importTables (cyclomatic 59): Controller.importTables has cyclomatic complexity 59 (threshold 15). Of this number, 38 points are the body\u0027s own statements and 21 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":"lightning/pkg/importer/import.go"},"region":{"startLine":1317}}}],"partialFingerprints":{"codehealthFindingId/v1":"3d328a901ec5df9cd9934877c3e8e04e74cd3362af050cb3f152a384ef6ba2f7"}},{"ruleId":"D1","level":"warning","message":{"text":"core.convertToTableScan (cyclomatic 59): core.convertToTableScan has cyclomatic complexity 59 (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":"pkg/planner/core/find_best_task.go"},"region":{"startLine":2811}}}],"partialFingerprints":{"codehealthFindingId/v1":"a63785a72f160e1f8e1c9d60b82eaad439a7bd78684ecda918035441a744de87"}},{"ruleId":"D1","level":"warning","message":{"text":"task.restoreStream (cyclomatic 58): task.restoreStream has cyclomatic complexity 58 (threshold 15). Of this number, 39 points are the body\u0027s own statements and 19 belong to 6 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":"br/pkg/task/stream.go"},"region":{"startLine":1565}}}],"partialFingerprints":{"codehealthFindingId/v1":"3d11db304eb7e3280023d6f70473867eb2948c21b233f53f68a1d2580c961c19"}},{"ruleId":"D1","level":"warning","message":{"text":"TableImporter.postProcess (cyclomatic 58): TableImporter.postProcess has cyclomatic complexity 58 (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":"lightning/pkg/importer/table_import.go"},"region":{"startLine":987}}}],"partialFingerprints":{"codehealthFindingId/v1":"17d41304aa80353dc2ab6c65755fbf3f7b7b1c183ebe52efc82a873f1de02927"}},{"ruleId":"D1","level":"warning","message":{"text":"subscriber.handle (cyclomatic 58): subscriber.handle has cyclomatic complexity 58 (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":"pkg/statistics/handle/ddl/subscriber.go"},"region":{"startLine":49}}}],"partialFingerprints":{"codehealthFindingId/v1":"ecaf3f60553fcc25f2d0aae685521b186356fc895a7f05254b24a45b908f6c2c"}},{"ruleId":"D1","level":"warning","message":{"text":"codec.serializeKeysImpl (cyclomatic 58): codec.serializeKeysImpl has cyclomatic complexity 58 (threshold 15). Of this number, 55 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":"pkg/util/codec/codec.go"},"region":{"startLine":652}}}],"partialFingerprints":{"codehealthFindingId/v1":"1ede6cd559de4d09552ea7890bcd9bf065254f3633467978a17460480a2ce152"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.getFuncCallDefaultValue (cyclomatic 57): ddl.getFuncCallDefaultValue has cyclomatic complexity 57 (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":"pkg/ddl/add_column.go"},"region":{"startLine":651}}}],"partialFingerprints":{"codehealthFindingId/v1":"90cb09b23ede666be20c95d7407991650e7b819704244474b595637f95286729"}},{"ruleId":"D1","level":"warning","message":{"text":"core.newBatchPointGetPlan (cyclomatic 57): core.newBatchPointGetPlan has cyclomatic complexity 57 (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":"pkg/planner/core/point_get_plan.go"},"region":{"startLine":164}}}],"partialFingerprints":{"codehealthFindingId/v1":"f5b7c17f3513863c0d6876b73f487995a89d7a6e0a6c98711a688db8d6bec573"}},{"ruleId":"D1","level":"warning","message":{"text":"BatchPointGetPlan.PrunePartitionsAndValues (cyclomatic 56): BatchPointGetPlan.PrunePartitionsAndValues has cyclomatic complexity 56 (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":"pkg/planner/core/operator/physicalop/physical_batch_point_get.go"},"region":{"startLine":815}}}],"partialFingerprints":{"codehealthFindingId/v1":"29de7bf2f706e74282781f3b07d0be531f497a9b723b6dcaefd83b4da7ae1246"}},{"ruleId":"D1","level":"warning","message":{"text":"MySQLPrivilege.showGrants (cyclomatic 54): MySQLPrivilege.showGrants has cyclomatic complexity 54 (threshold 15). Of this number, 42 points are the body\u0027s own statements and 12 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":"pkg/privilege/privileges/cache.go"},"region":{"startLine":1740}}}],"partialFingerprints":{"codehealthFindingId/v1":"3656b37f60385ffba108dc36bd5e293c53beae4b0f19a628f80e2f4478980ff3"}},{"ruleId":"D1","level":"warning","message":{"text":"codec.preAllocForSerializedKeyBuffer (cyclomatic 54): codec.preAllocForSerializedKeyBuffer has cyclomatic complexity 54 (threshold 15). Of this number, 50 points are the body\u0027s own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/util/codec/codec.go"},"region":{"startLine":459}}}],"partialFingerprints":{"codehealthFindingId/v1":"386eb8950c84f3cf55c9c7e294d3bc27c2528edf8fa931977a12ac0456a10b67"}},{"ruleId":"D1","level":"warning","message":{"text":"chunkProcessor.encodeLoop (cyclomatic 53): chunkProcessor.encodeLoop has cyclomatic complexity 53 (threshold 15). Of this number, 47 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":"lightning/pkg/importer/chunk_process.go"},"region":{"startLine":246}}}],"partialFingerprints":{"codehealthFindingId/v1":"7ad96aef267b9705d93ec04b5d99499fb5389a23cfc25e2dcc94f288376dd9b0"}},{"ruleId":"D1","level":"warning","message":{"text":"TableCommon.addRecord (cyclomatic 53): TableCommon.addRecord has cyclomatic complexity 53 (threshold 15). Of this number, 51 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":"pkg/table/tables/tables.go"},"region":{"startLine":748}}}],"partialFingerprints":{"codehealthFindingId/v1":"0b995849a2cab06c0a4010a16f19142925ea92b169563ebefccdc639e955ed80"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.BuildTableInfo (cyclomatic 52): ddl.BuildTableInfo has cyclomatic complexity 52 (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":"pkg/ddl/create_table.go"},"region":{"startLine":1323}}}],"partialFingerprints":{"codehealthFindingId/v1":"ef28038e953ec142a42ac6f71c3309de654dee929c79225bf737a5d2429b7c47"}},{"ruleId":"D1","level":"warning","message":{"text":"DDLExec.Next (cyclomatic 52): DDLExec.Next has cyclomatic complexity 52 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function taking that case\u0027s concrete type, so the dispatch reads one line per case. These arms are selected by TYPE rather than by value, so there is no key a lookup table could be built on; where you own the matched types, giving them one shared interface method and calling that is the form a table would have taken, and where you do not, keep the cases \u2014 they stay explicit and reviewable."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/ddl.go"},"region":{"startLine":96}}}],"partialFingerprints":{"codehealthFindingId/v1":"08a283330951e01f44bc36a64c4558bc5763d6a56fe32102efdfd22ca6ee79eb"}},{"ruleId":"D1","level":"warning","message":{"text":"expression.scalarExprSupportedByFlash (cyclomatic 52): expression.scalarExprSupportedByFlash has cyclomatic complexity 52 (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/expression/infer_pushdown.go"},"region":{"startLine":292}}}],"partialFingerprints":{"codehealthFindingId/v1":"fd5f7bef8028f5e5f13f5199ff95ae12146abb30af12a9870d4c977a7a026668"}},{"ruleId":"D1","level":"warning","message":{"text":"statistics.MergePartitionHist2GlobalHist (cyclomatic 52): statistics.MergePartitionHist2GlobalHist has cyclomatic complexity 52 (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":"pkg/statistics/histogram.go"},"region":{"startLine":1670}}}],"partialFingerprints":{"codehealthFindingId/v1":"2fb305d700a468b621087a910474059c65007bdf23a680553f2d867f2fb1c0af"}},{"ruleId":"D1","level":"warning","message":{"text":"core.matchProperty (cyclomatic 51): core.matchProperty has cyclomatic complexity 51 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/find_best_task.go"},"region":{"startLine":1042}}}],"partialFingerprints":{"codehealthFindingId/v1":"ee2f227f69fc5757e704f1d6cf072bea1a4c59296c98055d598521d35da2300e"}},{"ruleId":"D1","level":"warning","message":{"text":"OrderAwareJoinReorder.optimizeRecursive (cyclomatic 51): OrderAwareJoinReorder.optimizeRecursive has cyclomatic complexity 51 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/rule/rule_order_aware_join_reorder.go"},"region":{"startLine":39}}}],"partialFingerprints":{"codehealthFindingId/v1":"d5771287bedc7f93e5b91ec5f929cb5dbc7a3d4e0bbdac6b6a4ed4f01310480c"}},{"ruleId":"D1","level":"warning","message":{"text":"ExecStmt.Exec (cyclomatic 50): ExecStmt.Exec has cyclomatic complexity 50 (threshold 15). Of this number, 27 points are the body\u0027s own statements and 23 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":"pkg/executor/adapter.go"},"region":{"startLine":573}}}],"partialFingerprints":{"codehealthFindingId/v1":"ee099c2a83fa3fd8baac848d325da1c6ad6a9bb5e30b20853890c0c20a193914"}},{"ruleId":"D1","level":"warning","message":{"text":"executorBuilder.buildBRIE (cyclomatic 50): executorBuilder.buildBRIE has cyclomatic complexity 50 (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/executor/brie.go"},"region":{"startLine":249}}}],"partialFingerprints":{"codehealthFindingId/v1":"6436a12208d67f71ef3053b579cb1540c5f564cb67725f30471049a2617c82d5"}},{"ruleId":"D1","level":"warning","message":{"text":"session.bootstrapSessionImpl (cyclomatic 50): session.bootstrapSessionImpl has cyclomatic complexity 50 (threshold 15). Of this number, 48 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":"pkg/session/session.go"},"region":{"startLine":4408}}}],"partialFingerprints":{"codehealthFindingId/v1":"1afe82d4e5a3a0eecbde07f4229dcf6d1717a566558b2ec5e2bb12964bc72d4d"}},{"ruleId":"D1","level":"warning","message":{"text":"SessionVars.SlowLogFormat (cyclomatic 50): SessionVars.SlowLogFormat has cyclomatic complexity 50 (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":"pkg/sessionctx/variable/slow_log.go"},"region":{"startLine":373}}}],"partialFingerprints":{"codehealthFindingId/v1":"4ae80ca612b18bdc5382cc2181da03a66c40e4de48b8dca7e528c30ff52a6e57"}},{"ruleId":"D1","level":"warning","message":{"text":"Server.handleBatchRequest (cyclomatic 50): Server.handleBatchRequest has cyclomatic complexity 50 (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":"pkg/store/mockstore/unistore/tikv/server_batch.go"},"region":{"startLine":133}}}],"partialFingerprints":{"codehealthFindingId/v1":"a6a5e2108c8766b571fccc166ca8d96a653f905a4165ab4ab0f421233197c29c"}},{"ruleId":"D1","level":"warning","message":{"text":"StmtRecord.Add (cyclomatic 50): StmtRecord.Add has cyclomatic complexity 50 (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":"pkg/util/stmtsummary/v2/record.go"},"region":{"startLine":247}}}],"partialFingerprints":{"codehealthFindingId/v1":"14ef64d2477fb218abd62116a39d5d137c261d56d8a40de5dc2b959575142729"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.insertJobIntoDeleteRangeTable (cyclomatic 49): ddl.insertJobIntoDeleteRangeTable has cyclomatic complexity 49 (threshold 15). Of this number, 48 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":"pkg/ddl/delete_range.go"},"region":{"startLine":277}}}],"partialFingerprints":{"codehealthFindingId/v1":"30e19d2fd0f465b77c5fd6c64d5e7a24faa750c738f50c8ffd125d9f2a597c6a"}},{"ruleId":"D1","level":"warning","message":{"text":"compareFunctionClass.refineArgs (cyclomatic 49): compareFunctionClass.refineArgs has cyclomatic complexity 49 (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":"pkg/expression/builtin_compare.go"},"region":{"startLine":1778}}}],"partialFingerprints":{"codehealthFindingId/v1":"2da2f7b5090e4c53eee0b380b0df2cd1126bea666457894cc988f7be3b9143ad"}},{"ruleId":"D1","level":"warning","message":{"text":"AggregationPushDownSolver.aggPushDown (cyclomatic 49): AggregationPushDownSolver.aggPushDown has cyclomatic complexity 49 (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":"pkg/planner/core/rule_aggregation_push_down.go"},"region":{"startLine":480}}}],"partialFingerprints":{"codehealthFindingId/v1":"e6134314a1d57dcbcf67a09c6c86b4f10169913da1961a8421397990d538cd87"}},{"ruleId":"D1","level":"warning","message":{"text":"stmtSummaryStats.add (cyclomatic 49): stmtSummaryStats.add has cyclomatic complexity 49 (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":"pkg/util/stmtsummary/statement_summary.go"},"region":{"startLine":791}}}],"partialFingerprints":{"codehealthFindingId/v1":"1af190ad52f9960716c916507445713904deeb6c9f4bfa4e8e27b98bdc0ce222"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.buildTablePartitionInfo (cyclomatic 48): ddl.buildTablePartitionInfo has cyclomatic complexity 48 (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":"pkg/ddl/partition.go"},"region":{"startLine":567}}}],"partialFingerprints":{"codehealthFindingId/v1":"f6beb0cf2a3e1b7b1b34a9ea8e8099a902ebe1c462493c2981f8b5617ddf92b8"}},{"ruleId":"D1","level":"warning","message":{"text":"worker.onExchangeTablePartition (cyclomatic 48): worker.onExchangeTablePartition has cyclomatic complexity 48 (threshold 15). Of this number, 44 points are the body\u0027s own statements and 4 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":"pkg/ddl/partition.go"},"region":{"startLine":2825}}}],"partialFingerprints":{"codehealthFindingId/v1":"5fda0c21cb44d29b89b085c19292987df0c4d293e2a67f707e766b303bc1a94b"}},{"ruleId":"D1","level":"warning","message":{"text":"SchemaTracker.AlterTable (cyclomatic 48): SchemaTracker.AlterTable has cyclomatic complexity 48 (threshold 15). Of this number, 47 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":"pkg/ddl/schematracker/dm_tracker.go"},"region":{"startLine":886}}}],"partialFingerprints":{"codehealthFindingId/v1":"575df5d921a2630d2eafc54c42373d8ec190247134d54681ecac9970792e0779"}},{"ruleId":"D1","level":"warning","message":{"text":"core.skylinePruning (cyclomatic 48): core.skylinePruning has cyclomatic complexity 48 (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":"pkg/planner/core/find_best_task.go"},"region":{"startLine":1752}}}],"partialFingerprints":{"codehealthFindingId/v1":"b9176db9612d9757cab63ab8cce852224071eb8d3e9e28c9d65e7bb885a1489a"}},{"ruleId":"D1","level":"warning","message":{"text":"RestoreConfig.ParseFromFlags (cyclomatic 47): RestoreConfig.ParseFromFlags has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"br/pkg/task/restore.go"},"region":{"startLine":488}}}],"partialFingerprints":{"codehealthFindingId/v1":"134bda4552fc780973c8d95b1b7cf965ecb0b431750d7a65fc5c45071de3ec1e"}},{"ruleId":"D1","level":"warning","message":{"text":"csvHeaderCheckItem.Check (cyclomatic 47): csvHeaderCheckItem.Check has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lightning/pkg/importer/precheck_impl.go"},"region":{"startLine":1160}}}],"partialFingerprints":{"codehealthFindingId/v1":"ebe11720a3b55eb9606d0b3cad21993e103e3442a84da34171c4ff61a2014d5b"}},{"ruleId":"D1","level":"warning","message":{"text":"expressionRewriter.handleInSubquery (cyclomatic 47): expressionRewriter.handleInSubquery has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/expression_rewriter.go"},"region":{"startLine":1284}}}],"partialFingerprints":{"codehealthFindingId/v1":"6bc56d8b1e38da391b207305ca62597beb15ae7356db1dc931b3126a023e8f00"}},{"ruleId":"D1","level":"warning","message":{"text":"FlatPhysicalPlan.flattenRecursively (cyclomatic 47): FlatPhysicalPlan.flattenRecursively has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/flat_plan.go"},"region":{"startLine":259}}}],"partialFingerprints":{"codehealthFindingId/v1":"222b02cf1c28b172349526531c4fbe76a4f33d87aa151a569732cda397772a55"}},{"ruleId":"D1","level":"warning","message":{"text":"havingWindowAndOrderbyExprResolver.Leave (cyclomatic 47): havingWindowAndOrderbyExprResolver.Leave has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/logical_plan_builder.go"},"region":{"startLine":2790}}}],"partialFingerprints":{"codehealthFindingId/v1":"529f7aa3482014f0f5d71ae9808c5d38c203ab6c29efac4e140fa79d27ad6e7f"}},{"ruleId":"D1","level":"warning","message":{"text":"PlanBuilder.coalesceCommonColumns (cyclomatic 47): PlanBuilder.coalesceCommonColumns has cyclomatic complexity 47 (threshold 15). Of this number, 44 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":"pkg/planner/core/logical_plan_builder.go"},"region":{"startLine":1148}}}],"partialFingerprints":{"codehealthFindingId/v1":"f2d4a935a963fd970866beadf22b1b6d15b4f8e04a7bbdd7e347b4acb8e01947"}},{"ruleId":"D1","level":"warning","message":{"text":"PlanBuilder.buildUpdateLists (cyclomatic 47): PlanBuilder.buildUpdateLists has cyclomatic complexity 47 (threshold 15). 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, 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":"pkg/planner/core/logical_plan_builder.go"},"region":{"startLine":6303}}}],"partialFingerprints":{"codehealthFindingId/v1":"fc243f29084986de90ae5f2d8e1dc4b741bccd82884964c912f0154919aca38b"}},{"ruleId":"D1","level":"warning","message":{"text":"PlanBuilder.buildSimple (cyclomatic 47): PlanBuilder.buildSimple has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/planbuilder.go"},"region":{"startLine":3723}}}],"partialFingerprints":{"codehealthFindingId/v1":"f3cea8f84f6e5a5d6e3988899fe4bb205b8cde7863f5d37c844e71aed0d658d6"}},{"ruleId":"D1","level":"warning","message":{"text":"hint.ParseStmtHints (cyclomatic 47): hint.ParseStmtHints has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/util/hint/hint.go"},"region":{"startLine":310}}}],"partialFingerprints":{"codehealthFindingId/v1":"71f29ef03424936b8f19fda977c22f9bce2a0da3821e35786def2fd01880d8fb"}},{"ruleId":"D1","level":"warning","message":{"text":"schemaCheckItem.SchemaIsValid (cyclomatic 46): schemaCheckItem.SchemaIsValid 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":"lightning/pkg/importer/precheck_impl.go"},"region":{"startLine":957}}}],"partialFingerprints":{"codehealthFindingId/v1":"92a27bd8577643245483a0d031d093faa77aba7d17bb36be17e2caaf5a1213bc"}},{"ruleId":"D1","level":"warning","message":{"text":"SetExecutor.setSysVariable (cyclomatic 46): SetExecutor.setSysVariable has cyclomatic complexity 46 (threshold 15). Of this number, 41 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":"pkg/executor/set.go"},"region":{"startLine":117}}}],"partialFingerprints":{"codehealthFindingId/v1":"71150fd9c2867c57a9b5f4ed99566e1d40b9127f1c2cf121c4e6a8525ea324a5"}},{"ruleId":"D1","level":"warning","message":{"text":"physicalop.BuildFinalModeAggregation (cyclomatic 46): physicalop.BuildFinalModeAggregation has cyclomatic complexity 46 (threshold 15). Of this number, 36 points are the body\u0027s own statements and 10 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":"pkg/planner/core/operator/physicalop/base_physical_agg.go"},"region":{"startLine":614}}}],"partialFingerprints":{"codehealthFindingId/v1":"502ae1aff335e9c73de2b7dddbd45df8d40eea030e09023a32782635f08b3f7d"}},{"ruleId":"D1","level":"warning","message":{"text":"PlanBuilder.buildShow (cyclomatic 46): PlanBuilder.buildShow 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":"pkg/planner/core/planbuilder.go"},"region":{"startLine":3532}}}],"partialFingerprints":{"codehealthFindingId/v1":"64930c6f1bf381c11387858424270645d1bb14c4215cf9ef3b722619552353c3"}},{"ruleId":"D1","level":"warning","message":{"text":"preprocessor.Leave (cyclomatic 46): preprocessor.Leave 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":"pkg/planner/core/preprocess.go"},"region":{"startLine":634}}}],"partialFingerprints":{"codehealthFindingId/v1":"97c86381bdcb65a420d1b7b999c4c10e31d64f9c8018f24cf4137c61d49b6c6a"}},{"ruleId":"D1","level":"warning","message":{"text":"dbTableMetaMgr.AllocTableRowIDs (cyclomatic 45): dbTableMetaMgr.AllocTableRowIDs has cyclomatic complexity 45 (threshold 15). Of this number, 25 points are the body\u0027s own statements and 20 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":"lightning/pkg/importer/meta_manager.go"},"region":{"startLine":181}}}],"partialFingerprints":{"codehealthFindingId/v1":"9371ad18a03c97b07b5e62c88ead58e7adc46c91999e54188260e27a08176135"}},{"ruleId":"D1","level":"warning","message":{"text":"SimpleExec.executeSetPwd (cyclomatic 45): SimpleExec.executeSetPwd has cyclomatic complexity 45 (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":"pkg/executor/simple.go"},"region":{"startLine":2857}}}],"partialFingerprints":{"codehealthFindingId/v1":"cc0d570dac63ca771b2aecf57ec9a2e7cb8584f316745fb63b24f551ef2b5639"}},{"ruleId":"D1","level":"warning","message":{"text":"LogicalJoin.updateEQCond (cyclomatic 45): LogicalJoin.updateEQCond has cyclomatic complexity 45 (threshold 15). Of this number, 22 points are the body\u0027s own statements and 23 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":"pkg/planner/core/operator/logicalop/logical_join.go"},"region":{"startLine":1700}}}],"partialFingerprints":{"codehealthFindingId/v1":"792257084b37b85a4eb184b90e8d50315a6d08b97559fac88d91a5893836af55"}},{"ruleId":"D1","level":"warning","message":{"text":"PlanBuilder.buildProjection (cyclomatic 45): PlanBuilder.buildProjection has cyclomatic complexity 45 (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":"pkg/planner/core/logical_plan_builder.go"},"region":{"startLine":1773}}}],"partialFingerprints":{"codehealthFindingId/v1":"332c6e47ecde749255022eef48b80c9c0b03b0146478fe7292cac3bab5af79ff"}},{"ruleId":"D1","level":"warning","message":{"text":"columnStatsUsageCollector.collectFromPlan (cyclomatic 45): columnStatsUsageCollector.collectFromPlan has cyclomatic complexity 45 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/rule/collect_column_stats_usage.go"},"region":{"startLine":264}}}],"partialFingerprints":{"codehealthFindingId/v1":"4bd27b61293c795ecf813b66c0b8c9c8763ac9d958e2857650ce29fbe9a36911"}},{"ruleId":"D1","level":"warning","message":{"text":"session.approxParseSQLTokenCnt (cyclomatic 45): session.approxParseSQLTokenCnt has cyclomatic complexity 45 (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":"pkg/session/session.go"},"region":{"startLine":1538}}}],"partialFingerprints":{"codehealthFindingId/v1":"2277428e2dc39b33a6bb895415c13728b32fcaf905d5de66f93f3627d7529ea3"}},{"ruleId":"D1","level":"warning","message":{"text":"copr.buildCopTasks (cyclomatic 45): copr.buildCopTasks has cyclomatic complexity 45 (threshold 15). Of this number, 44 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":"pkg/store/copr/coprocessor.go"},"region":{"startLine":525}}}],"partialFingerprints":{"codehealthFindingId/v1":"5a109512ec48b1b017ba258980f927aa11f7e85556aec40d2bc08788e30507cc"}},{"ruleId":"D1","level":"warning","message":{"text":"rangeDetacher.detachCNFCondAndBuildRangeForIndex (cyclomatic 45): rangeDetacher.detachCNFCondAndBuildRangeForIndex has cyclomatic complexity 45 (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":"pkg/util/ranger/detacher.go"},"region":{"startLine":397}}}],"partialFingerprints":{"codehealthFindingId/v1":"e94d924851f522e7263995a926df34e895c86b672f2c4faafea346ab5e29b36f"}},{"ruleId":"D1","level":"warning","message":{"text":"sqlescape.escapeSQL (cyclomatic 45): sqlescape.escapeSQL has cyclomatic complexity 45 (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":"pkg/util/sqlescape/utils.go"},"region":{"startLine":97}}}],"partialFingerprints":{"codehealthFindingId/v1":"c0c7ddc74fab49c08f50d9624dcda512922aaddb79a31fc52e9f1c0207e55851"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.checkIndexCondition (cyclomatic 44): ddl.checkIndexCondition has cyclomatic complexity 44 (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":"pkg/ddl/index.go"},"region":{"startLine":4086}}}],"partialFingerprints":{"codehealthFindingId/v1":"ec458c8d3b250c548baec3fc88957284ef5415d4ff6a4fe36b46fad70ba21d74"}},{"ruleId":"D1","level":"warning","message":{"text":"core.newPlanCacheKeyWithMatchedBinding (cyclomatic 44): core.newPlanCacheKeyWithMatchedBinding has cyclomatic complexity 44 (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":"pkg/planner/core/plan_cache_utils.go"},"region":{"startLine":325}}}],"partialFingerprints":{"codehealthFindingId/v1":"2280b12e2d38fe87e968fa2b8cb2141c51352dc113280792803d7c366abf6908"}},{"ruleId":"D1","level":"warning","message":{"text":"types.doDivMod (cyclomatic 44): types.doDivMod has cyclomatic complexity 44 (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":"pkg/types/mydecimal.go"},"region":{"startLine":2214}}}],"partialFingerprints":{"codehealthFindingId/v1":"526f868b9093c01ecc7b6c4e2224115a17435ddbe48e943f22bff3c0fe6841f4"}},{"ruleId":"D1","level":"warning","message":{"text":"InsertStmt.Restore (cyclomatic 44): InsertStmt.Restore has cyclomatic complexity 44 (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":"pkg/parser/ast/dml.go"},"region":{"startLine":2431}}}],"partialFingerprints":{"codehealthFindingId/v1":"31f11763a705448d909c74617b2d5ab7f160537fb30e79ab2ea614bd798cc46c"}},{"ruleId":"D1","level":"warning","message":{"text":"LogClient.RepairIngestIndex (cyclomatic 43): LogClient.RepairIngestIndex has cyclomatic complexity 43 (threshold 15). Of this number, 30 points are the body\u0027s own statements and 13 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":"br/pkg/restore/log_client/client.go"},"region":{"startLine":2137}}}],"partialFingerprints":{"codehealthFindingId/v1":"e3b50caba88673b9ca7c7994705b599847177bd567fbca0834fc122a87993b95"}},{"ruleId":"D1","level":"warning","message":{"text":"bindinfo.genPlanUnderState (cyclomatic 43): bindinfo.genPlanUnderState has cyclomatic complexity 43 (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/bindinfo/binding_plan_generation.go"},"region":{"startLine":389}}}],"partialFingerprints":{"codehealthFindingId/v1":"f1fb72b7cbdaeb6f894e38d24c057890cc0373bb7ffc730a182d95787376255a"}},{"ruleId":"D1","level":"warning","message":{"text":"VecGroupChecker.getFirstAndLastRowDatum (cyclomatic 43): VecGroupChecker.getFirstAndLastRowDatum has cyclomatic complexity 43 (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":"pkg/executor/internal/vecgroupchecker/vec_group_checker.go"},"region":{"startLine":160}}}],"partialFingerprints":{"codehealthFindingId/v1":"ce15cfa8776056ac713f5184cb72868f2fe1ed32a59281451d24d48a92ebc587"}},{"ruleId":"D1","level":"warning","message":{"text":"expression.EvalExpr (cyclomatic 43): expression.EvalExpr has cyclomatic complexity 43 (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":"pkg/expression/expression.go"},"region":{"startLine":678}}}],"partialFingerprints":{"codehealthFindingId/v1":"a21e5f2664240b1ef267711c5ac58b208d674070573fd84e1e1457d4ff973fa9"}},{"ruleId":"D1","level":"warning","message":{"text":"core.compareCandidates (cyclomatic 43): core.compareCandidates has cyclomatic complexity 43 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/find_best_task.go"},"region":{"startLine":854}}}],"partialFingerprints":{"codehealthFindingId/v1":"797f124b479cd6870bc1a64672c01b3cfa4ea361cee116ef3251a98de4c54e01"}},{"ruleId":"D1","level":"warning","message":{"text":"core.derivePathStatsAndTryHeuristics (cyclomatic 43): core.derivePathStatsAndTryHeuristics has cyclomatic complexity 43 (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":"pkg/planner/core/stats.go"},"region":{"startLine":633}}}],"partialFingerprints":{"codehealthFindingId/v1":"4a01310fc88431c06b8741f2fa5dfd177d9dde1356cc613339182856559760a8"}},{"ruleId":"D1","level":"warning","message":{"text":"SettingsHandler.ServeHTTP (cyclomatic 43): SettingsHandler.ServeHTTP has cyclomatic complexity 43 (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":"pkg/server/handler/tikvhandler/tikv_handler.go"},"region":{"startLine":438}}}],"partialFingerprints":{"codehealthFindingId/v1":"cd771850ec7f40fa9f41c7176a02111cd0cad11469a29e41bd1838448cb7964c"}},{"ruleId":"D1","level":"warning","message":{"text":"Tracker.Consume (cyclomatic 43): Tracker.Consume has cyclomatic complexity 43 (threshold 15). Of this number, 40 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":"pkg/util/memory/tracker.go"},"region":{"startLine":453}}}],"partialFingerprints":{"codehealthFindingId/v1":"c69c5b7f3ce64ee3622c1443f4cc08b90253919f19456221806347719e2725c6"}},{"ruleId":"D1","level":"warning","message":{"text":"conditionChecker.checkScalarFunction (cyclomatic 43): conditionChecker.checkScalarFunction has cyclomatic complexity 43 (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":"pkg/util/ranger/checker.go"},"region":{"startLine":55}}}],"partialFingerprints":{"codehealthFindingId/v1":"9681e691cc1f49ca9659ad815affae10d1b5e6c67985fef5063613bfea81af2a"}},{"ruleId":"D1","level":"warning","message":{"text":"task.RunRestore (cyclomatic 42): task.RunRestore has cyclomatic complexity 42 (threshold 15). Of this number, 26 points are the body\u0027s own statements and 16 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":"br/pkg/task/restore.go"},"region":{"startLine":982}}}],"partialFingerprints":{"codehealthFindingId/v1":"80f9fd86f524485fbbe2c2c84d8bee1dbe0149448d459fb2bc30ca66921a6dba"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.GetModifiableColumnJob (cyclomatic 42): ddl.GetModifiableColumnJob has cyclomatic complexity 42 (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":"pkg/ddl/modify_column.go"},"region":{"startLine":1838}}}],"partialFingerprints":{"codehealthFindingId/v1":"31ccb503cc6983e6cd9fb3af8e63a11ad0e1da04b1a78cdd65579732264ac01d"}},{"ruleId":"D1","level":"warning","message":{"text":"worker.onCreateIndex (cyclomatic 42): worker.onCreateIndex has cyclomatic complexity 42 (threshold 15). Of this number, 38 points are the body\u0027s own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/index.go"},"region":{"startLine":1161}}}],"partialFingerprints":{"codehealthFindingId/v1":"0ed135d1c061b8f0f5b063e5b339c99817cd5f948ca61a1adcec0aafed48e52d"}},{"ruleId":"D1","level":"warning","message":{"text":"expression.adjustRetFtForCastString (cyclomatic 42): expression.adjustRetFtForCastString has cyclomatic complexity 42 (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":"pkg/expression/builtin_cast.go"},"region":{"startLine":367}}}],"partialFingerprints":{"codehealthFindingId/v1":"b35d3a5ef7a396bf2bb6615965089a29256e91cf98fad004523fc46f43029936"}},{"ruleId":"D1","level":"warning","message":{"text":"expression.inferCollation (cyclomatic 42): expression.inferCollation has cyclomatic complexity 42 (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":"pkg/expression/collation.go"},"region":{"startLine":450}}}],"partialFingerprints":{"codehealthFindingId/v1":"a5c26cd2b98fd33bf0f040854d16b6ed48e0caf9acc9047d527113e4fe3d2ecc"}},{"ruleId":"D1","level":"warning","message":{"text":"Server.startHTTPServer (cyclomatic 42): Server.startHTTPServer has cyclomatic complexity 42 (threshold 15). Most of this is not in the body itself: 11 of the 42 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 464, 372, 439, \u2026). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals\u0027 work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/server/http_status.go"},"region":{"startLine":235}}}],"partialFingerprints":{"codehealthFindingId/v1":"2d5a2f2447dde3b6bb543d702391f027bd858b2f20025d6a39189aa554985998"}},{"ruleId":"D1","level":"warning","message":{"text":"MVCCStore.pessimisticLockInner (cyclomatic 42): MVCCStore.pessimisticLockInner has cyclomatic complexity 42 (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":"pkg/store/mockstore/unistore/tikv/mvcc.go"},"region":{"startLine":240}}}],"partialFingerprints":{"codehealthFindingId/v1":"9866959e6aa6c596ce7c7d51152ac3d68cab98964c4df9445c19d99016301c33"}},{"ruleId":"D1","level":"warning","message":{"text":"Time.convertDateFormat (cyclomatic 42): Time.convertDateFormat has cyclomatic complexity 42 (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/types/time.go"},"region":{"startLine":2790}}}],"partialFingerprints":{"codehealthFindingId/v1":"2ce210acddfc80415215825d1b49c2f09076f9d4e8404d3ca90a80de2b689e6f"}},{"ruleId":"D1","level":"warning","message":{"text":"expression.toBool (cyclomatic 41): expression.toBool has cyclomatic complexity 41 (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":"pkg/expression/expression.go"},"region":{"startLine":507}}}],"partialFingerprints":{"codehealthFindingId/v1":"0cadc76759e403bd95dc3b64fabacd04a2b98e7d37463191ea0aa05c1a83f13a"}},{"ruleId":"D1","level":"warning","message":{"text":"core.genHintsFromSingle (cyclomatic 41): core.genHintsFromSingle has cyclomatic complexity 41 (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":"pkg/planner/core/hint_utils.go"},"region":{"startLine":81}}}],"partialFingerprints":{"codehealthFindingId/v1":"4b2b69fee159d56f7de19d45c60d72fbfbe426ded1274c7ecc0166c428d9d4a3"}},{"ruleId":"D1","level":"warning","message":{"text":"core.tryLockMDLAndUpdateSchemaIfNecessary (cyclomatic 41): core.tryLockMDLAndUpdateSchemaIfNecessary has cyclomatic complexity 41 (threshold 15). Of this number, 35 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":"pkg/planner/core/preprocess.go"},"region":{"startLine":2196}}}],"partialFingerprints":{"codehealthFindingId/v1":"ca2a7e7330ecd5ac3d37e4fa0c19a190503ca8cc9374a0982ee34636a42e35c6"}},{"ruleId":"D1","level":"warning","message":{"text":"tableListExtractor.Enter (cyclomatic 41): tableListExtractor.Enter has cyclomatic complexity 41 (threshold 15). Of this number, 40 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":"pkg/planner/core/logical_plan_builder.go"},"region":{"startLine":7521}}}],"partialFingerprints":{"codehealthFindingId/v1":"312854e9a7fc1eb9acb5a0c7752b64e662e358f784d8460d420e5d5d4145e5f8"}},{"ruleId":"D1","level":"warning","message":{"text":"physicalop.handleTiFlashPredicatePushDown (cyclomatic 41): physicalop.handleTiFlashPredicatePushDown has cyclomatic complexity 41 (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":"pkg/planner/core/operator/physicalop/tiflash_predicate_push_down.go"},"region":{"startLine":267}}}],"partialFingerprints":{"codehealthFindingId/v1":"edaeb54989d600cfb3c23df8595a83e39ffe6d9053a2c1280564a99118c53f9b"}},{"ruleId":"D1","level":"warning","message":{"text":"planner.optimizeNoCache (cyclomatic 41): planner.optimizeNoCache has cyclomatic complexity 41 (threshold 15). Of this number, 39 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":"pkg/planner/optimize.go"},"region":{"startLine":223}}}],"partialFingerprints":{"codehealthFindingId/v1":"52d92c3459e7b14d41c6d816f69ef6acaa239b2a28ee7dfc2b8822cef38ba757"}},{"ruleId":"D1","level":"warning","message":{"text":"builder.buildFromBinOp (cyclomatic 41): builder.buildFromBinOp has cyclomatic complexity 41 (threshold 15). Of this number, 27 points are the body\u0027s own statements and 14 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":"pkg/util/ranger/points.go"},"region":{"startLine":278}}}],"partialFingerprints":{"codehealthFindingId/v1":"246ee4e9751be3d9aedf2cdf3cb90b3a0bd3351c7224877c955775f78fc4c9df"}},{"ruleId":"D1","level":"warning","message":{"text":"ast.GetStmtLabel (cyclomatic 41): ast.GetStmtLabel 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 taking that case\u0027s concrete type, so the dispatch reads one line per case. These arms are selected by TYPE rather than by value, so there is no key a lookup table could be built on; where you own the matched types, giving them one shared interface method and calling that is the form a table would have taken, and where you do not, keep the cases \u2014 they stay explicit and reviewable."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/parser/ast/ast.go"},"region":{"startLine":159}}}],"partialFingerprints":{"codehealthFindingId/v1":"ffacc37d3ecf7f910fc2925ca42fb9c5db810bfa7ce17620dbaac442f604d81f"}},{"ruleId":"D1","level":"warning","message":{"text":"ColumnOption.Restore (cyclomatic 41): ColumnOption.Restore has cyclomatic complexity 41 (threshold 15). Of this number, 39 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":"pkg/parser/ast/ddl.go"},"region":{"startLine":572}}}],"partialFingerprints":{"codehealthFindingId/v1":"051131d08b61e807f73dd3627d82894ac1c807d59c54b0106ca5d53a55f82e59"}},{"ruleId":"D1","level":"warning","message":{"text":"main.genColumnData (cyclomatic 40): main.genColumnData has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/importer/db.go"},"region":{"startLine":136}}}],"partialFingerprints":{"codehealthFindingId/v1":"21a922cea8a7088dc66e8e1114a6e76f407d7d65c66fc82c402c0e50b2a75718"}},{"ruleId":"D1","level":"warning","message":{"text":"dataLockWaitsTableRetriever.retrieve (cyclomatic 40): dataLockWaitsTableRetriever.retrieve has cyclomatic complexity 40 (threshold 15). Most of this is not in the body itself: 7 of the 40 points are its own statements and the rest belongs to one function literal inside it that branches (line 3230). 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":"pkg/executor/infoschema_reader.go"},"region":{"startLine":3198}}}],"partialFingerprints":{"codehealthFindingId/v1":"203e8c9df1173c4580018c7a3f35c66778d8c139e1e0a5cedf1f618b7e64c975"}},{"ruleId":"D1","level":"warning","message":{"text":"SimpleExec.executeDropUser (cyclomatic 40): SimpleExec.executeDropUser has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/simple.go"},"region":{"startLine":2510}}}],"partialFingerprints":{"codehealthFindingId/v1":"875ac1a9a7cfc3ffbd409bf78d1c6c5c5afd7724c9db45499b955e5da362d0de"}},{"ruleId":"D1","level":"warning","message":{"text":"core.constructDS2IndexScanTask (cyclomatic 40): core.constructDS2IndexScanTask has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/exhaust_physical_plans.go"},"region":{"startLine":1066}}}],"partialFingerprints":{"codehealthFindingId/v1":"b5ef2aa68c5d4b1a8ac8103567936d69edf75b919e0b0c8f3f30f5e5794b3851"}},{"ruleId":"D1","level":"warning","message":{"text":"LogicalJoin.SetPreferredJoinTypeAndOrder (cyclomatic 40): LogicalJoin.SetPreferredJoinTypeAndOrder has cyclomatic complexity 40 (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":"pkg/planner/core/operator/logicalop/logical_join.go"},"region":{"startLine":1542}}}],"partialFingerprints":{"codehealthFindingId/v1":"9cdd61bcbc3e8665e375745e70d1ed8433bd7a9fa8ff3c58cded60f3b97de9a0"}},{"ruleId":"D1","level":"warning","message":{"text":"PlanBuilder.buildDelete (cyclomatic 40): PlanBuilder.buildDelete has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/logical_plan_builder.go"},"region":{"startLine":6494}}}],"partialFingerprints":{"codehealthFindingId/v1":"e7a01ab9a2524385a095685eacb2a38e1166a8d644db248c7048b6b3c5847dee"}},{"ruleId":"D1","level":"warning","message":{"text":"LoadKeyspaceController.Handler (cyclomatic 40): LoadKeyspaceController.Handler has cyclomatic complexity 40 (threshold 15). Most of this is not in the body itself: 1 of the 40 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 233, 313, 366). 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":"pkg/standby/standby.go"},"region":{"startLine":230}}}],"partialFingerprints":{"codehealthFindingId/v1":"7993ab7078dadbb5537329611b3ea7b772c69023a22a8d819e8df85efe6330ad"}},{"ruleId":"D1","level":"warning","message":{"text":"BinaryJSON.extractToCallback (cyclomatic 40): BinaryJSON.extractToCallback has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/types/json_binary_functions.go"},"region":{"startLine":1261}}}],"partialFingerprints":{"codehealthFindingId/v1":"4f5ed8105b2018914d74e99f66624b4a983c01a14863187d6528422b05b81208"}},{"ruleId":"D1","level":"warning","message":{"text":"TableOptimizerHint.Restore (cyclomatic 40): TableOptimizerHint.Restore has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/parser/ast/misc.go"},"region":{"startLine":4208}}}],"partialFingerprints":{"codehealthFindingId/v1":"cd4ba24ce5001a55d6ab01f30969f362e9b1c42ecadfdabec3a0976ffa45f016"}},{"ruleId":"D1","level":"warning","message":{"text":"worker.doModifyColumnTypeWithData (cyclomatic 39): worker.doModifyColumnTypeWithData has cyclomatic complexity 39 (threshold 15). Of this number, 36 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":"pkg/ddl/modify_column.go"},"region":{"startLine":924}}}],"partialFingerprints":{"codehealthFindingId/v1":"11e9475ff760ce7e19c9655c6ea3588b0b72793e5f855ab690ea636013dbf4ad"}},{"ruleId":"D1","level":"warning","message":{"text":"selectResult.updateCopRuntimeStats (cyclomatic 39): selectResult.updateCopRuntimeStats has cyclomatic complexity 39 (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":"pkg/distsql/select_result.go"},"region":{"startLine":635}}}],"partialFingerprints":{"codehealthFindingId/v1":"bfc2906db51817ad5bc1023c58241e97ad9caa9780391305a3d710f4429a4490"}},{"ruleId":"D1","level":"warning","message":{"text":"expression.ColumnSubstituteImpl (cyclomatic 39): expression.ColumnSubstituteImpl has cyclomatic complexity 39 (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":"pkg/expression/util.go"},"region":{"startLine":566}}}],"partialFingerprints":{"codehealthFindingId/v1":"5d57d0a1630c3e623c2722854dd3555c50e3f7c8350f6279b20ce23ea1c14612"}},{"ruleId":"D1","level":"warning","message":{"text":"expression.ExecBinaryParam (cyclomatic 39): expression.ExecBinaryParam has cyclomatic complexity 39 (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":"pkg/expression/util.go"},"region":{"startLine":2117}}}],"partialFingerprints":{"codehealthFindingId/v1":"b0266a9c37b2e103441ef319b6fa3d15ddc263155ab0a13355ea5dcef6b9c996"}},{"ruleId":"D1","level":"warning","message":{"text":"core.convertToIndexScan (cyclomatic 39): core.convertToIndexScan has cyclomatic complexity 39 (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":"pkg/planner/core/find_best_task.go"},"region":{"startLine":2553}}}],"partialFingerprints":{"codehealthFindingId/v1":"3bc13b46fb4a373dd8696e76c02d0674ab6158be3bbc8e460dace38ab14c1c1b"}},{"ruleId":"D1","level":"warning","message":{"text":"clientConn.readOptionalSSLRequestAndHandshakeResponse (cyclomatic 39): clientConn.readOptionalSSLRequestAndHandshakeResponse has cyclomatic complexity 39 (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":"pkg/server/conn.go"},"region":{"startLine":580}}}],"partialFingerprints":{"codehealthFindingId/v1":"bc94bc22d3a86853cc5e5f78510c7caca6258eba808eb03f0bf2bbeea20533cd"}},{"ruleId":"D1","level":"warning","message":{"text":"types.doSub (cyclomatic 39): types.doSub has cyclomatic complexity 39 (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":"pkg/types/mydecimal.go"},"region":{"startLine":1737}}}],"partialFingerprints":{"codehealthFindingId/v1":"7f680cdd06bbe515aea72afda5fd5a171d68eef7b512e0fc9f485b4b6b55ef64"}},{"ruleId":"D1","level":"warning","message":{"text":"types.parseSingleTimeValue (cyclomatic 39): types.parseSingleTimeValue has cyclomatic complexity 39 (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":"pkg/types/time.go"},"region":{"startLine":2334}}}],"partialFingerprints":{"codehealthFindingId/v1":"34a1ab09de16a07aec4d1b151ce7ea46874892a369f14f865b8bbdea14ba0bdd"}},{"ruleId":"D1","level":"warning","message":{"text":"MyDecimal.Round (cyclomatic 39): MyDecimal.Round has cyclomatic complexity 39 (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":"pkg/types/mydecimal.go"},"region":{"startLine":822}}}],"partialFingerprints":{"codehealthFindingId/v1":"1fbe0d9324a0bc4785dd10ee08dab69e0e505640a50ad551f7ab07f8916563c3"}},{"ruleId":"D1","level":"warning","message":{"text":"executor.DoDDLJobWrapper (cyclomatic 38): executor.DoDDLJobWrapper has cyclomatic complexity 38 (threshold 15). Of this number, 37 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":"pkg/ddl/executor.go"},"region":{"startLine":7218}}}],"partialFingerprints":{"codehealthFindingId/v1":"d8ef30e9482442fdab9524046f6e37760483c3b88f89db7b2ba54f116bc3ebdf"}},{"ruleId":"D1","level":"warning","message":{"text":"expression.genVecFromConstExpr (cyclomatic 38): expression.genVecFromConstExpr has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/vectorized.go"},"region":{"startLine":23}}}],"partialFingerprints":{"codehealthFindingId/v1":"0b6c524a89de108ea1e1acfd8f4961be6bfe1ccbf4c764364112147fad70186e"}},{"ruleId":"D1","level":"warning","message":{"text":"Engine.ingestSSTLoop (cyclomatic 38): Engine.ingestSSTLoop has cyclomatic complexity 38 (threshold 15). Most of this is not in the body itself: 15 of the 38 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 664, 752, 737). 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":"pkg/ingestor/ingestctrl/engine.go"},"region":{"startLine":634}}}],"partialFingerprints":{"codehealthFindingId/v1":"85b793aa120c1c713f176412331e60188e5574a6317e6f12aea0cd0d7b128d53"}},{"ruleId":"D1","level":"warning","message":{"text":"s3store.NewS3Storage (cyclomatic 38): s3store.NewS3Storage has cyclomatic complexity 38 (threshold 15). Of this number, 35 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":"pkg/objstore/s3store/store.go"},"region":{"startLine":58}}}],"partialFingerprints":{"codehealthFindingId/v1":"f14a774e6ac17e7108c1c2491d9986daa7048bda916071907ba6abc61f0d7390"}},{"ruleId":"D1","level":"warning","message":{"text":"PlanBuilder.buildJoin (cyclomatic 38): PlanBuilder.buildJoin has cyclomatic complexity 38 (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":"pkg/planner/core/logical_plan_builder.go"},"region":{"startLine":736}}}],"partialFingerprints":{"codehealthFindingId/v1":"a6fecd815402a57809fe51a4bb5ed2d2dce62b7bee2f3c6be6daf0d210307030"}},{"ruleId":"D1","level":"warning","message":{"text":"clientConn.prefetchPointPlanKeys (cyclomatic 38): clientConn.prefetchPointPlanKeys has cyclomatic complexity 38 (threshold 15). Of this number, 24 points are the body\u0027s own statements and 14 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":"pkg/server/conn.go"},"region":{"startLine":1984}}}],"partialFingerprints":{"codehealthFindingId/v1":"7e95b7763900458fd3ea6e57b30e169ccd317b9c76cdfd6e9595ee919c75925a"}},{"ruleId":"D1","level":"warning","message":{"text":"stmtsummary.addInfo (cyclomatic 38): stmtsummary.addInfo has cyclomatic complexity 38 (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":"pkg/util/stmtsummary/evicted.go"},"region":{"startLine":222}}}],"partialFingerprints":{"codehealthFindingId/v1":"a5e38f55e1112ba147843a9b2424f0c7df3d537e093bb05fd2b138d24d2668ff"}},{"ruleId":"D1","level":"warning","message":{"text":"StmtRecord.Merge (cyclomatic 38): StmtRecord.Merge has cyclomatic complexity 38 (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":"pkg/util/stmtsummary/v2/record.go"},"region":{"startLine":472}}}],"partialFingerprints":{"codehealthFindingId/v1":"27466a08f7a19e034954731c9c9d0c1e01ddfdfb3e7626a5b6be25ec914f1deb"}},{"ruleId":"D1","level":"warning","message":{"text":"Config.ParseFromFlags (cyclomatic 37): Config.ParseFromFlags has cyclomatic complexity 37 (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":"br/pkg/task/common.go"},"region":{"startLine":648}}}],"partialFingerprints":{"codehealthFindingId/v1":"1effbd051789c236432688a9139b608bccdc56f1f0f70dff132d872e77e0ffbc"}},{"ruleId":"D1","level":"warning","message":{"text":"TableImporter.importTable (cyclomatic 37): TableImporter.importTable has cyclomatic complexity 37 (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":"lightning/pkg/importer/table_import.go"},"region":{"startLine":118}}}],"partialFingerprints":{"codehealthFindingId/v1":"f022719fe06109d0eb167337aae84f0eb96b0a1b683a5ffedc6798b07a5bafa8"}},{"ruleId":"D1","level":"warning","message":{"text":"executor.getKeysNeedCheckOneRow (cyclomatic 37): executor.getKeysNeedCheckOneRow has cyclomatic complexity 37 (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":"pkg/executor/batch_checker.go"},"region":{"startLine":97}}}],"partialFingerprints":{"codehealthFindingId/v1":"49f7a97644f856b89a54117da79a32af9deba3da7aa797fcd427f89de5239721"}},{"ruleId":"D1","level":"warning","message":{"text":"core.attach2Task4PhysicalTopN (cyclomatic 37): core.attach2Task4PhysicalTopN has cyclomatic complexity 37 (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":"pkg/planner/core/task.go"},"region":{"startLine":1249}}}],"partialFingerprints":{"codehealthFindingId/v1":"d8254471f425b74486f408c393b748c72a475b92dd99744f206d8546e80726cf"}},{"ruleId":"D1","level":"warning","message":{"text":"expressionRewriter.Enter (cyclomatic 37): expressionRewriter.Enter has cyclomatic complexity 37 (threshold 15). Of this number, 27 points are the body\u0027s own statements and 10 belong to 4 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":"pkg/planner/core/expression_rewriter.go"},"region":{"startLine":535}}}],"partialFingerprints":{"codehealthFindingId/v1":"b2e92c83c9f16397ea4a44d5f45c5189ee7d69e0a65d812173fad4dc19f17f0d"}},{"ruleId":"D1","level":"warning","message":{"text":"PlanBuilder.buildAdmin (cyclomatic 37): PlanBuilder.buildAdmin has cyclomatic complexity 37 (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/planner/core/planbuilder.go"},"region":{"startLine":1667}}}],"partialFingerprints":{"codehealthFindingId/v1":"0b4ba081581b447687fc4d0283497ec138b5a23dfb2412490433c4001722813d"}},{"ruleId":"D1","level":"warning","message":{"text":"clientConn.dispatch (cyclomatic 37): clientConn.dispatch has cyclomatic complexity 37 (threshold 15). Of this number, 35 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":"pkg/server/conn.go"},"region":{"startLine":1437}}}],"partialFingerprints":{"codehealthFindingId/v1":"96e10ea35836a906ee7764f5fc0cc85ca09747f6445b9f8e478851f1c64dca5a"}},{"ruleId":"D1","level":"warning","message":{"text":"globalstats.blockingMergePartitionStats2GlobalStats (cyclomatic 37): globalstats.blockingMergePartitionStats2GlobalStats has cyclomatic complexity 37 (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":"pkg/statistics/handle/globalstats/global_stats.go"},"region":{"startLine":168}}}],"partialFingerprints":{"codehealthFindingId/v1":"35ada667ee48507428abee05b790c92a81a66b988b801e2dbff28a733a9dd4ee"}},{"ruleId":"D1","level":"warning","message":{"text":"MetaReader.ReadSchemasFiles (cyclomatic 36): MetaReader.ReadSchemasFiles has cyclomatic complexity 36 (threshold 15). Most of this is not in the body itself: 13 of the 36 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 563, 636, 547, \u2026). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals\u0027 work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"br/pkg/metautil/metafile.go"},"region":{"startLine":533}}}],"partialFingerprints":{"codehealthFindingId/v1":"02ffb1ff171c359c390dff8f9e18c2a88d77d8860b7608bf9e58f3f99d5e2800"}},{"ruleId":"D1","level":"warning","message":{"text":"importer.NewImportControllerWithPauser (cyclomatic 36): importer.NewImportControllerWithPauser has cyclomatic complexity 36 (threshold 15). Of this number, 32 points are the body\u0027s own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lightning/pkg/importer/import.go"},"region":{"startLine":306}}}],"partialFingerprints":{"codehealthFindingId/v1":"b193cb1724bb4e3c94d23b828f8220f612acc3e57ab13f573b48c3ece11ea0bc"}},{"ruleId":"D1","level":"warning","message":{"text":"executor.dropTableObject (cyclomatic 36): executor.dropTableObject has cyclomatic complexity 36 (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":"pkg/ddl/executor.go"},"region":{"startLine":4254}}}],"partialFingerprints":{"codehealthFindingId/v1":"f0230f7c8be236b36c2063ac42e5cc82aa5cf8fb7e7fa5df048c96220ec9fd00"}},{"ruleId":"D1","level":"warning","message":{"text":"domain.DumpPlanReplayerInfo (cyclomatic 36): domain.DumpPlanReplayerInfo has cyclomatic complexity 36 (threshold 15). Of this number, 29 points are the body\u0027s own statements and 7 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/domain/plan_replayer_dump.go"},"region":{"startLine":234}}}],"partialFingerprints":{"codehealthFindingId/v1":"48c51994470a3f4b658439efe95453e155d490eb51158b3139439c0f7fb3b528"}},{"ruleId":"D1","level":"warning","message":{"text":"importScheduler.OnNextSubtasksBatch (cyclomatic 36): importScheduler.OnNextSubtasksBatch has cyclomatic complexity 36 (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":"pkg/dxf/importinto/scheduler.go"},"region":{"startLine":385}}}],"partialFingerprints":{"codehealthFindingId/v1":"bb2e93531888b13682caf05b9f848334d9180a3a0241f426c0365beaaf241a91"}},{"ruleId":"D1","level":"warning","message":{"text":"AnalyzeColumnsExec.buildSamplingStats (cyclomatic 36): AnalyzeColumnsExec.buildSamplingStats has cyclomatic complexity 36 (threshold 15). Of this number, 28 points are the body\u0027s own statements and 8 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":"pkg/executor/analyze_col_sampling.go"},"region":{"startLine":193}}}],"partialFingerprints":{"codehealthFindingId/v1":"c3421ba624c2cc247407f4900ad61e9275ae28d7f424d779245163609fb5af28"}},{"ruleId":"D1","level":"warning","message":{"text":"InsertValues.batchCheckAndInsert (cyclomatic 36): InsertValues.batchCheckAndInsert has cyclomatic complexity 36 (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":"pkg/executor/insert_common.go"},"region":{"startLine":1244}}}],"partialFingerprints":{"codehealthFindingId/v1":"6fe9a497ddd1b3db0541d7e3faad444a5e23986e773de2f8832fe36cce7ae56d"}},{"ruleId":"D1","level":"warning","message":{"text":"expression.foldConstant (cyclomatic 36): expression.foldConstant has cyclomatic complexity 36 (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":"pkg/expression/constant_fold.go"},"region":{"startLine":162}}}],"partialFingerprints":{"codehealthFindingId/v1":"520dec19889ac08598e41437e67bffb8053b881d2f2268f283eaa81361492b3f"}},{"ruleId":"D1","level":"warning","message":{"text":"cardinality.getIndexRowCountForStatsV2 (cyclomatic 36): cardinality.getIndexRowCountForStatsV2 has cyclomatic complexity 36 (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":"pkg/planner/cardinality/row_count_index.go"},"region":{"startLine":198}}}],"partialFingerprints":{"codehealthFindingId/v1":"051ada892a9d464cabe514807530682f41ce5e75405c251643cb01d28ca4421d"}},{"ruleId":"D1","level":"warning","message":{"text":"core.matchPropForIndexMergeAlternatives (cyclomatic 36): core.matchPropForIndexMergeAlternatives has cyclomatic complexity 36 (threshold 15). Of this number, 31 points are the body\u0027s own statements and 5 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":"pkg/planner/core/find_best_task.go"},"region":{"startLine":1402}}}],"partialFingerprints":{"codehealthFindingId/v1":"72e6413ebfcf606ba18aa6f3584cd9b32378725c5b2d2d7c8811a6fcdb6a318c"}},{"ruleId":"D1","level":"warning","message":{"text":"core.getNameValuePairs (cyclomatic 36): core.getNameValuePairs has cyclomatic complexity 36 (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":"pkg/planner/core/point_get_plan.go"},"region":{"startLine":924}}}],"partialFingerprints":{"codehealthFindingId/v1":"e5f7656d1d36a8c8ec6301121a93e241e558590dce14e81ce6dd9ac49d8b2c41"}},{"ruleId":"D1","level":"warning","message":{"text":"core.checkColumn (cyclomatic 36): core.checkColumn has cyclomatic complexity 36 (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":"pkg/planner/core/preprocess.go"},"region":{"startLine":1578}}}],"partialFingerprints":{"codehealthFindingId/v1":"586adc81e007b3410ce8b33f406ac0d5c674ae9f4f7c6c129a7989b72f574b1c"}},{"ruleId":"D1","level":"warning","message":{"text":"Explain.RenderResult (cyclomatic 36): Explain.RenderResult has cyclomatic complexity 36 (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":"pkg/planner/core/common_plans.go"},"region":{"startLine":826}}}],"partialFingerprints":{"codehealthFindingId/v1":"eec866f6f36feae94377c57abac6c9f5455a02a5d2c5756a55442a9e0ff51e77"}},{"ruleId":"D1","level":"warning","message":{"text":"main.genPlanCloneForPlanCache (cyclomatic 36): main.genPlanCloneForPlanCache has cyclomatic complexity 36 (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/planner/core/generator/plan_cache/plan_clone_generator.go"},"region":{"startLine":62}}}],"partialFingerprints":{"codehealthFindingId/v1":"c9423d4c5c3fd336f33578ba32ee1394506c2fb30f1bf2fc613b8e66d50ae0b4"}},{"ruleId":"D1","level":"warning","message":{"text":"cacheableChecker.Enter (cyclomatic 36): cacheableChecker.Enter has cyclomatic complexity 36 (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":"pkg/planner/core/plan_cacheable_checker.go"},"region":{"startLine":96}}}],"partialFingerprints":{"codehealthFindingId/v1":"179d874da25f8b22b428e0216bdeef68e2a0fc228494c443eba08928957d96ea"}},{"ruleId":"D1","level":"warning","message":{"text":"PlanBuilder.buildUpdate (cyclomatic 36): PlanBuilder.buildUpdate has cyclomatic complexity 36 (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":"pkg/planner/core/logical_plan_builder.go"},"region":{"startLine":6048}}}],"partialFingerprints":{"codehealthFindingId/v1":"333e6bb1edc69aece198155b2f54100f4293e082fd2df14be242e7c128167f10"}},{"ruleId":"D1","level":"warning","message":{"text":"FDSet.ProjectCols (cyclomatic 36): FDSet.ProjectCols has cyclomatic complexity 36 (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":"pkg/planner/funcdep/fd_graph.go"},"region":{"startLine":985}}}],"partialFingerprints":{"codehealthFindingId/v1":"9011a24dfc814daccf71ffc0ad29a8078fbae0b1d4ba41a931227e4aea5c31e3"}},{"ruleId":"D1","level":"warning","message":{"text":"copr.balanceBatchCopTask (cyclomatic 36): copr.balanceBatchCopTask has cyclomatic complexity 36 (threshold 15). Of this number, 28 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":"pkg/store/copr/batch_coprocessor.go"},"region":{"startLine":296}}}],"partialFingerprints":{"codehealthFindingId/v1":"801858ca00ad05fb37e6ac6c3a6f5ebe5aee7562d17b8e6965643526855397e4"}},{"ruleId":"D1","level":"warning","message":{"text":"MyDecimal.FromString (cyclomatic 36): MyDecimal.FromString has cyclomatic complexity 36 (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":"pkg/types/mydecimal.go"},"region":{"startLine":406}}}],"partialFingerprints":{"codehealthFindingId/v1":"8289c532adcab75ad696a6b806cc57f032060e48109df604e9cf9f4597f99ec7"}},{"ruleId":"D1","level":"warning","message":{"text":"ExecDetails.String (cyclomatic 36): ExecDetails.String has cyclomatic complexity 36 (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":"pkg/util/execdetails/execdetails.go"},"region":{"startLine":236}}}],"partialFingerprints":{"codehealthFindingId/v1":"35aa5b2a781e67c648dfbbc7b30a1f046537ad4973ab7a9bd5c6fa50e0ac249f"}},{"ruleId":"D1","level":"warning","message":{"text":"ranger.getPotentialEqOrInColOffset (cyclomatic 36): ranger.getPotentialEqOrInColOffset has cyclomatic complexity 36 (threshold 15). Of this number, 35 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":"pkg/util/ranger/detacher.go"},"region":{"startLine":109}}}],"partialFingerprints":{"codehealthFindingId/v1":"b750c156a5ea9bc9f6cefbba90d378158135ebccb2d737ce1fcd3b15de63d30b"}},{"ruleId":"D1","level":"warning","message":{"text":"Scanner.Lex (cyclomatic 36): Scanner.Lex has cyclomatic complexity 36 (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":"pkg/parser/lexer.go"},"region":{"startLine":237}}}],"partialFingerprints":{"codehealthFindingId/v1":"e0027718c043f71f210ca39dec398484410857e07acb91be4b95b125e962c914"}},{"ruleId":"D1","level":"warning","message":{"text":"task.RunStreamRestore (cyclomatic 35): task.RunStreamRestore has cyclomatic complexity 35 (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":"br/pkg/task/stream.go"},"region":{"startLine":1370}}}],"partialFingerprints":{"codehealthFindingId/v1":"13c8481c257fe282999bc487c67b2ca301c9dcf85d41a12ae5b045688b024c98"}},{"ruleId":"D1","level":"warning","message":{"text":"Controller.preCheckRequirements (cyclomatic 35): Controller.preCheckRequirements has cyclomatic complexity 35 (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":"lightning/pkg/importer/import.go"},"region":{"startLine":1888}}}],"partialFingerprints":{"codehealthFindingId/v1":"0fd13dc17bcc64e7b47f6af293348c433078c2687322a1a5620eaff5fe173a03"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.getDefaultValue (cyclomatic 35): ddl.getDefaultValue has cyclomatic complexity 35 (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":"pkg/ddl/add_column.go"},"region":{"startLine":814}}}],"partialFingerprints":{"codehealthFindingId/v1":"bc7a6e780fc22e5834b9dc306826f94911e7e0f0de44bf511f41de3342ab1e79"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.checkTableDefCompatible (cyclomatic 35): ddl.checkTableDefCompatible has cyclomatic complexity 35 (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":"pkg/ddl/executor.go"},"region":{"startLine":3060}}}],"partialFingerprints":{"codehealthFindingId/v1":"f0cb120e48576ee882d98a1cd60856461e94a5e4a9df2c3968091a2763ccacc4"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.GeneratePartDefsFromInterval (cyclomatic 35): ddl.GeneratePartDefsFromInterval has cyclomatic complexity 35 (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":"pkg/ddl/partition.go"},"region":{"startLine":1283}}}],"partialFingerprints":{"codehealthFindingId/v1":"3c396806b6e8ffa3ad995f953b848a88bd0ec58737069497551947f67c508690"}},{"ruleId":"D1","level":"warning","message":{"text":"Backend.doWrite (cyclomatic 35): Backend.doWrite has cyclomatic complexity 35 (threshold 15). Of this number, 25 points are the body\u0027s own statements and 10 belong to 4 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":"pkg/ingestor/ingestctrl/region_job.go"},"region":{"startLine":331}}}],"partialFingerprints":{"codehealthFindingId/v1":"3f517b1e3b5d2c34a5b651f0efdcfe6c1cd295e69107f826a517b50f9d095742"}},{"ruleId":"D1","level":"warning","message":{"text":"config.LoadGlobalConfig (cyclomatic 35): config.LoadGlobalConfig has cyclomatic complexity 35 (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":"pkg/lightning/config/global.go"},"region":{"startLine":142}}}],"partialFingerprints":{"codehealthFindingId/v1":"7f6dc146d7a88df5df65e5c302a6884a6096b7b7c6d20522534e006ca2c3eb82"}},{"ruleId":"D1","level":"warning","message":{"text":"core.findBestTask (cyclomatic 35): core.findBestTask has cyclomatic complexity 35 (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":"pkg/planner/core/find_best_task.go"},"region":{"startLine":604}}}],"partialFingerprints":{"codehealthFindingId/v1":"4e111df639421376898548937eb5e88221dd387282420fa97b1c5ccfe3046aa9"}},{"ruleId":"D1","level":"warning","message":{"text":"core.checkAccessFilter4IdxCol (cyclomatic 35): core.checkAccessFilter4IdxCol has cyclomatic complexity 35 (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":"pkg/planner/core/indexmerge_path.go"},"region":{"startLine":1238}}}],"partialFingerprints":{"codehealthFindingId/v1":"0429734db765830ac7dab1f6a2104147107c434174fe28a921f816a83da9b647"}},{"ruleId":"D1","level":"warning","message":{"text":"physicalop.tryToGetMppHashAggs (cyclomatic 35): physicalop.tryToGetMppHashAggs has cyclomatic complexity 35 (threshold 15). Of this number, 27 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":"pkg/planner/core/operator/physicalop/physical_hash_agg.go"},"region":{"startLine":114}}}],"partialFingerprints":{"codehealthFindingId/v1":"c2ece25d517188cb616a8d0f9a58649b679d1737f6d67c4aec5832d64a997f23"}},{"ruleId":"D1","level":"warning","message":{"text":"PlanBuilder.buildMemTable (cyclomatic 35): PlanBuilder.buildMemTable has cyclomatic complexity 35 (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/planner/core/logical_plan_builder.go"},"region":{"startLine":5371}}}],"partialFingerprints":{"codehealthFindingId/v1":"4bba001b96c7aa1134ea682d38b1172bdc603ac01e61f3d36962c51396e99bef"}},{"ruleId":"D1","level":"warning","message":{"text":"rule.PruneIndexesByWhereAndOrder (cyclomatic 35): rule.PruneIndexesByWhereAndOrder has cyclomatic complexity 35 (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":"pkg/planner/core/rule/rule_prune_indexes.go"},"region":{"startLine":100}}}],"partialFingerprints":{"codehealthFindingId/v1":"d18779b0232bf53e3b51d27a9315b7da2a799465d9c3b1946a2ad5c78f342aee"}},{"ruleId":"D1","level":"warning","message":{"text":"statistics.EnumRangeValues (cyclomatic 35): statistics.EnumRangeValues has cyclomatic complexity 35 (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":"pkg/statistics/scalar.go"},"region":{"startLine":227}}}],"partialFingerprints":{"codehealthFindingId/v1":"0c4687b32b7cc5cce3ebd27fc1c3c2a603c38e0c162d37aecdea318baee5c490"}},{"ruleId":"D1","level":"warning","message":{"text":"storage.SaveAnalyzeResultToStorage (cyclomatic 35): storage.SaveAnalyzeResultToStorage has cyclomatic complexity 35 (threshold 15). Of this number, 34 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":"pkg/statistics/handle/storage/save.go"},"region":{"startLine":119}}}],"partialFingerprints":{"codehealthFindingId/v1":"d57121be7f61cc8b43d77cdfcafbd6c5d97c8377316899b609c58c0c27d857b1"}},{"ruleId":"D1","level":"warning","message":{"text":"staticTestHelper.assertDeepClonedEqual (cyclomatic 35): staticTestHelper.assertDeepClonedEqual has cyclomatic complexity 35 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/util/deeptest/statictesthelper.go"},"region":{"startLine":130}}}],"partialFingerprints":{"codehealthFindingId/v1":"85cc7812187bd37f621c681051065e7d6e67b907f430dee27ec774c59b4a7efe"}},{"ruleId":"D1","level":"warning","message":{"text":"ast.convertBinaryStringLiterals (cyclomatic 35): ast.convertBinaryStringLiterals has cyclomatic complexity 35 (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":"pkg/parser/ast/base.go"},"region":{"startLine":137}}}],"partialFingerprints":{"codehealthFindingId/v1":"92d4448591eb791a7560f3bea8c79d0a53ac4bcc4ecaab2be92fb351c9e8f83e"}},{"ruleId":"D1","level":"warning","message":{"text":"Config.Load (cyclomatic 34): Config.Load 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":"pkg/config/config.go"},"region":{"startLine":1599}}}],"partialFingerprints":{"codehealthFindingId/v1":"8c2e2c1708f216b3bcbcf60c3d6ebe0150957d8efa554252521ecbf23c61576e"}},{"ruleId":"D1","level":"warning","message":{"text":"worker.doModifyColumnIndexReorg (cyclomatic 34): worker.doModifyColumnIndexReorg has cyclomatic complexity 34 (threshold 15). Of this number, 32 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":"pkg/ddl/modify_column.go"},"region":{"startLine":1137}}}],"partialFingerprints":{"codehealthFindingId/v1":"39913b50f81c138cc689a4bf417eaf1a48281a2604b383c61939c0d291a70eac"}},{"ruleId":"D1","level":"warning","message":{"text":"worker.onTruncateTable (cyclomatic 34): worker.onTruncateTable has cyclomatic complexity 34 (threshold 15). Of this number, 32 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":"pkg/ddl/table.go"},"region":{"startLine":455}}}],"partialFingerprints":{"codehealthFindingId/v1":"4f643b0aaf5ddfe2900980814b35d5deb94649284d87d2910a4121f87616b735"}},{"ruleId":"D1","level":"warning","message":{"text":"builtinRegexpInStrFuncSig.vecEvalInt (cyclomatic 34): builtinRegexpInStrFuncSig.vecEvalInt 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":"pkg/expression/builtin_regexp.go"},"region":{"startLine":793}}}],"partialFingerprints":{"codehealthFindingId/v1":"0adddf5e10d83d69121069bf5e792eb11954070afec7b6674f23d69e468c44fd"}},{"ruleId":"D1","level":"warning","message":{"text":"core.enumeratePhysicalPlans4TaskHelper (cyclomatic 34): core.enumeratePhysicalPlans4TaskHelper 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":"pkg/planner/core/find_best_task.go"},"region":{"startLine":155}}}],"partialFingerprints":{"codehealthFindingId/v1":"5809c65f7a61ea53f193dccc8feae0ded6cf8465e4f61b5dc16667a9722a8130"}},{"ruleId":"D1","level":"warning","message":{"text":"core.rebuildRange (cyclomatic 34): core.rebuildRange 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":"pkg/planner/core/plan_cache_rebuild.go"},"region":{"startLine":76}}}],"partialFingerprints":{"codehealthFindingId/v1":"7c0139ff49a5b905ff2f9377a7322089878376c90518a11a6a442a103d6667cb"}},{"ruleId":"D1","level":"warning","message":{"text":"PlanBuilder.buildRecursiveCTE (cyclomatic 34): PlanBuilder.buildRecursiveCTE 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":"pkg/planner/core/logical_plan_builder.go"},"region":{"startLine":7749}}}],"partialFingerprints":{"codehealthFindingId/v1":"d7a814116ac57a48a5f00105f4dbb795307a812a55611c486f083e9ac24685a8"}},{"ruleId":"D1","level":"warning","message":{"text":"MySQLPrivilege.decodeUserTableRow (cyclomatic 34): MySQLPrivilege.decodeUserTableRow has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 1 of the 34 points is its own statement and the rest belongs to one function literal inside it that branches (line 1010). 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":"pkg/privilege/privileges/cache.go"},"region":{"startLine":1009}}}],"partialFingerprints":{"codehealthFindingId/v1":"c8fc46b27ca0faca04bd7bcb2e95bf9dd71d4c31bd1e16cf6d3bc99367fe3e34"}},{"ruleId":"D1","level":"warning","message":{"text":"clientConn.Run (cyclomatic 34): clientConn.Run has cyclomatic complexity 34 (threshold 15). Of this number, 32 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":"pkg/server/conn.go"},"region":{"startLine":1157}}}],"partialFingerprints":{"codehealthFindingId/v1":"01030e9e1dd6876514a1437cb7d5056ee5e97726d619f7b701d9fd23b80f5a9f"}},{"ruleId":"D1","level":"warning","message":{"text":"statistics.BuildHistAndTopN (cyclomatic 34): statistics.BuildHistAndTopN has cyclomatic complexity 34 (threshold 15). Of this number, 32 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":"pkg/statistics/builder.go"},"region":{"startLine":363}}}],"partialFingerprints":{"codehealthFindingId/v1":"389e2b45d3b257f15a900144aeb440487a9b17606e1aaba4e6cd5dc4b27fd4c2"}},{"ruleId":"D1","level":"warning","message":{"text":"copr.buildBatchCopTasksCore (cyclomatic 34): copr.buildBatchCopTasksCore has cyclomatic complexity 34 (threshold 15). Of this number, 32 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":"pkg/store/copr/batch_coprocessor.go"},"region":{"startLine":905}}}],"partialFingerprints":{"codehealthFindingId/v1":"208127258bd5c2f88bb116257a1045698d4a3be1bc1fedb2242b5bc82d6c5934"}},{"ruleId":"D1","level":"warning","message":{"text":"tables.newPartitionedTable (cyclomatic 34): tables.newPartitionedTable 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":"pkg/table/tables/partition.go"},"region":{"startLine":112}}}],"partialFingerprints":{"codehealthFindingId/v1":"de74dad523c5d25f32d21d260adf5e15249f54f857999bcd1cad5d249e2bd242"}},{"ruleId":"D1","level":"warning","message":{"text":"MyDecimal.WriteBin (cyclomatic 34): MyDecimal.WriteBin has cyclomatic complexity 34 (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":"pkg/types/mydecimal.go"},"region":{"startLine":1295}}}],"partialFingerprints":{"codehealthFindingId/v1":"21bf7138b73bbc421ed2ff7ce2c9e37fd749c014da13cf1c53f50638e9fb2620"}},{"ruleId":"D1","level":"warning","message":{"text":"main.setGlobalVars (cyclomatic 33): main.setGlobalVars has cyclomatic complexity 33 (threshold 15). Of this number, 31 points are the body\u0027s own statements and 2 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":"cmd/tidb-server/main.go"},"region":{"startLine":1027}}}],"partialFingerprints":{"codehealthFindingId/v1":"d9ee3ca9afa4500d97675c320cabd699fa58353a546ac06b64f94e7eaa7b9f52"}},{"ruleId":"D1","level":"warning","message":{"text":"PreImportInfoGetterImpl.sampleDataFromTable (cyclomatic 33): PreImportInfoGetterImpl.sampleDataFromTable has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lightning/pkg/importer/get_pre_info.go"},"region":{"startLine":614}}}],"partialFingerprints":{"codehealthFindingId/v1":"18bd18a5ab15e6455934d71b9da22b0a6a0f404ca87a7aa4ba013542edf62d93"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.initJobReorgMetaFromVariables (cyclomatic 33): ddl.initJobReorgMetaFromVariables has cyclomatic complexity 33 (threshold 15). Of this number, 31 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":"pkg/ddl/reorg_util.go"},"region":{"startLine":43}}}],"partialFingerprints":{"codehealthFindingId/v1":"4d83d155074589d464fe2684222d4b62218895894a696ddeade4970acfdc1a40"}},{"ruleId":"D1","level":"warning","message":{"text":"worker.onModifyColumn (cyclomatic 33): worker.onModifyColumn has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/modify_column.go"},"region":{"startLine":230}}}],"partialFingerprints":{"codehealthFindingId/v1":"a4c27c52f30801a1ef42204dfd27bbb7241b0250a658f8341239daed1e79498d"}},{"ruleId":"D1","level":"warning","message":{"text":"AnalyzeExec.Next (cyclomatic 33): AnalyzeExec.Next has cyclomatic complexity 33 (threshold 15). Of this number, 26 points are the body\u0027s own statements and 7 belong to 4 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":"pkg/executor/analyze.go"},"region":{"startLine":300}}}],"partialFingerprints":{"codehealthFindingId/v1":"79e574a49c558dcdd52da454d3cdfca003feeb0e03732f6107dbd4aa4e44e375"}},{"ruleId":"D1","level":"warning","message":{"text":"baseJoinProbe.SetChunkForProbe (cyclomatic 33): baseJoinProbe.SetChunkForProbe has cyclomatic complexity 33 (threshold 15). Of this number, 32 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":"pkg/executor/join/base_join_probe.go"},"region":{"startLine":179}}}],"partialFingerprints":{"codehealthFindingId/v1":"cf9f1cde445cad72a324e140d1dc435e818ce51daa5d2edb82e620b118db15d0"}},{"ruleId":"D1","level":"warning","message":{"text":"PointGetExecutor.Next (cyclomatic 33): PointGetExecutor.Next has cyclomatic complexity 33 (threshold 15). Of this number, 32 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":"pkg/executor/point_get.go"},"region":{"startLine":303}}}],"partialFingerprints":{"codehealthFindingId/v1":"9fe851c768fb59351b14fd51389de14a903b8ae89126644df1172b8c030a24f5"}},{"ruleId":"D1","level":"warning","message":{"text":"SelectIntoExec.dumpToOutfile (cyclomatic 33): SelectIntoExec.dumpToOutfile has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/select_into.go"},"region":{"startLine":124}}}],"partialFingerprints":{"codehealthFindingId/v1":"d5e074daff51e32aed4f45da395726304e0e33c3fe31c19a243e62894455cd95"}},{"ruleId":"D1","level":"warning","message":{"text":"expression.getBaseCmpType (cyclomatic 33): expression.getBaseCmpType has cyclomatic complexity 33 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/builtin_compare.go"},"region":{"startLine":1404}}}],"partialFingerprints":{"codehealthFindingId/v1":"50921f4508454266d46d5d5290c060127b260537cdb31889f6172519c251225b"}},{"ruleId":"D1","level":"warning","message":{"text":"builtinRegexpInStrFuncSig.evalInt (cyclomatic 33): builtinRegexpInStrFuncSig.evalInt has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/builtin_regexp.go"},"region":{"startLine":699}}}],"partialFingerprints":{"codehealthFindingId/v1":"8d50cfaac19361384019f94720b64dde8368319b337c83389684f97089d25778"}},{"ruleId":"D1","level":"warning","message":{"text":"builtinRegexpReplaceFuncSig.vecEvalString (cyclomatic 33): builtinRegexpReplaceFuncSig.vecEvalString has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/builtin_regexp.go"},"region":{"startLine":1267}}}],"partialFingerprints":{"codehealthFindingId/v1":"a2c00f08ee4ca489a7809230f84fa7296e5be66097ed7f5bcd51604703b5f16c"}},{"ruleId":"D1","level":"warning","message":{"text":"core.getHashJoins (cyclomatic 33): core.getHashJoins has cyclomatic complexity 33 (threshold 15). Of this number, 32 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":"pkg/planner/core/exhaust_physical_plans.go"},"region":{"startLine":110}}}],"partialFingerprints":{"codehealthFindingId/v1":"0ccdbe961c287ffbe3addbbe905e65f592c5c1917f87e895b814e441d71f5b4d"}},{"ruleId":"D1","level":"warning","message":{"text":"joinorder.extractJoinGroup (cyclomatic 33): joinorder.extractJoinGroup has cyclomatic complexity 33 (threshold 15). Of this number, 31 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":"pkg/planner/core/joinorder/join_order.go"},"region":{"startLine":94}}}],"partialFingerprints":{"codehealthFindingId/v1":"c01a27fd7686a684f4bbc3a6109793a95dc5725c837c78f628ab5155c36f5ca6"}},{"ruleId":"D1","level":"warning","message":{"text":"PlanBuilder.buildSelectPlanOfInsert (cyclomatic 33): PlanBuilder.buildSelectPlanOfInsert has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/planbuilder.go"},"region":{"startLine":4408}}}],"partialFingerprints":{"codehealthFindingId/v1":"4c3de1a2bd7257df2ed116d0dd49161a08b028d5e0fd079cc1ec5592268d88ec"}},{"ruleId":"D1","level":"warning","message":{"text":"UserPrivileges.ConnectionVerification (cyclomatic 33): UserPrivileges.ConnectionVerification has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/privilege/privileges/privileges.go"},"region":{"startLine":631}}}],"partialFingerprints":{"codehealthFindingId/v1":"646ad6be25cbc87e21c8a3618b2b4d525406e58c7bf8bee49b5f3143193dc25d"}},{"ruleId":"D1","level":"warning","message":{"text":"error.ToTiDBErr (cyclomatic 33): error.ToTiDBErr has cyclomatic complexity 33 (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":"pkg/store/driver/error/error.go"},"region":{"startLine":77}}}],"partialFingerprints":{"codehealthFindingId/v1":"5198a61998deaa2e3ca02fadd05da3178163769fce16f7cb36d807599bf0b0d2"}},{"ruleId":"D1","level":"warning","message":{"text":"FuncCallExpr.Restore (cyclomatic 33): FuncCallExpr.Restore has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/parser/ast/functions.go"},"region":{"startLine":413}}}],"partialFingerprints":{"codehealthFindingId/v1":"65d1668809f2c3a6796aaa4b63f49f53d11431c0e9df5bc54ad8fa685f6c2e56"}},{"ruleId":"D1","level":"warning","message":{"text":"task.RunBackupEBS (cyclomatic 32): task.RunBackupEBS has cyclomatic complexity 32 (threshold 15). Of this number, 29 points are the body\u0027s own statements and 3 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":"br/pkg/task/backup_ebs.go"},"region":{"startLine":77}}}],"partialFingerprints":{"codehealthFindingId/v1":"b5ffbba02db4f56bbfe50268f0f18fa612bd4f1efd3905f16093583d5d5de0ca"}},{"ruleId":"D1","level":"warning","message":{"text":"Dumper.Dump (cyclomatic 32): Dumper.Dump has cyclomatic complexity 32 (threshold 15). Of this number, 24 points are the body\u0027s own statements and 8 belong to 5 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":"dumpling/export/dump.go"},"region":{"startLine":150}}}],"partialFingerprints":{"codehealthFindingId/v1":"9b6fec8c97ff0b7b83b9ff836d732030ac9334fd020c59bb813255b876ae3603"}},{"ruleId":"D1","level":"warning","message":{"text":"TableImporter.importEngines (cyclomatic 32): TableImporter.importEngines has cyclomatic complexity 32 (threshold 15). Of this number, 27 points are the body\u0027s own statements and 5 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":"lightning/pkg/importer/table_import.go"},"region":{"startLine":458}}}],"partialFingerprints":{"codehealthFindingId/v1":"6d8ff72eb464574bdf8e0484c9d443cab86a7dd181e6382dd1e5e72ee14591a4"}},{"ruleId":"D1","level":"warning","message":{"text":"selectResult.fetchRespWithIntermediateResults (cyclomatic 32): selectResult.fetchRespWithIntermediateResults has cyclomatic complexity 32 (threshold 15). Of this number, 22 points are the body\u0027s own statements and 10 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":"pkg/distsql/select_result.go"},"region":{"startLine":369}}}],"partialFingerprints":{"codehealthFindingId/v1":"823333e6488d7400068b3e450cc2fe2eef3a6924c17eed59a11868501d9d0705"}},{"ruleId":"D1","level":"warning","message":{"text":"ExecStmt.handlePessimisticDML (cyclomatic 32): ExecStmt.handlePessimisticDML has cyclomatic complexity 32 (threshold 15). Of this number, 19 points are the body\u0027s own statements and 13 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":"pkg/executor/adapter.go"},"region":{"startLine":1163}}}],"partialFingerprints":{"codehealthFindingId/v1":"b8e671b2bdbaa44bcc20ab50050bb3e9978c1b38b1a29525606d62e6a053ab80"}},{"ruleId":"D1","level":"warning","message":{"text":"AnalyzeColumnsExec.subBuildWorker (cyclomatic 32): AnalyzeColumnsExec.subBuildWorker has cyclomatic complexity 32 (threshold 15). Of this number, 30 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":"pkg/executor/analyze_col_sampling.go"},"region":{"startLine":712}}}],"partialFingerprints":{"codehealthFindingId/v1":"d9875ecd4b564bae6b108e5cddaa7c9fdf7654403716ab7d04237f886c5d9c31"}},{"ruleId":"D1","level":"warning","message":{"text":"hugeMemTableRetriever.dataForColumnsInTable (cyclomatic 32): hugeMemTableRetriever.dataForColumnsInTable has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/infoschema_reader.go"},"region":{"startLine":1148}}}],"partialFingerprints":{"codehealthFindingId/v1":"0e308f6f5aee02fb5a1d0b6c45369eae3382630c8c645cb8ec5d63e2b7e928ad"}},{"ruleId":"D1","level":"warning","message":{"text":"expression.addCollateAndCharsetAndFlagFromArgs (cyclomatic 32): expression.addCollateAndCharsetAndFlagFromArgs has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/builtin_control.go"},"region":{"startLine":146}}}],"partialFingerprints":{"codehealthFindingId/v1":"04955656db901e51f3cee4400f0281fcdc4bda7ca567ee75673c10ceb8b5aa38"}},{"ruleId":"D1","level":"warning","message":{"text":"expression.deriveCollation (cyclomatic 32): expression.deriveCollation has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/collation.go"},"region":{"startLine":245}}}],"partialFingerprints":{"codehealthFindingId/v1":"c981a076b01ac632e623fd86e7084bcfd85915840625fca0987c953fa11c0436"}},{"ruleId":"D1","level":"warning","message":{"text":"cardinality.getColumnRowCount (cyclomatic 32): cardinality.getColumnRowCount has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/cardinality/row_count_column.go"},"region":{"startLine":121}}}],"partialFingerprints":{"codehealthFindingId/v1":"288ba3c2a7adc6bd9c5f307c25c98cbe5d5fd812123492803ed13853727533f1"}},{"ruleId":"D1","level":"warning","message":{"text":"core.buildRangesForBatchGet (cyclomatic 32): core.buildRangesForBatchGet has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/plan_cache_rebuild.go"},"region":{"startLine":326}}}],"partialFingerprints":{"codehealthFindingId/v1":"cc5cb272051f120779221b13247f352810de7969cb14e6fc69bd8b0ff543da79"}},{"ruleId":"D1","level":"warning","message":{"text":"core.tryWhereIn2BatchPointGet (cyclomatic 32): core.tryWhereIn2BatchPointGet has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/point_get_plan.go"},"region":{"startLine":409}}}],"partialFingerprints":{"codehealthFindingId/v1":"a2b12afcac662a81c70dce46e027246661f5ca76dd19e1958d964324ba152ba5"}},{"ruleId":"D1","level":"warning","message":{"text":"core.attach2TaskForMpp (cyclomatic 32): core.attach2TaskForMpp has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/task.go"},"region":{"startLine":2035}}}],"partialFingerprints":{"codehealthFindingId/v1":"028275ecd4eb48ba1ee36d7a93ddf081441a4a137fde17adc9de3d4f4a71b5da"}},{"ruleId":"D1","level":"warning","message":{"text":"nonPreparedPlanCacheableChecker.Enter (cyclomatic 32): nonPreparedPlanCacheableChecker.Enter has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/plan_cacheable_checker.go"},"region":{"startLine":428}}}],"partialFingerprints":{"codehealthFindingId/v1":"ca5b1e062c3596d96427fb7814a25b21f93433af58265c2e9414916dbe5511a3"}},{"ruleId":"D1","level":"warning","message":{"text":"PlanBuilder.buildImportInto (cyclomatic 32): PlanBuilder.buildImportInto has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/planbuilder.go"},"region":{"startLine":4723}}}],"partialFingerprints":{"codehealthFindingId/v1":"faa1786cd46fc7ba5d544d78adf70755ca9a03fa11a8e5516a723066ff376470"}},{"ruleId":"D1","level":"warning","message":{"text":"preprocessor.checkCreateTableGrammar (cyclomatic 32): preprocessor.checkCreateTableGrammar has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/preprocess.go"},"region":{"startLine":921}}}],"partialFingerprints":{"codehealthFindingId/v1":"2c6d91ae593c3f6691f4645daa82738eb63901aa23076782b345dee1c0546886"}},{"ruleId":"D1","level":"warning","message":{"text":"copIteratorWorker.handleTaskOnce (cyclomatic 32): copIteratorWorker.handleTaskOnce has cyclomatic complexity 32 (threshold 15). Of this number, 30 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":"pkg/store/copr/coprocessor.go"},"region":{"startLine":1723}}}],"partialFingerprints":{"codehealthFindingId/v1":"4756938de8072b026a7ae676af1a8f3fe1c3f6d90cd084d409f8fe904840a050"}},{"ruleId":"D1","level":"warning","message":{"text":"rangeDetacher.detachDNFCondAndBuildRangeForIndex (cyclomatic 32): rangeDetacher.detachDNFCondAndBuildRangeForIndex has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/util/ranger/detacher.go"},"region":{"startLine":849}}}],"partialFingerprints":{"codehealthFindingId/v1":"918a5d74a5d8ae492594f52dc705c0369affbd119b8d7a7a0efa5b8ca3e110a1"}},{"ruleId":"D1","level":"warning","message":{"text":"Constraint.Restore (cyclomatic 32): Constraint.Restore has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/parser/ast/ddl.go"},"region":{"startLine":972}}}],"partialFingerprints":{"codehealthFindingId/v1":"14ec975db711155d779ad4475762811a538f3b5fe0057ea8895f0b272402b261"}},{"ruleId":"D1","level":"warning","message":{"text":"main.main (cyclomatic 31): main.main has cyclomatic complexity 31 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/tidb-server/main.go"},"region":{"startLine":400}}}],"partialFingerprints":{"codehealthFindingId/v1":"43f63e74f8a20fc8f68c7a6a4c574c3cafe2f7599609936a9870c7f46962a16c"}},{"ruleId":"D1","level":"warning","message":{"text":"Controller.buildRunPeriodicActionAndCancelFunc (cyclomatic 31): Controller.buildRunPeriodicActionAndCancelFunc has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 6 of the 31 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 1036, 1020, 1196). 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":"lightning/pkg/importer/import.go"},"region":{"startLine":1001}}}],"partialFingerprints":{"codehealthFindingId/v1":"b2370242b67f2850b5c2ed527030d71b91fd8a22ab719129895cd5953198d0aa"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.columnDefToCol (cyclomatic 31): ddl.columnDefToCol has cyclomatic complexity 31 (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":"pkg/ddl/add_column.go"},"region":{"startLine":469}}}],"partialFingerprints":{"codehealthFindingId/v1":"27e13a8c21ffd9908fe016e24c8b95aee939f633451f9c0e4bf6a38a3e6e6121"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.convertJob2RollbackJob (cyclomatic 31): ddl.convertJob2RollbackJob has cyclomatic complexity 31 (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/ddl/rollingback.go"},"region":{"startLine":605}}}],"partialFingerprints":{"codehealthFindingId/v1":"2e49c65b001ea2f5fed753098d24d0511e1f56a223ab718313e5fff68e076d30"}},{"ruleId":"D1","level":"warning","message":{"text":"memtableRetriever.setDataFromPartitions (cyclomatic 31): memtableRetriever.setDataFromPartitions has cyclomatic complexity 31 (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":"pkg/executor/infoschema_reader.go"},"region":{"startLine":1309}}}],"partialFingerprints":{"codehealthFindingId/v1":"fecbefc81e7bfee2015fc41591ae0a48154d5406d858b36912dc805c581e80da"}},{"ruleId":"D1","level":"warning","message":{"text":"mdLoaderSetup.setup (cyclomatic 31): mdLoaderSetup.setup has cyclomatic complexity 31 (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":"pkg/lightning/mydump/loader.go"},"region":{"startLine":452}}}],"partialFingerprints":{"codehealthFindingId/v1":"98168f198bf2f6d71ecb02d858dc312152fb41850cbed2e5e6756d7ef9b97cd2"}},{"ruleId":"D1","level":"warning","message":{"text":"core.convertToIndexMergeScan (cyclomatic 31): core.convertToIndexMergeScan 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":"pkg/planner/core/find_best_task.go"},"region":{"startLine":2316}}}],"partialFingerprints":{"codehealthFindingId/v1":"449d8e451352939abe0b206172a7f148796d7c9cd32e7d23905fec19d5cf87b7"}},{"ruleId":"D1","level":"warning","message":{"text":"Explain.prepareSchema (cyclomatic 31): Explain.prepareSchema has cyclomatic complexity 31 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/common_plans.go"},"region":{"startLine":689}}}],"partialFingerprints":{"codehealthFindingId/v1":"31fafdd74adf42a3f0f5c7930363f977ff78f6616aa0b0950a819366c3f8ed7d"}},{"ruleId":"D1","level":"warning","message":{"text":"FDSet.MakeOuterJoin (cyclomatic 31): FDSet.MakeOuterJoin has cyclomatic complexity 31 (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":"pkg/planner/funcdep/fd_graph.go"},"region":{"startLine":743}}}],"partialFingerprints":{"codehealthFindingId/v1":"354dc705e833b54f0c5a1c0da78891c95ab9a999b5988bf0d1252c4c69ec71aa"}},{"ruleId":"D1","level":"warning","message":{"text":"types.floatStrToIntStr (cyclomatic 31): types.floatStrToIntStr has cyclomatic complexity 31 (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":"pkg/types/convert.go"},"region":{"startLine":456}}}],"partialFingerprints":{"codehealthFindingId/v1":"191bab6caaa4bbd8d4c0a45e74d2928261756656178874189aaf78d44f4dc727"}},{"ruleId":"D1","level":"warning","message":{"text":"types.CompareBinaryJSON (cyclomatic 31): types.CompareBinaryJSON has cyclomatic complexity 31 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/types/json_binary_functions.go"},"region":{"startLine":793}}}],"partialFingerprints":{"codehealthFindingId/v1":"e7fec8c5af81722f504e99374719cd6efb0130a09ad15711a0b1691f5e3d56a9"}},{"ruleId":"D1","level":"warning","message":{"text":"ranger.RangeSingleColToString (cyclomatic 31): ranger.RangeSingleColToString has cyclomatic complexity 31 (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":"pkg/util/ranger/ranger.go"},"region":{"startLine":901}}}],"partialFingerprints":{"codehealthFindingId/v1":"79d7ed76d097fcce5eb1a9cdf14ec62d061d327ce5f700bda3dafc0ad20ec0cb"}},{"ruleId":"D1","level":"warning","message":{"text":"resourcegrouptag.GetFirstKeyFromRequest (cyclomatic 31): resourcegrouptag.GetFirstKeyFromRequest has cyclomatic complexity 31 (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":"pkg/util/resourcegrouptag/resource_group_tag.go"},"region":{"startLine":52}}}],"partialFingerprints":{"codehealthFindingId/v1":"ea0a54a9b99adff1c38a0e4816c99af4f78b58883d265601bd3768934d3945d0"}},{"ruleId":"D1","level":"warning","message":{"text":"export.recordGlobalMetaData (cyclomatic 30): export.recordGlobalMetaData has cyclomatic complexity 30 (threshold 15). Of this number, 17 points are the body\u0027s own statements and 13 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":"dumpling/export/metadata.go"},"region":{"startLine":69}}}],"partialFingerprints":{"codehealthFindingId/v1":"6a13daff32f93f766822f80641d75e8d245257099d4c24e21644184f46cf180c"}},{"ruleId":"D1","level":"warning","message":{"text":"chunkProcessor.deliverLoop (cyclomatic 30): chunkProcessor.deliverLoop has cyclomatic complexity 30 (threshold 15). Of this number, 20 points are the body\u0027s own statements and 10 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":"lightning/pkg/importer/chunk_process.go"},"region":{"startLine":580}}}],"partialFingerprints":{"codehealthFindingId/v1":"c018cc9705db58452b627db0b12640910633c255475a5e3000ab5319bf979396"}},{"ruleId":"D1","level":"warning","message":{"text":"worker.onAddTablePartition (cyclomatic 30): worker.onAddTablePartition has cyclomatic complexity 30 (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":"pkg/ddl/partition.go"},"region":{"startLine":94}}}],"partialFingerprints":{"codehealthFindingId/v1":"a32e61adb6d27051fe14f09154600a86d472e411d65db7d8da52317cba149ce7"}},{"ruleId":"D1","level":"warning","message":{"text":"worker.onTruncateTablePartition (cyclomatic 30): worker.onTruncateTablePartition has cyclomatic complexity 30 (threshold 15). Of this number, 26 points are the body\u0027s own statements and 4 belong to 4 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":"pkg/ddl/partition.go"},"region":{"startLine":2568}}}],"partialFingerprints":{"codehealthFindingId/v1":"766a5e860bd1b5318377d4fae9c52b7ea562214ebc2291b7d296d93f3dcee35f"}},{"ruleId":"D1","level":"warning","message":{"text":"worker.reorgPartitionDataAndIndex (cyclomatic 30): worker.reorgPartitionDataAndIndex has cyclomatic complexity 30 (threshold 15). Of this number, 29 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":"pkg/ddl/partition.go"},"region":{"startLine":4102}}}],"partialFingerprints":{"codehealthFindingId/v1":"85d80095151e17219ced30385fa13888ee320e747fdf7103c239d78635bbe51c"}},{"ruleId":"D1","level":"warning","message":{"text":"BaseTaskExecutor.Run (cyclomatic 30): BaseTaskExecutor.Run has cyclomatic complexity 30 (threshold 15). Of this number, 28 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":"pkg/dxf/framework/taskexecutor/task_executor.go"},"region":{"startLine":273}}}],"partialFingerprints":{"codehealthFindingId/v1":"1d345fea5445e17bf926017f7682312e6b98ff51c3f8366bb4607fa31e1e017b"}},{"ruleId":"D1","level":"warning","message":{"text":"jobhistory.GetFromHistory (cyclomatic 30): jobhistory.GetFromHistory has cyclomatic complexity 30 (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":"pkg/dxf/importinto/jobhistory/history.go"},"region":{"startLine":66}}}],"partialFingerprints":{"codehealthFindingId/v1":"59157b7b722105b5baa02391a1f0d0a34f39c0512105bf0c9219e7c3a102cc10"}},{"ruleId":"D1","level":"warning","message":{"text":"ProbeWorkerV1.joinNAALOSJMatchProbeSideRow2Chunk (cyclomatic 30): ProbeWorkerV1.joinNAALOSJMatchProbeSideRow2Chunk has cyclomatic complexity 30 (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":"pkg/executor/join/hash_join_v1.go"},"region":{"startLine":432}}}],"partialFingerprints":{"codehealthFindingId/v1":"ab2337b5472213b6b3eab9a12265df57d03284441b11f049648232bca49d1ee3"}},{"ruleId":"D1","level":"warning","message":{"text":"ProbeWorkerV1.joinNAASJMatchProbeSideRow2Chunk (cyclomatic 30): ProbeWorkerV1.joinNAASJMatchProbeSideRow2Chunk has cyclomatic complexity 30 (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":"pkg/executor/join/hash_join_v1.go"},"region":{"startLine":590}}}],"partialFingerprints":{"codehealthFindingId/v1":"83e1c0318d951fdb5c9ee924a2ebd6819440b4ba90289a3085f4bdb1cc453129"}},{"ruleId":"D1","level":"warning","message":{"text":"MergeJoinExec.Next (cyclomatic 30): MergeJoinExec.Next has cyclomatic complexity 30 (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":"pkg/executor/join/merge_join.go"},"region":{"startLine":327}}}],"partialFingerprints":{"codehealthFindingId/v1":"ff6cd437c7c0865a744999bbcdf38a0637b7e9462062f104d950b746c4ac61fe"}},{"ruleId":"D1","level":"warning","message":{"text":"slowQueryRetriever.getAllFiles (cyclomatic 30): slowQueryRetriever.getAllFiles has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 12 of the 30 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 1272, 1260). 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":"pkg/executor/slow_query.go"},"region":{"startLine":1247}}}],"partialFingerprints":{"codehealthFindingId/v1":"3d7f657a02df2ea5b4ea8a5dfde7d2fcd165fb107bb84d638cfec4ab1a0a1389"}},{"ruleId":"D1","level":"warning","message":{"text":"compareFunctionClass.refineArgsByUnsignedFlag (cyclomatic 30): compareFunctionClass.refineArgsByUnsignedFlag has cyclomatic complexity 30 (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":"pkg/expression/builtin_compare.go"},"region":{"startLine":1919}}}],"partialFingerprints":{"codehealthFindingId/v1":"509dce612bda18d755441ea1fdc52cc7448701cfb2a0fefef13996deaac41b42"}},{"ruleId":"D1","level":"warning","message":{"text":"ChunkParser.ReadRow (cyclomatic 30): ChunkParser.ReadRow has cyclomatic complexity 30 (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":"pkg/lightning/mydump/parser.go"},"region":{"startLine":389}}}],"partialFingerprints":{"codehealthFindingId/v1":"e8ad761e12fecbd1d667929b5b10316ac7cebfc373456129816369b2b1c8cb98"}},{"ruleId":"D1","level":"warning","message":{"text":"core.checkTblIndexForPointPlan (cyclomatic 30): core.checkTblIndexForPointPlan has cyclomatic complexity 30 (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":"pkg/planner/core/point_get_plan.go"},"region":{"startLine":600}}}],"partialFingerprints":{"codehealthFindingId/v1":"c12677c81da7f9dbd12e5e527ddb49c5866fb767d0c92a0e289badd7b3610a19"}},{"ruleId":"D1","level":"warning","message":{"text":"LogicalJoin.ExtractOnCondition (cyclomatic 30): LogicalJoin.ExtractOnCondition has cyclomatic complexity 30 (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":"pkg/planner/core/operator/logicalop/logical_join.go"},"region":{"startLine":1394}}}],"partialFingerprints":{"codehealthFindingId/v1":"a691245fbd8134d6430a4eb0723c9a79a492e67b655e14181c32ab646b8b0c42"}},{"ruleId":"D1","level":"warning","message":{"text":"PhysicalTableScan.OperatorInfo (cyclomatic 30): PhysicalTableScan.OperatorInfo has cyclomatic complexity 30 (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":"pkg/planner/core/operator/physicalop/physical_table_scan.go"},"region":{"startLine":460}}}],"partialFingerprints":{"codehealthFindingId/v1":"74b81cf6d34bc0ddffaf54df2424df94a4b530e9faa14d34dee449b69ab0459d"}},{"ruleId":"D1","level":"warning","message":{"text":"PlanBuilder.buildAggregation (cyclomatic 30): PlanBuilder.buildAggregation has cyclomatic complexity 30 (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":"pkg/planner/core/logical_plan_builder.go"},"region":{"startLine":255}}}],"partialFingerprints":{"codehealthFindingId/v1":"1440eff70ee00b20aa9c07bff88c61fea3b582380de382b7f9caec3e3132f6db"}},{"ruleId":"D1","level":"warning","message":{"text":"PartitionProcessor.getUsedHashPartitions (cyclomatic 30): PartitionProcessor.getUsedHashPartitions has cyclomatic complexity 30 (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":"pkg/planner/core/rule/rule_partition_processor.go"},"region":{"startLine":159}}}],"partialFingerprints":{"codehealthFindingId/v1":"1792397c63825443f597376721099ad9522e1cac511d60cb5addc4d451136da6"}},{"ruleId":"D1","level":"warning","message":{"text":"UserPrivileges.checkSSL (cyclomatic 30): UserPrivileges.checkSSL has cyclomatic complexity 30 (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":"pkg/privilege/privileges/privileges.go"},"region":{"startLine":795}}}],"partialFingerprints":{"codehealthFindingId/v1":"4b184ab7265b3bef9cd81669020bdb822da9853151f2bbc098102e3f0599eb89"}},{"ruleId":"D1","level":"warning","message":{"text":"session.Auth (cyclomatic 30): session.Auth has cyclomatic complexity 30 (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":"pkg/session/session.go"},"region":{"startLine":3651}}}],"partialFingerprints":{"codehealthFindingId/v1":"75cf02283d1dbede282ac45f73daf5c12456b8ffb336cbb3f5391cbeba39edae"}},{"ruleId":"D1","level":"warning","message":{"text":"session.usePipelinedDmlOrWarn (cyclomatic 30): session.usePipelinedDmlOrWarn has cyclomatic complexity 30 (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":"pkg/session/session.go"},"region":{"startLine":5799}}}],"partialFingerprints":{"codehealthFindingId/v1":"44f36a52e92db26a863e94a7091e0a5789a245af5202b8a694afdc5c660f19c5"}},{"ruleId":"D1","level":"warning","message":{"text":"indexLookUpExec.fetchTableScans (cyclomatic 30): indexLookUpExec.fetchTableScans has cyclomatic complexity 30 (threshold 15). Of this number, 22 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":"pkg/store/mockstore/unistore/cophandler/mpp_exec.go"},"region":{"startLine":529}}}],"partialFingerprints":{"codehealthFindingId/v1":"adefae40bd5deff66174a34d617f0d81eef1e35b332b68febd7817c567468cf5"}},{"ruleId":"D1","level":"warning","message":{"text":"JobManager.jobLoopWithSession (cyclomatic 30): JobManager.jobLoopWithSession has cyclomatic complexity 30 (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":"pkg/ttl/ttlworker/job_manager.go"},"region":{"startLine":173}}}],"partialFingerprints":{"codehealthFindingId/v1":"e197cdf0fa22554538f8fb888279c497a209d16f64826f1b6c51afabf93eee94"}},{"ruleId":"D1","level":"warning","message":{"text":"types.ChangeReverseResultByUpperLowerBound (cyclomatic 30): types.ChangeReverseResultByUpperLowerBound has cyclomatic complexity 30 (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":"pkg/types/datum.go"},"region":{"startLine":2627}}}],"partialFingerprints":{"codehealthFindingId/v1":"af2523a792d00b84ac1d92b13637b3f8f89b8c4a94281a00253e8eccf2e45213"}},{"ruleId":"D1","level":"warning","message":{"text":"types.checkTypeChangeSupported (cyclomatic 30): types.checkTypeChangeSupported has cyclomatic complexity 30 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/types/field_type.go"},"region":{"startLine":1569}}}],"partialFingerprints":{"codehealthFindingId/v1":"47806f1f679acdf122cb682da8de8e12526bb8f88f964d04274459034ef4dee3"}},{"ruleId":"D1","level":"warning","message":{"text":"staticTestHelper.assertRecursivelyNotEqual (cyclomatic 30): staticTestHelper.assertRecursivelyNotEqual has cyclomatic complexity 30 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/util/deeptest/statictesthelper.go"},"region":{"startLine":54}}}],"partialFingerprints":{"codehealthFindingId/v1":"37726ca848cde7fa3a6a1a57fe07901996199968d9f6c5377384338439b2e162"}},{"ruleId":"D1","level":"warning","message":{"text":"execdetails.FormatRUV2Summary (cyclomatic 30): execdetails.FormatRUV2Summary has cyclomatic complexity 30 (threshold 15). Of this number, 27 points are the body\u0027s own statements and 3 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/util/execdetails/ruv2_metrics.go"},"region":{"startLine":934}}}],"partialFingerprints":{"codehealthFindingId/v1":"1be3cc34cd801e11958a92ac9cf856e0330919afab9c2962e10d6adea39cacac"}},{"ruleId":"D1","level":"warning","message":{"text":"BackupConfig.ParseFromFlags (cyclomatic 29): BackupConfig.ParseFromFlags has cyclomatic complexity 29 (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":"br/pkg/task/backup.go"},"region":{"startLine":167}}}],"partialFingerprints":{"codehealthFindingId/v1":"98536d949b33ea0807af930e47746b91a701c1d990f9f6ce0ac2418794dd63f8"}},{"ruleId":"D1","level":"warning","message":{"text":"export.updateSpecifiedTablesMeta (cyclomatic 29): export.updateSpecifiedTablesMeta has cyclomatic complexity 29 (threshold 15). Of this number, 19 points are the body\u0027s own statements and 10 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":"dumpling/export/sql.go"},"region":{"startLine":251}}}],"partialFingerprints":{"codehealthFindingId/v1":"af77228e0b3295d64d80544d0ea855b7584e0a008bcf75b9c6a57d62df381b23"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.onDropIndex (cyclomatic 29): ddl.onDropIndex has cyclomatic complexity 29 (threshold 15). Of this number, 28 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":"pkg/ddl/index.go"},"region":{"startLine":2076}}}],"partialFingerprints":{"codehealthFindingId/v1":"ee24a28f66049630645452094c08b6787874793f97cbe5148edd5e7cd833ae08"}},{"ruleId":"D1","level":"warning","message":{"text":"ddlCtx.writePhysicalTableRecord (cyclomatic 29): ddlCtx.writePhysicalTableRecord has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 7 of the 29 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 1011, 1099, 1063, \u2026). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals\u0027 work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/backfilling.go"},"region":{"startLine":962}}}],"partialFingerprints":{"codehealthFindingId/v1":"ba6772a2060e95dce069ef0a93aaa84c6574b1e561c98f0a0408cc37fabcf417"}},{"ruleId":"D1","level":"warning","message":{"text":"parquetfile.parseRawColumnValue (cyclomatic 29): parquetfile.parseRawColumnValue 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":"pkg/dumpformat/parquetfile/column_value.go"},"region":{"startLine":36}}}],"partialFingerprints":{"codehealthFindingId/v1":"e23b98951fea0ea6c0310693cb0bb5c10c2f6ac2ae1cb02435d644de9d66f08f"}},{"ruleId":"D1","level":"warning","message":{"text":"executor.tlsOption2GlobalPriv (cyclomatic 29): executor.tlsOption2GlobalPriv 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":"pkg/executor/grant.go"},"region":{"startLine":407}}}],"partialFingerprints":{"codehealthFindingId/v1":"838253f619ee21299917e84d24329424252e97c4f7ca35065411cfaf6f9e2c19"}},{"ruleId":"D1","level":"warning","message":{"text":"executorBuilder.setTelemetryInfo (cyclomatic 29): executorBuilder.setTelemetryInfo 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":"pkg/executor/builder.go"},"region":{"startLine":1317}}}],"partialFingerprints":{"codehealthFindingId/v1":"85b982237bd74ca8423726ab78c9672fda01f74798f124b31f5484d7267d5942"}},{"ruleId":"D1","level":"warning","message":{"text":"TiFlashSystemTableRetriever.dataForTiFlashSystemTables (cyclomatic 29): TiFlashSystemTableRetriever.dataForTiFlashSystemTables has cyclomatic complexity 29 (threshold 15). Of this number, 28 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":"pkg/executor/infoschema_reader.go"},"region":{"startLine":3622}}}],"partialFingerprints":{"codehealthFindingId/v1":"fb6ac6b62444e608691368c28f8184ee14940171b55d4ddaf5714927717013d0"}},{"ruleId":"D1","level":"warning","message":{"text":"Executor.getTiDBQuota (cyclomatic 29): Executor.getTiDBQuota has cyclomatic complexity 29 (threshold 15). Of this number, 20 points are the body\u0027s own statements and 9 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":"pkg/executor/internal/calibrateresource/calibrate_resource.go"},"region":{"startLine":289}}}],"partialFingerprints":{"codehealthFindingId/v1":"ea653e04144d2b6a9826491f4f164ac7822983f6fd102e08c1eaef86be8f77b0"}},{"ruleId":"D1","level":"warning","message":{"text":"slowQueryRetriever.parseLog (cyclomatic 29): slowQueryRetriever.parseLog has cyclomatic complexity 29 (threshold 15). Of this number, 26 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":"pkg/executor/slow_query.go"},"region":{"startLine":922}}}],"partialFingerprints":{"codehealthFindingId/v1":"3cfde2c5de959177fb8c589cfc783980fee771fe37a3f4f85520932080af5dae"}},{"ruleId":"D1","level":"warning","message":{"text":"expression.GetAccurateCmpType (cyclomatic 29): expression.GetAccurateCmpType has cyclomatic complexity 29 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/builtin_compare.go"},"region":{"startLine":1433}}}],"partialFingerprints":{"codehealthFindingId/v1":"ec4d5b7de1dee77caf75695bd30b10b2976cdd1c920fa040525d5ecef0250a8f"}},{"ruleId":"D1","level":"warning","message":{"text":"expression.extractConstantEqColumnsOrScalar (cyclomatic 29): expression.extractConstantEqColumnsOrScalar 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":"pkg/expression/util.go"},"region":{"startLine":414}}}],"partialFingerprints":{"codehealthFindingId/v1":"abc3353eaebb37d3427b7614e3832c704690c0e6cf242db719bf02e0f6e209d9"}},{"ruleId":"D1","level":"warning","message":{"text":"builtinJSONSearchSig.vecEvalJSON (cyclomatic 29): builtinJSONSearchSig.vecEvalJSON 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":"pkg/expression/builtin_json_vec.go"},"region":{"startLine":497}}}],"partialFingerprints":{"codehealthFindingId/v1":"2214c79ff4fa015f5ae0867da44559f1f16e23146b568834d61061415ec34ee8"}},{"ruleId":"D1","level":"warning","message":{"text":"builtinRegexpReplaceFuncSig.evalString (cyclomatic 29): builtinRegexpReplaceFuncSig.evalString 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":"pkg/expression/builtin_regexp.go"},"region":{"startLine":1174}}}],"partialFingerprints":{"codehealthFindingId/v1":"0c6245c519dc94f6ea492c40d1f445da650f56c1093c6d03a436c63fa07a6579"}},{"ruleId":"D1","level":"warning","message":{"text":"CSVParser.readRecord (cyclomatic 29): CSVParser.readRecord 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":"pkg/lightning/mydump/csv_parser.go"},"region":{"startLine":423}}}],"partialFingerprints":{"codehealthFindingId/v1":"882d5cecab186cfc832f90b29112b3456d860569d0daf0c13e53bf21e27b97c5"}},{"ruleId":"D1","level":"warning","message":{"text":"cardinality.GetSelectivityByFilter (cyclomatic 29): cardinality.GetSelectivityByFilter 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":"pkg/planner/cardinality/selectivity.go"},"region":{"startLine":902}}}],"partialFingerprints":{"codehealthFindingId/v1":"8227d34c4f69ec874e41ff664e2b66c8dbe8bf625631db184a57375f9819de48"}},{"ruleId":"D1","level":"warning","message":{"text":"core.handleForceIndexJoinHints (cyclomatic 29): core.handleForceIndexJoinHints has cyclomatic complexity 29 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/exhaust_physical_plans.go"},"region":{"startLine":1724}}}],"partialFingerprints":{"codehealthFindingId/v1":"06c92e20656a6afd8c21697115aa2080a92537bf6a1ab719567fb79a965b4bcf"}},{"ruleId":"D1","level":"warning","message":{"text":"core.buildIntoAccessPath (cyclomatic 29): core.buildIntoAccessPath 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":"pkg/planner/core/indexmerge_unfinished_path.go"},"region":{"startLine":343}}}],"partialFingerprints":{"codehealthFindingId/v1":"b7a9badcd09ffd8400e3a17765d7d1a87b8dfa2275417a2b1e0d05d4e8a8796b"}},{"ruleId":"D1","level":"warning","message":{"text":"expressionRewriter.handleExistSubquery (cyclomatic 29): expressionRewriter.handleExistSubquery 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":"pkg/planner/core/expression_rewriter.go"},"region":{"startLine":1136}}}],"partialFingerprints":{"codehealthFindingId/v1":"697ce43fa4605433dc69909b827685716b69a4c3e96fbfef0bf1330f4e15bb73"}},{"ruleId":"D1","level":"warning","message":{"text":"FrameBound.Equals (cyclomatic 29): FrameBound.Equals has cyclomatic complexity 29 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/operator/logicalop/logical_window.go"},"region":{"startLine":147}}}],"partialFingerprints":{"codehealthFindingId/v1":"40b6a8cb43b3fde880045a42e8a6bb1271cc8b43587c6691a539b6f87adb6afd"}},{"ruleId":"D1","level":"warning","message":{"text":"PhysicalHashJoin.ToPB (cyclomatic 29): PhysicalHashJoin.ToPB has cyclomatic complexity 29 (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":"pkg/planner/core/operator/physicalop/physical_hash_join.go"},"region":{"startLine":481}}}],"partialFingerprints":{"codehealthFindingId/v1":"5aef9d73267deaf4c1b3d32ddae85de589f9a8e3035a6cbed4f7ef5db3f1ad18"}},{"ruleId":"D1","level":"warning","message":{"text":"TableCommon.rebuildUpdateRecordIndices (cyclomatic 29): TableCommon.rebuildUpdateRecordIndices 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":"pkg/table/tables/tables.go"},"region":{"startLine":569}}}],"partialFingerprints":{"codehealthFindingId/v1":"efdc5db7f5ce042ebbeab44a118d8f45f20f23c3978bc4f370d6b707510b0286"}},{"ruleId":"D1","level":"warning","message":{"text":"Decoder.DecodeOne (cyclomatic 29): Decoder.DecodeOne 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":"pkg/util/codec/codec.go"},"region":{"startLine":1627}}}],"partialFingerprints":{"codehealthFindingId/v1":"4087e43471d23bc6e68df23dac56255f020f2e072be4b7a79e36475cc274d35a"}},{"ruleId":"D1","level":"warning","message":{"text":"ChunkDecoder.decodeColToChunk (cyclomatic 29): ChunkDecoder.decodeColToChunk 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":"pkg/util/rowcodec/decoder.go"},"region":{"startLine":290}}}],"partialFingerprints":{"codehealthFindingId/v1":"39b33246ff75e48db5494dbe726b5344447a4dabbc3273712d1442d412126157"}},{"ruleId":"D1","level":"warning","message":{"text":"IndexOption.Restore (cyclomatic 29): IndexOption.Restore has cyclomatic complexity 29 (threshold 15). Of this number, 26 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":"pkg/parser/ast/ddl.go"},"region":{"startLine":781}}}],"partialFingerprints":{"codehealthFindingId/v1":"1f91eacbc4bdfa623502b74cf570acb3eba0abbf581930560c24458f63fc4a27"}},{"ruleId":"D1","level":"warning","message":{"text":"CreateTableStmt.Restore (cyclomatic 29): CreateTableStmt.Restore 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":"pkg/parser/ast/ddl.go"},"region":{"startLine":1211}}}],"partialFingerprints":{"codehealthFindingId/v1":"ecdc185fe3c6b8c3a08b69e7b75560cf482cb64f909ea3706c6b77853de1bd6e"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.checkColumnDefaultValue (cyclomatic 28): ddl.checkColumnDefaultValue has cyclomatic complexity 28 (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":"pkg/ddl/add_column.go"},"region":{"startLine":1212}}}],"partialFingerprints":{"codehealthFindingId/v1":"2aaeebaa3341a6b470604ce8cac49424875e2f7e60c22ed39a57069f4d79c6cd"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.handleTableOptions (cyclomatic 28): ddl.handleTableOptions has cyclomatic complexity 28 (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":"pkg/ddl/create_table.go"},"region":{"startLine":942}}}],"partialFingerprints":{"codehealthFindingId/v1":"37989550269f78387456a68e72b531df317f1ae771544853223ce130025581aa"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.generatePartitionDefinitionsFromInterval (cyclomatic 28): ddl.generatePartitionDefinitionsFromInterval has cyclomatic complexity 28 (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":"pkg/ddl/partition.go"},"region":{"startLine":1083}}}],"partialFingerprints":{"codehealthFindingId/v1":"1682a50cb73348296e6cc08c5918d29acc9d26b456712b97c30f3fb38e3b9745"}},{"ruleId":"D1","level":"warning","message":{"text":"worker.onFlashbackCluster (cyclomatic 28): worker.onFlashbackCluster has cyclomatic complexity 28 (threshold 15). Of this number, 27 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":"pkg/ddl/cluster.go"},"region":{"startLine":670}}}],"partialFingerprints":{"codehealthFindingId/v1":"9f2729e32b18341bc18e07bcf9960b19f8a630486079a6b4cc0a0d3ddfeb314f"}},{"ruleId":"D1","level":"warning","message":{"text":"placement.NewBundleFromConstraintsOptions (cyclomatic 28): placement.NewBundleFromConstraintsOptions has cyclomatic complexity 28 (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":"pkg/ddl/placement/bundle.go"},"region":{"startLine":49}}}],"partialFingerprints":{"codehealthFindingId/v1":"4ae54ff1faf5c3d8c7d7a67b196db95511b2e37b1b130049d342cc15cd26bbbc"}},{"ruleId":"D1","level":"warning","message":{"text":"executorBuilder.buildHashJoinV2FromChildExecs (cyclomatic 28): executorBuilder.buildHashJoinV2FromChildExecs has cyclomatic complexity 28 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/builder.go"},"region":{"startLine":1798}}}],"partialFingerprints":{"codehealthFindingId/v1":"c43d3b05b092d91f39d5c3dfc3563e75ebc194b23bca84699d59c7f71e32c50b"}},{"ruleId":"D1","level":"warning","message":{"text":"intersectionProcessWorker.doIntersectionPerPartition (cyclomatic 28): intersectionProcessWorker.doIntersectionPerPartition has cyclomatic complexity 28 (threshold 15). Of this number, 24 points are the body\u0027s own statements and 4 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":"pkg/executor/index_merge_reader.go"},"region":{"startLine":1433}}}],"partialFingerprints":{"codehealthFindingId/v1":"20f7a6365c61811eaab6f9679dbd915de3affa6d530932654dec0a48da5ee16e"}},{"ruleId":"D1","level":"warning","message":{"text":"innerMergeWorker.doMergeJoin (cyclomatic 28): innerMergeWorker.doMergeJoin has cyclomatic complexity 28 (threshold 15). Of this number, 24 points are the body\u0027s own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/join/index_lookup_merge_join.go"},"region":{"startLine":527}}}],"partialFingerprints":{"codehealthFindingId/v1":"065b3a84440fbfbe7e46c8cce66605f5604aaa7b807fe8ce9726ffa2ef1db494"}},{"ruleId":"D1","level":"warning","message":{"text":"slowLogReverseScanner.nextBlock (cyclomatic 28): slowLogReverseScanner.nextBlock has cyclomatic complexity 28 (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":"pkg/executor/slow_query.go"},"region":{"startLine":460}}}],"partialFingerprints":{"codehealthFindingId/v1":"dc59ec52d5b948cd2bb451f381171327287c0f861602d413df52f1a890c0f8a0"}},{"ruleId":"D1","level":"warning","message":{"text":"builtinTiDBDecodeSQLDigestsSig.evalString (cyclomatic 28): builtinTiDBDecodeSQLDigestsSig.evalString has cyclomatic complexity 28 (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":"pkg/expression/builtin_info.go"},"region":{"startLine":1266}}}],"partialFingerprints":{"codehealthFindingId/v1":"c0fa33ee86702ea22c9f34c64b9be2eeb395170cf3aeb1f6fa0d206f7c0426ae"}},{"ruleId":"D1","level":"warning","message":{"text":"builtinRegexpSubstrFuncSig.vecEvalString (cyclomatic 28): builtinRegexpSubstrFuncSig.vecEvalString has cyclomatic complexity 28 (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":"pkg/expression/builtin_regexp.go"},"region":{"startLine":482}}}],"partialFingerprints":{"codehealthFindingId/v1":"0af6b8390e1eb5b26925c046ac7c61bac0adc615c8b4c398c5d7485d86d712bb"}},{"ruleId":"D1","level":"warning","message":{"text":"Checker.CheckTableLock (cyclomatic 28): Checker.CheckTableLock has cyclomatic complexity 28 (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":"pkg/lock/lock.go"},"region":{"startLine":45}}}],"partialFingerprints":{"codehealthFindingId/v1":"c9027e8a5c15147eaeeb48a6b4af2a6c911c9c8e20dfd056ee1e5493953d639d"}},{"ruleId":"D1","level":"warning","message":{"text":"expressionRewriter.handleCompareSubquery (cyclomatic 28): expressionRewriter.handleCompareSubquery has cyclomatic complexity 28 (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":"pkg/planner/core/expression_rewriter.go"},"region":{"startLine":822}}}],"partialFingerprints":{"codehealthFindingId/v1":"083b242c9c5b14f768887a48e616baf3929a1f1db1dd3797f612987a123396f7"}},{"ruleId":"D1","level":"warning","message":{"text":"havingWindowAndOrderbyExprResolver.resolveFromPlan (cyclomatic 28): havingWindowAndOrderbyExprResolver.resolveFromPlan has cyclomatic complexity 28 (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":"pkg/planner/core/logical_plan_builder.go"},"region":{"startLine":2692}}}],"partialFingerprints":{"codehealthFindingId/v1":"3c99368fdf53a9696da6899cd72bc39131487b12fd3a0dedb4e0d8553f5a7b13"}},{"ruleId":"D1","level":"warning","message":{"text":"logicalop.CanPushToCopImpl (cyclomatic 28): logicalop.CanPushToCopImpl has cyclomatic complexity 28 (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":"pkg/planner/core/operator/logicalop/logical_plans_misc.go"},"region":{"startLine":227}}}],"partialFingerprints":{"codehealthFindingId/v1":"0c56491ba7926d91fab0525347800d9636ee722cdf08caf38e92fe46b1a5eafe"}},{"ruleId":"D1","level":"warning","message":{"text":"DataSource.ExtractFD (cyclomatic 28): DataSource.ExtractFD has cyclomatic complexity 28 (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":"pkg/planner/core/operator/logicalop/logical_datasource.go"},"region":{"startLine":398}}}],"partialFingerprints":{"codehealthFindingId/v1":"6130d82be536150f40a41141329c84cd90a2e0dd268d7f55be441b469628d9c9"}},{"ruleId":"D1","level":"warning","message":{"text":"PointGetPlan.PrunePartitions (cyclomatic 28): PointGetPlan.PrunePartitions has cyclomatic complexity 28 (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":"pkg/planner/core/operator/physicalop/physical_batch_point_get.go"},"region":{"startLine":351}}}],"partialFingerprints":{"codehealthFindingId/v1":"a07c7e808473df6137643899c27e631fb22607ba0c486a0d3e4cd1c1f1631ee5"}},{"ruleId":"D1","level":"warning","message":{"text":"CorrelateSolver.correlate (cyclomatic 28): CorrelateSolver.correlate has cyclomatic complexity 28 (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":"pkg/planner/core/rule_correlate.go"},"region":{"startLine":51}}}],"partialFingerprints":{"codehealthFindingId/v1":"64790aa393f58094c149f9a7f0387b94a01dbe76a0e5565eac20f301a1959085"}},{"ruleId":"D1","level":"warning","message":{"text":"storage.columnStatsFromStorage (cyclomatic 28): storage.columnStatsFromStorage has cyclomatic complexity 28 (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":"pkg/statistics/handle/storage/read.go"},"region":{"startLine":336}}}],"partialFingerprints":{"codehealthFindingId/v1":"dfcf9d4ecf83df4d510674db3a20cd769b2e6454afca16bdb5d1e76318266d10"}},{"ruleId":"D1","level":"warning","message":{"text":"CopClient.BuildCopIterator (cyclomatic 28): CopClient.BuildCopIterator has cyclomatic complexity 28 (threshold 15). Of this number, 22 points are the body\u0027s own statements and 6 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":"pkg/store/copr/coprocessor.go"},"region":{"startLine":124}}}],"partialFingerprints":{"codehealthFindingId/v1":"0bdc126ea549f2d0c9ec14c2a834be4d54a2dfab96d14b9477e6c16387d079b8"}},{"ruleId":"D1","level":"warning","message":{"text":"ttlScanTask.doScanWithSession (cyclomatic 28): ttlScanTask.doScanWithSession has cyclomatic complexity 28 (threshold 15). Of this number, 22 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":"pkg/ttl/ttlworker/scan.go"},"region":{"startLine":139}}}],"partialFingerprints":{"codehealthFindingId/v1":"070fb31f5720ecda023b3b736f29e117970bdd199570486332c12c78df882506"}},{"ruleId":"D1","level":"warning","message":{"text":"BinaryJSON.extractTo (cyclomatic 28): BinaryJSON.extractTo has cyclomatic complexity 28 (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":"pkg/types/json_binary_functions.go"},"region":{"startLine":292}}}],"partialFingerprints":{"codehealthFindingId/v1":"cf713231a6400df899877d503c2b295eb917d9b8a319ec2f6881059a0b04d0be"}},{"ruleId":"D1","level":"warning","message":{"text":"ranger.ExtractEqAndInCondition (cyclomatic 28): ranger.ExtractEqAndInCondition has cyclomatic complexity 28 (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":"pkg/util/ranger/detacher.go"},"region":{"startLine":732}}}],"partialFingerprints":{"codehealthFindingId/v1":"673c6b0dc468eb3e65897f74c39d041724f775e84af34b5203983c4aff1f460a"}},{"ruleId":"D1","level":"warning","message":{"text":"ranger.convertPointInPlace (cyclomatic 28): ranger.convertPointInPlace has cyclomatic complexity 28 (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":"pkg/util/ranger/ranger.go"},"region":{"startLine":177}}}],"partialFingerprints":{"codehealthFindingId/v1":"969c8a863c77493350038b50df8ede17f577dcbab9b07a3e9102b24654fef70d"}},{"ruleId":"D1","level":"warning","message":{"text":"main.cmdRun (cyclomatic 28): main.cmdRun has cyclomatic complexity 28 (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/check/ut.go"},"region":{"startLine":225}}}],"partialFingerprints":{"codehealthFindingId/v1":"8c4017ba300f3a056d2fde7d773131d036eb27dceae1e2f1a9a566bf904b521a"}},{"ruleId":"D1","level":"warning","message":{"text":"SelectStmt.Accept (cyclomatic 28): SelectStmt.Accept has cyclomatic complexity 28 (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":"pkg/parser/ast/dml.go"},"region":{"startLine":1564}}}],"partialFingerprints":{"codehealthFindingId/v1":"924ed48b7612c6ae7cbe74923409bed1b089a16c08a80bf3b98971f6f845b48c"}},{"ruleId":"D1","level":"warning","message":{"text":"task.RunStreamTruncate (cyclomatic 27): task.RunStreamTruncate has cyclomatic complexity 27 (threshold 15). 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: 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":"br/pkg/task/stream.go"},"region":{"startLine":1142}}}],"partialFingerprints":{"codehealthFindingId/v1":"8ef6781fb4d244df03c9d858115695582121f2cca768a84cafdf3243a48728ec"}},{"ruleId":"D1","level":"warning","message":{"text":"bootstrap.checkUpgradeDotGo (cyclomatic 27): bootstrap.checkUpgradeDotGo has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"build/linter/bootstrap/analyzer.go"},"region":{"startLine":170}}}],"partialFingerprints":{"codehealthFindingId/v1":"6c834d11ce188872bee0223d8d4030477e538d3dece12cd490d17ec3859ee420"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.buildIndexColumns (cyclomatic 27): ddl.buildIndexColumns has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/index.go"},"region":{"startLine":116}}}],"partialFingerprints":{"codehealthFindingId/v1":"5c36369957d9f04d7c54889c30a707ca57c2f2fb36a29a7fed2d6fcbfd48420d"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.expectedDeleteRangeCnt (cyclomatic 27): ddl.expectedDeleteRangeCnt has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/sanity_check.go"},"region":{"startLine":80}}}],"partialFingerprints":{"codehealthFindingId/v1":"5807e6750493d3950f1f8654923087e8b30b73c09a4ecab298602ee00b22febb"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.refreshTiFlashTicker (cyclomatic 27): ddl.refreshTiFlashTicker has cyclomatic complexity 27 (threshold 15). Of this number, 23 points are the body\u0027s own statements and 4 belong to 2 function literals inside it that branch. To reduce it, 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":"pkg/ddl/ddl_tiflash_api.go"},"region":{"startLine":384}}}],"partialFingerprints":{"codehealthFindingId/v1":"c4d70c2f5ca6f91297602f10049746fed350fae767240766bc848785f8e318e2"}},{"ruleId":"D1","level":"warning","message":{"text":"Domain.checkReplicaRead (cyclomatic 27): Domain.checkReplicaRead has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/domain/domain.go"},"region":{"startLine":1002}}}],"partialFingerprints":{"codehealthFindingId/v1":"14b487e680d88a24355879885ccfa679a7dfb1493fab58677eae272af6d0c036"}},{"ruleId":"D1","level":"warning","message":{"text":"aggfuncs.buildCount (cyclomatic 27): aggfuncs.buildCount 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/executor/aggfuncs/builder.go"},"region":{"startLine":211}}}],"partialFingerprints":{"codehealthFindingId/v1":"0eabdcaaa231ba1c6e964907e227f88f315058c7377a90f54a234fb6978bd609"}},{"ruleId":"D1","level":"warning","message":{"text":"executorBuilder.buildUnionScanFromReader (cyclomatic 27): executorBuilder.buildUnionScanFromReader has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/builder.go"},"region":{"startLine":1507}}}],"partialFingerprints":{"codehealthFindingId/v1":"a9724076441c8b4388577bf5925ab8cdd8c7141aee53e7417e53df29a748a5b4"}},{"ruleId":"D1","level":"warning","message":{"text":"CheckTableExec.Next (cyclomatic 27): CheckTableExec.Next has cyclomatic complexity 27 (threshold 15). Of this number, 18 points are the body\u0027s own statements and 9 belong to one function literal inside it that branches. To reduce it, 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":"pkg/executor/check_table_index.go"},"region":{"startLine":142}}}],"partialFingerprints":{"codehealthFindingId/v1":"0225a94002a1142248727dce072298df4f170bfb64304e9882336765af771e3e"}},{"ruleId":"D1","level":"warning","message":{"text":"indexMergeProcessWorker.fetchLoopUnionWithOrderBy (cyclomatic 27): indexMergeProcessWorker.fetchLoopUnionWithOrderBy has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/index_merge_reader.go"},"region":{"startLine":1111}}}],"partialFingerprints":{"codehealthFindingId/v1":"6b5717325abcf3718fa39cc426e14bfb5f56f1ca568f4495904b5a9e8e72909a"}},{"ruleId":"D1","level":"warning","message":{"text":"indexMergeProcessWorker.fetchLoopUnion (cyclomatic 27): indexMergeProcessWorker.fetchLoopUnion has cyclomatic complexity 27 (threshold 15). Of this number, 25 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":"pkg/executor/index_merge_reader.go"},"region":{"startLine":1245}}}],"partialFingerprints":{"codehealthFindingId/v1":"4512829f4f1480ca2e5153819008e192f732125644084d8cfc043a5c6a02bacb"}},{"ruleId":"D1","level":"warning","message":{"text":"ShowExec.fetchShowCreateUser (cyclomatic 27): ShowExec.fetchShowCreateUser has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/show.go"},"region":{"startLine":1852}}}],"partialFingerprints":{"codehealthFindingId/v1":"fd7446148169bd994362537ff909e869893bdf38c0266c3e9a909a96c4e94f0d"}},{"ruleId":"D1","level":"warning","message":{"text":"TableReaderExecutor.Open (cyclomatic 27): TableReaderExecutor.Open has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/table_reader.go"},"region":{"startLine":232}}}],"partialFingerprints":{"codehealthFindingId/v1":"511ffc1bc5f0f3700a34e0f6b0ed55469a51fd0110cda700134bc41949df7178"}},{"ruleId":"D1","level":"warning","message":{"text":"expression.simpleCanonicalizedHashCode (cyclomatic 27): expression.simpleCanonicalizedHashCode has cyclomatic complexity 27 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/scalar_function.go"},"region":{"startLine":623}}}],"partialFingerprints":{"codehealthFindingId/v1":"f5eee4b4f3031c7a98c10f19ac6594ea3663188a57c1302dfdfda119e2660934"}},{"ruleId":"D1","level":"warning","message":{"text":"baseDateArithmetical.vecGetIntervalFromDecimal (cyclomatic 27): baseDateArithmetical.vecGetIntervalFromDecimal has cyclomatic complexity 27 (threshold 15). Of this number, 24 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":"pkg/expression/builtin_time.go"},"region":{"startLine":3487}}}],"partialFingerprints":{"codehealthFindingId/v1":"41b8cc1c02187152b5471a03c04ff558c46ae1e8218de30d306f0991ffabdf06"}},{"ruleId":"D1","level":"warning","message":{"text":"internal.sizeOf (cyclomatic 27): internal.sizeOf has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/infoschema/internal/sizer.go"},"region":{"startLine":33}}}],"partialFingerprints":{"codehealthFindingId/v1":"70d65a0b5ccc386f6a15157afb3638558279723a454094744ae9aaa9bd434529"}},{"ruleId":"D1","level":"warning","message":{"text":"DBStore.adjust (cyclomatic 27): DBStore.adjust has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/lightning/config/config.go"},"region":{"startLine":162}}}],"partialFingerprints":{"codehealthFindingId/v1":"4262b1e680851a95ddd317fb3a0dae3ae14dbe6ee91a88d9e6b88d4476f7e972"}},{"ruleId":"D1","level":"warning","message":{"text":"core.initUnfinishedPathsFromExpr (cyclomatic 27): core.initUnfinishedPathsFromExpr has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/indexmerge_unfinished_path.go"},"region":{"startLine":156}}}],"partialFingerprints":{"codehealthFindingId/v1":"9c2e02bc274352139201fea3dc1ea2eb0396bd3682c52b82dd8340658287a21d"}},{"ruleId":"D1","level":"warning","message":{"text":"core.setupFineGrainedShuffleInternal (cyclomatic 27): core.setupFineGrainedShuffleInternal has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/optimizer.go"},"region":{"startLine":862}}}],"partialFingerprints":{"codehealthFindingId/v1":"313e52f8c240e14fb212fefcb381b7bfc1c56554ffc64d7748e38c119c3d0956"}},{"ruleId":"D1","level":"warning","message":{"text":"core.GeneratePlanCacheStmtWithAST (cyclomatic 27): core.GeneratePlanCacheStmtWithAST has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/plan_cache_utils.go"},"region":{"startLine":92}}}],"partialFingerprints":{"codehealthFindingId/v1":"e11ea974e24accd7a234368b1728f9af8fb4595ae2a2c0b803ec7efbeb1319ec"}},{"ruleId":"D1","level":"warning","message":{"text":"joinOrderDP.optimizeWithDetector (cyclomatic 27): joinOrderDP.optimizeWithDetector has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/joinorder/join_order.go"},"region":{"startLine":383}}}],"partialFingerprints":{"codehealthFindingId/v1":"fc9579636c7b0e92b8e9d010009c4bbf29f40cfb71dac079bd69f0c769f0b629"}},{"ruleId":"D1","level":"warning","message":{"text":"PlanBuilder.buildResultSetNode (cyclomatic 27): PlanBuilder.buildResultSetNode has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/logical_plan_builder.go"},"region":{"startLine":434}}}],"partialFingerprints":{"codehealthFindingId/v1":"a5bd53bfb0d8a7c86fd2a5c1b5c73fc30f76708f4216bb15fb3c4ab2aae2040b"}},{"ruleId":"D1","level":"warning","message":{"text":"PlanBuilder.BuildDataSourceFromView (cyclomatic 27): PlanBuilder.BuildDataSourceFromView has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/logical_plan_builder.go"},"region":{"startLine":5508}}}],"partialFingerprints":{"codehealthFindingId/v1":"476a8f9fd75e39b63a06d3010be6212b3f5cc16be7fb767bc94bfa3b7e8e6b9d"}},{"ruleId":"D1","level":"warning","message":{"text":"PlanBuilder.buildAnalyzeFullSamplingTask (cyclomatic 27): PlanBuilder.buildAnalyzeFullSamplingTask has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/planbuilder.go"},"region":{"startLine":2677}}}],"partialFingerprints":{"codehealthFindingId/v1":"e037d34db1956bb63b25b07b17aa4f721987f8c777f80e20d22b633f70881274"}},{"ruleId":"D1","level":"warning","message":{"text":"PlanBuilder.buildInsert (cyclomatic 27): PlanBuilder.buildInsert has cyclomatic complexity 27 (threshold 15). Of this number, 25 points are the body\u0027s own statements and 2 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":"pkg/planner/core/planbuilder.go"},"region":{"startLine":4111}}}],"partialFingerprints":{"codehealthFindingId/v1":"0f494f0feb17c366429466012bd942c6ffa36b9618233c299200d02755a48a3b"}},{"ruleId":"D1","level":"warning","message":{"text":"CollectPredicateColumnsPoint.markAtLeastOneFullStatsLoadForEachTable (cyclomatic 27): CollectPredicateColumnsPoint.markAtLeastOneFullStatsLoadForEachTable has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 8 of the 27 points are its own statements and the rest belongs to one function literal inside it that branches (line 139). 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":"pkg/planner/core/rule/rule_collect_plan_stats.go"},"region":{"startLine":108}}}],"partialFingerprints":{"codehealthFindingId/v1":"a42054249f981a900724637c50a027894a5cc3a938b821bae679c76107ce5b53"}},{"ruleId":"D1","level":"warning","message":{"text":"OuterJoinEliminator.doOptimize (cyclomatic 27): OuterJoinEliminator.doOptimize has cyclomatic complexity 27 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/rule_join_elimination.go"},"region":{"startLine":302}}}],"partialFingerprints":{"codehealthFindingId/v1":"dfd05eaa55560cca3e9d596ea12143e56c8c1a427bba2be195d4b9c3b919135f"}},{"ruleId":"D1","level":"warning","message":{"text":"clientConn.checkAuthPlugin (cyclomatic 27): clientConn.checkAuthPlugin has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/server/conn.go"},"region":{"startLine":939}}}],"partialFingerprints":{"codehealthFindingId/v1":"c0ffe134878267073c05c6f418f9b4e8729dcf5ea1a1eb99ceee139bfc59f266"}},{"ruleId":"D1","level":"warning","message":{"text":"session.updateTelemetryMetric (cyclomatic 27): session.updateTelemetryMetric has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/session/session.go"},"region":{"startLine":5488}}}],"partialFingerprints":{"codehealthFindingId/v1":"512861bd2f07af5e24d27ccabe97494ef6af149dd1b3668d922d7baaab9cb2ff"}},{"ruleId":"D1","level":"warning","message":{"text":"copIterator.Next (cyclomatic 27): copIterator.Next 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":"pkg/store/copr/coprocessor.go"},"region":{"startLine":1416}}}],"partialFingerprints":{"codehealthFindingId/v1":"a944f010282c7d920d2ddff2ed707581d28bc3eeccfd4ba6e77fdc1f3ec4f24d"}},{"ruleId":"D1","level":"warning","message":{"text":"copIteratorWorker.handleBatchCopResponse (cyclomatic 27): copIteratorWorker.handleBatchCopResponse has cyclomatic complexity 27 (threshold 15). Of this number, 24 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":"pkg/store/copr/coprocessor.go"},"region":{"startLine":2339}}}],"partialFingerprints":{"codehealthFindingId/v1":"d8b9e19200e3dba933e7425d3e489b3f149be82209e4db2f418999e804b29d43"}},{"ruleId":"D1","level":"warning","message":{"text":"JobManager.triggerTTLJob (cyclomatic 27): JobManager.triggerTTLJob has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 13 of the 27 points are its own statements and the rest belongs to one function literal inside it that branches (line 429). 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":"pkg/ttl/ttlworker/job_manager.go"},"region":{"startLine":352}}}],"partialFingerprints":{"codehealthFindingId/v1":"9cee271ce7f51309fac326f74515b045149af86ed82e8568e74cccf0ff47faa1"}},{"ruleId":"D1","level":"warning","message":{"text":"codec.HashGroupKey (cyclomatic 27): codec.HashGroupKey has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/util/codec/codec.go"},"region":{"startLine":1791}}}],"partialFingerprints":{"codehealthFindingId/v1":"364c8ed405937c1dbf24a047d6e439d6c3a4e809f25d55178e5e3204659d33b7"}},{"ruleId":"D1","level":"warning","message":{"text":"util.NewTLSConfig (cyclomatic 27): util.NewTLSConfig has cyclomatic complexity 27 (threshold 15). Of this number, 19 points are the body\u0027s own statements and 8 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":"pkg/util/security.go"},"region":{"startLine":174}}}],"partialFingerprints":{"codehealthFindingId/v1":"a07f6f8c5266cdd639f087ec3aac499debddad5363c17a0a1343436910b44169"}},{"ruleId":"D1","level":"warning","message":{"text":"FieldType.RestoreAsCastType (cyclomatic 27): FieldType.RestoreAsCastType has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/parser/types/field_type.go"},"region":{"startLine":623}}}],"partialFingerprints":{"codehealthFindingId/v1":"8ee27c35ddca32519b93b658feb73beb84daf64d054ab639912a32d777e30176"}},{"ruleId":"D1","level":"warning","message":{"text":"Client.RunLoop (cyclomatic 26): Client.RunLoop 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":"br/pkg/backup/client.go"},"region":{"startLine":191}}}],"partialFingerprints":{"codehealthFindingId/v1":"ab5f4b4aee017427dc1eb9c63b97b5969c02ad73f884ea843c6b88df73ed1297"}},{"ruleId":"D1","level":"warning","message":{"text":"logclient.ApplyKVFilesWithBatchMethod (cyclomatic 26): logclient.ApplyKVFilesWithBatchMethod 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":"br/pkg/restore/log_client/client.go"},"region":{"startLine":870}}}],"partialFingerprints":{"codehealthFindingId/v1":"81c60813ec2a062817cac5d5c186193c9e309e9490d960e119491ee5c048e879"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.buildFKInfo (cyclomatic 26): ddl.buildFKInfo 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":"pkg/ddl/executor.go"},"region":{"startLine":5278}}}],"partialFingerprints":{"codehealthFindingId/v1":"f8d9ec1b9ef8d76e09aec7a0546de6f13959034027cd33d18fe7203ff7b10135"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.onMultiSchemaChange (cyclomatic 26): ddl.onMultiSchemaChange 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":"pkg/ddl/multi_schema_change.go"},"region":{"startLine":32}}}],"partialFingerprints":{"codehealthFindingId/v1":"4643a2f58fda97035234b2e6cc09791f974a2ad1f8559d1ceea7f23a139db386"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.getPartitionIntervalFromTable (cyclomatic 26): ddl.getPartitionIntervalFromTable 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":"pkg/ddl/partition.go"},"region":{"startLine":831}}}],"partialFingerprints":{"codehealthFindingId/v1":"83f29cc4a93b72ee7f032b98445d415880cca59363c4db5611e707be617310e2"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.checkExchangePartitionRecordValidation (cyclomatic 26): ddl.checkExchangePartitionRecordValidation has cyclomatic complexity 26 (threshold 15). Of this number, 21 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":"pkg/ddl/partition.go"},"region":{"startLine":4305}}}],"partialFingerprints":{"codehealthFindingId/v1":"79a9327c3304b0e3267b93c08b7f6ed2e689e046016ed7f674d0c28fbc21ef08"}},{"ruleId":"D1","level":"warning","message":{"text":"worker.executeDistTask (cyclomatic 26): worker.executeDistTask has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 11 of the 26 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 3302, 3223, 3178, \u2026). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals\u0027 work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/index.go"},"region":{"startLine":3153}}}],"partialFingerprints":{"codehealthFindingId/v1":"13bd4c2cebde00356fe1eec3b53ba6e1e0443fb0f955ee35cea354a6315eee98"}},{"ruleId":"D1","level":"warning","message":{"text":"IndexLookUpExecutor.startIndexWorker (cyclomatic 26): IndexLookUpExecutor.startIndexWorker has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 10 of the 26 points are its own statements and the rest belongs to one function literal inside it that branches (line 863). 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":"pkg/executor/distsql.go"},"region":{"startLine":822}}}],"partialFingerprints":{"codehealthFindingId/v1":"eea59e6f0bfde3c8db3c347b27f0edaa106700f40fa5a824d982973480bf8867"}},{"ruleId":"D1","level":"warning","message":{"text":"deadlocksTableRetriever.retrieve (cyclomatic 26): deadlocksTableRetriever.retrieve has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 8 of the 26 points are its own statements and the rest belongs to one function literal inside it that branches (line 3442). 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":"pkg/executor/infoschema_reader.go"},"region":{"startLine":3408}}}],"partialFingerprints":{"codehealthFindingId/v1":"b0ab3eec7343edba4501298d61f03c7af6e1a0db3b79c4bc45d3f29466b0ccc6"}},{"ruleId":"D1","level":"warning","message":{"text":"expression.evalOneVec (cyclomatic 26): expression.evalOneVec 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":"pkg/expression/chunk_executor.go"},"region":{"startLine":109}}}],"partialFingerprints":{"codehealthFindingId/v1":"a5f4848ea9bf375ea8a82f1ae7ffb25f0db97387b7f2ab556180b1e3b52fc0d7"}},{"ruleId":"D1","level":"warning","message":{"text":"expression.evaluateExprWithNullInNullRejectCheck (cyclomatic 26): expression.evaluateExprWithNullInNullRejectCheck 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":"pkg/expression/expression.go"},"region":{"startLine":993}}}],"partialFingerprints":{"codehealthFindingId/v1":"a98c44550bbf15516b6a081b6bdb3b02aeade68df92ffff77e8c17bd5febd51e"}},{"ruleId":"D1","level":"warning","message":{"text":"expression.buildFTSBooleanModeILikeExpression (cyclomatic 26): expression.buildFTSBooleanModeILikeExpression 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":"pkg/expression/fts_to_like.go"},"region":{"startLine":218}}}],"partialFingerprints":{"codehealthFindingId/v1":"dd02bd0ec8762047395e1432bceb730e4df4d4d9bd50f2212d7d0d33b305ee43"}},{"ruleId":"D1","level":"warning","message":{"text":"builtinArithmeticPlusIntSig.evalInt (cyclomatic 26): builtinArithmeticPlusIntSig.evalInt has cyclomatic complexity 26 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/builtin_arithmetic.go"},"region":{"startLine":229}}}],"partialFingerprints":{"codehealthFindingId/v1":"ba04b5831017ed9922d694c187f70f247a69bb40bb24058b827f9462bfa4f66b"}},{"ruleId":"D1","level":"warning","message":{"text":"builtinBenchmarkSig.evalInt (cyclomatic 26): builtinBenchmarkSig.evalInt 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":"pkg/expression/builtin_info.go"},"region":{"startLine":682}}}],"partialFingerprints":{"codehealthFindingId/v1":"a70c57f238daca7681c3610e3f6525366037507d84bb0d6e79d75307e0f1372f"}},{"ruleId":"D1","level":"warning","message":{"text":"builtinInIntSig.evalInt (cyclomatic 26): builtinInIntSig.evalInt 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":"pkg/expression/builtin_other.go"},"region":{"startLine":274}}}],"partialFingerprints":{"codehealthFindingId/v1":"61cd1bf437746707ab683ec5fbb37683064ea3bf81af5a343bfaa0107a2b59fe"}},{"ruleId":"D1","level":"warning","message":{"text":"builtinRegexpSubstrFuncSig.evalString (cyclomatic 26): builtinRegexpSubstrFuncSig.evalString 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":"pkg/expression/builtin_regexp.go"},"region":{"startLine":404}}}],"partialFingerprints":{"codehealthFindingId/v1":"a7ec190af5d4b28eaa3e8a48fae70a96f392a7e9147e9c8c49ad1017225d2b13"}},{"ruleId":"D1","level":"warning","message":{"text":"objstore.getAzureServiceClientBuilder (cyclomatic 26): objstore.getAzureServiceClientBuilder 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":"pkg/objstore/azblob.go"},"region":{"startLine":286}}}],"partialFingerprints":{"codehealthFindingId/v1":"0e6825a34326f75e21ebb6ab44f0cad0b3adbf5451847f2817259a8524d7800b"}},{"ruleId":"D1","level":"warning","message":{"text":"cardinality.AdjustRowCountForAppendedHandleColumns (cyclomatic 26): cardinality.AdjustRowCountForAppendedHandleColumns 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":"pkg/planner/cardinality/row_count_index.go"},"region":{"startLine":591}}}],"partialFingerprints":{"codehealthFindingId/v1":"da1b554201efb7d175fa24a401b9934893b06b2f5109abd70335eaf8882b8d54"}},{"ruleId":"D1","level":"warning","message":{"text":"core.binaryOpFromFlatOp (cyclomatic 26): core.binaryOpFromFlatOp 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":"pkg/planner/core/common_plans.go"},"region":{"startLine":1254}}}],"partialFingerprints":{"codehealthFindingId/v1":"b5478383723c714fb2568627faa1c006bfbbbf93813ac361d0217f20d67c6fd1"}},{"ruleId":"D1","level":"warning","message":{"text":"core.indexJoinPathBuild (cyclomatic 26): core.indexJoinPathBuild 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":"pkg/planner/core/index_join_path.go"},"region":{"startLine":168}}}],"partialFingerprints":{"codehealthFindingId/v1":"58be74fd39880cb0a58ff47e81d9f6943c755900e03791fcce875cf049b785d5"}},{"ruleId":"D1","level":"warning","message":{"text":"core.getPlanCostVer24PhysicalTableScan (cyclomatic 26): core.getPlanCostVer24PhysicalTableScan 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":"pkg/planner/core/plan_cost_ver2.go"},"region":{"startLine":159}}}],"partialFingerprints":{"codehealthFindingId/v1":"4986084eb3c9a02fe0e75277d6d19570faa6b6e3be062d39dbb258c05efde24a"}},{"ruleId":"D1","level":"warning","message":{"text":"physicalop.BuildIndexMergeTableScan (cyclomatic 26): physicalop.BuildIndexMergeTableScan 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":"pkg/planner/core/operator/physicalop/physical_table_scan.go"},"region":{"startLine":865}}}],"partialFingerprints":{"codehealthFindingId/v1":"14c2ac6605e45c3e4f658ac3226c0da066be0983059c6bdf0054ddbc2502d7be"}},{"ruleId":"D1","level":"warning","message":{"text":"PartitionProcessor.getUsedKeyPartitions (cyclomatic 26): PartitionProcessor.getUsedKeyPartitions 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":"pkg/planner/core/rule/rule_partition_processor.go"},"region":{"startLine":275}}}],"partialFingerprints":{"codehealthFindingId/v1":"07ab145394a3f4617ada473702bc36569b4870175b34f490804367fa0c3ea5fd"}},{"ruleId":"D1","level":"warning","message":{"text":"SkewDistinctAggRewriter.rewriteSkewDistinctAgg (cyclomatic 26): SkewDistinctAggRewriter.rewriteSkewDistinctAgg 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":"pkg/planner/core/rule_aggregation_skew_rewrite.go"},"region":{"startLine":51}}}],"partialFingerprints":{"codehealthFindingId/v1":"3de8bb9822a4c1544c946d23d9503ccbf775096a5a39b68163f931c7a8bb4827"}},{"ruleId":"D1","level":"warning","message":{"text":"planner.getPlanFromNonPreparedPlanCache (cyclomatic 26): planner.getPlanFromNonPreparedPlanCache 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":"pkg/planner/optimize.go"},"region":{"startLine":68}}}],"partialFingerprints":{"codehealthFindingId/v1":"5ab5a65ad9a79b0a3fbece3da43e2b12339fbef6108cf161b6cba433c25f160c"}},{"ruleId":"D1","level":"warning","message":{"text":"session.upgradeStarterBootstrapWithFile (cyclomatic 26): session.upgradeStarterBootstrapWithFile has cyclomatic complexity 26 (threshold 15). Of this number, 25 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":"pkg/session/starter_bootstrap_file.go"},"region":{"startLine":211}}}],"partialFingerprints":{"codehealthFindingId/v1":"8c383f02ea35b3dcbb71de7a5376e4132a6f41b6db58a9507e069088ecac6ec5"}},{"ruleId":"D1","level":"warning","message":{"text":"exchSenderExec.next (cyclomatic 26): exchSenderExec.next has cyclomatic complexity 26 (threshold 15). Of this number, 21 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":"pkg/store/mockstore/unistore/cophandler/mpp_exec.go"},"region":{"startLine":955}}}],"partialFingerprints":{"codehealthFindingId/v1":"0fd63b9af04a6721b0d4f101a78df88d64d3317de890b5f1199c2a0860eea55d"}},{"ruleId":"D1","level":"warning","message":{"text":"TableCommon.updateRecord (cyclomatic 26): TableCommon.updateRecord has cyclomatic complexity 26 (threshold 15). Of this number, 24 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, 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":"pkg/table/tables/tables.go"},"region":{"startLine":445}}}],"partialFingerprints":{"codehealthFindingId/v1":"006d99bab9c005972d598c11f4fe82bd91d466d11cf010e44b54e7fd2cf25b9a"}},{"ruleId":"D1","level":"warning","message":{"text":"types.timestampDiff (cyclomatic 26): types.timestampDiff has cyclomatic complexity 26 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/types/core_time.go"},"region":{"startLine":552}}}],"partialFingerprints":{"codehealthFindingId/v1":"cfa2c9162446b9637ff65dae94b950a0343900c58de1bdbec6f5d7b8d643b03b"}},{"ruleId":"D1","level":"warning","message":{"text":"types.ProduceStrWithSpecifiedTp (cyclomatic 26): types.ProduceStrWithSpecifiedTp 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":"pkg/types/datum.go"},"region":{"startLine":1219}}}],"partialFingerprints":{"codehealthFindingId/v1":"f82cb077362819f733187c4adb83604fed1393d903c431ead27f25fa88cc05d4"}},{"ruleId":"D1","level":"warning","message":{"text":"ExecDetails.ToZapFields (cyclomatic 26): ExecDetails.ToZapFields 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":"pkg/util/execdetails/execdetails.go"},"region":{"startLine":358}}}],"partialFingerprints":{"codehealthFindingId/v1":"31e80f555f00717e9e786810499ed3065e2d17e4ac8292e0cf426ccfae6a6a19"}},{"ruleId":"D1","level":"warning","message":{"text":"importer.genColumnData (cyclomatic 26): importer.genColumnData 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":"pkg/util/importer/db.go"},"region":{"startLine":96}}}],"partialFingerprints":{"codehealthFindingId/v1":"1c3fca015cff01846d27212a381a49bc1ed4316b5aca4efbf9e0eac2dd25c314"}},{"ruleId":"D1","level":"warning","message":{"text":"AlterTableSpec.Accept (cyclomatic 26): AlterTableSpec.Accept 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":"pkg/parser/ast/ddl.go"},"region":{"startLine":4217}}}],"partialFingerprints":{"codehealthFindingId/v1":"ceaf2323991007f0092d2df5762927bd0c03a8428737ff8307e9c6dc59d0b567"}},{"ruleId":"D1","level":"warning","message":{"text":"Join.Restore (cyclomatic 26): Join.Restore 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":"pkg/parser/ast/dml.go"},"region":{"startLine":164}}}],"partialFingerprints":{"codehealthFindingId/v1":"38620b55a35584542baa2cf7b93d7dbaecff8370f6c8b16d33ac2d7fd78d19ee"}},{"ruleId":"D1","level":"warning","message":{"text":"TableSource.Restore (cyclomatic 26): TableSource.Restore 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":"pkg/parser/ast/dml.go"},"region":{"startLine":556}}}],"partialFingerprints":{"codehealthFindingId/v1":"9422b887e1a26b51f768678e88a65985f5921ce05d053b821b26800e0499d50d"}},{"ruleId":"D1","level":"warning","message":{"text":"DeleteStmt.Restore (cyclomatic 26): DeleteStmt.Restore 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":"pkg/parser/ast/dml.go"},"region":{"startLine":2693}}}],"partialFingerprints":{"codehealthFindingId/v1":"34c6b94c4fdf997043144a6261be956fcda0690dff12945fd7315c0f4a51547f"}},{"ruleId":"D1","level":"warning","message":{"text":"FlushStmt.Restore (cyclomatic 26): FlushStmt.Restore 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":"pkg/parser/ast/misc.go"},"region":{"startLine":1110}}}],"partialFingerprints":{"codehealthFindingId/v1":"8fb7bccb6c13303bc130e7c2d40c7f8ca8577f3a303f778cebe0f560017a41c9"}},{"ruleId":"D1","level":"warning","message":{"text":"mysql.formatWithStyle (cyclomatic 26): mysql.formatWithStyle 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":"pkg/parser/mysql/locale_format.go"},"region":{"startLine":196}}}],"partialFingerprints":{"codehealthFindingId/v1":"c0a5683e40f16047d9cf5cfe4d1c07455498334e88763953d8a4f6412f412a70"}},{"ruleId":"D1","level":"warning","message":{"text":"MyDecimal.FromString (cyclomatic 26): MyDecimal.FromString 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":"pkg/parser/test_driver/test_driver_mydecimal.go"},"region":{"startLine":186}}}],"partialFingerprints":{"codehealthFindingId/v1":"e953345dd0d9907bafb4dc8fa39305a07c0e3edd8f84e99c90abfd8df3cf1d7d"}},{"ruleId":"D1","level":"warning","message":{"text":"backup.WriteBackupDDLJobs (cyclomatic 25): backup.WriteBackupDDLJobs has cyclomatic complexity 25 (threshold 15). Of this number, 13 points are the body\u0027s own statements and 12 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":"br/pkg/backup/client.go"},"region":{"startLine":989}}}],"partialFingerprints":{"codehealthFindingId/v1":"5b3afed177af1f0b192f8b86edcf662a40f289abb60d57c86aa5cad3634f0ea6"}},{"ruleId":"D1","level":"warning","message":{"text":"SnapFileImporter.batchDownloadNewestVersionSST (cyclomatic 25): SnapFileImporter.batchDownloadNewestVersionSST has cyclomatic complexity 25 (threshold 15). Of this number, 18 points are the body\u0027s own statements and 7 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":"br/pkg/restore/snap_client/import.go"},"region":{"startLine":904}}}],"partialFingerprints":{"codehealthFindingId/v1":"f9dcd60f866db27dc00420dd41e9ec338215fdcba4268eca863606113494cc6a"}},{"ruleId":"D1","level":"warning","message":{"text":"export.outputTemplateUsesIndex (cyclomatic 25): export.outputTemplateUsesIndex has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 2 of the 25 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 741, 726). 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":"dumpling/export/config.go"},"region":{"startLine":713}}}],"partialFingerprints":{"codehealthFindingId/v1":"85dcc651ae14e7dab755981fffeb51801e2c23086623815fff87e72a8320bdc1"}},{"ruleId":"D1","level":"warning","message":{"text":"export.ListAllDatabasesTables (cyclomatic 25): export.ListAllDatabasesTables has cyclomatic complexity 25 (threshold 15). Of this number, 20 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":"dumpling/export/sql.go"},"region":{"startLine":367}}}],"partialFingerprints":{"codehealthFindingId/v1":"3029e1ca93bacdee5413370c6331f35a0d9270bf632923ea375165207067a325"}},{"ruleId":"D1","level":"warning","message":{"text":"Dumper.dumpDatabases (cyclomatic 25): Dumper.dumpDatabases 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":"dumpling/export/dump.go"},"region":{"startLine":395}}}],"partialFingerprints":{"codehealthFindingId/v1":"4c6c155b48f03c15b6a5c49bc10cd1b82c06905ec8d548f447c19f52283e2cee"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.checkAndSetFlashbackClusterInfo (cyclomatic 25): ddl.checkAndSetFlashbackClusterInfo has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/cluster.go"},"region":{"startLine":191}}}],"partialFingerprints":{"codehealthFindingId/v1":"b5b6d15da9da597d541fdd10e3b0339285dd3e8f8e0835db451cee90f722d676"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.noReorgDataStrict (cyclomatic 25): ddl.noReorgDataStrict has cyclomatic complexity 25 (threshold 15). Of this number, 20 points are the body\u0027s own statements and 5 belong to 2 function literals inside it that branch. 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":"pkg/ddl/modify_column.go"},"region":{"startLine":2043}}}],"partialFingerprints":{"codehealthFindingId/v1":"c693eca6f93a8a1cfb60c2470b72ae2986b43a259846879db55c82cd159cef3b"}},{"ruleId":"D1","level":"warning","message":{"text":"worker.transitOneJobStep (cyclomatic 25): worker.transitOneJobStep has cyclomatic complexity 25 (threshold 15). Of this number, 20 points are the body\u0027s own statements and 5 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":"pkg/ddl/job_worker.go"},"region":{"startLine":591}}}],"partialFingerprints":{"codehealthFindingId/v1":"6657c09bee22b3fdc4f726c8c43e2bbdd2e38f3484262c56b9d29ec1a8dab5c8"}},{"ruleId":"D1","level":"warning","message":{"text":"parquetfile.NewParser (cyclomatic 25): parquetfile.NewParser has cyclomatic complexity 25 (threshold 15). 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, 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":"pkg/dumpformat/parquetfile/parser.go"},"region":{"startLine":639}}}],"partialFingerprints":{"codehealthFindingId/v1":"d5d49ecf35e66500b3bcd94fd06d6b6e90e943adea2e132edd077c6ebf1cbb51"}},{"ruleId":"D1","level":"warning","message":{"text":"aggfuncs.evalAndEncode (cyclomatic 25): aggfuncs.evalAndEncode 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":"pkg/executor/aggfuncs/func_count_distinct.go"},"region":{"startLine":622}}}],"partialFingerprints":{"codehealthFindingId/v1":"bae0037429eea380c0b0a62dc3c8730b8bf34fc6a28e235fbeb71a4034a73dbe"}},{"ruleId":"D1","level":"warning","message":{"text":"LoadDataController.InitDataFiles (cyclomatic 25): LoadDataController.InitDataFiles has cyclomatic complexity 25 (threshold 15). Of this number, 23 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":"pkg/executor/importer/import.go"},"region":{"startLine":1464}}}],"partialFingerprints":{"codehealthFindingId/v1":"b633a15d06692a370cf2d877e1675622207969a1f2f5ec6ca76b812010f102ed"}},{"ruleId":"D1","level":"warning","message":{"text":"tidbTrxTableRetriever.retrieve (cyclomatic 25): tidbTrxTableRetriever.retrieve has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 11 of the 25 points are its own statements and the rest belongs to one function literal inside it that branches (line 3125). 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":"pkg/executor/infoschema_reader.go"},"region":{"startLine":3081}}}],"partialFingerprints":{"codehealthFindingId/v1":"f9c45dd1f5497069dc38fc735e7a156450a005ad8e011e616806a82fe5ac4080"}},{"ruleId":"D1","level":"warning","message":{"text":"ParallelNestedLoopApplyExec.reorderWorker (cyclomatic 25): ParallelNestedLoopApplyExec.reorderWorker has cyclomatic complexity 25 (threshold 15). Of this number, 18 points are the body\u0027s own statements and 7 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":"pkg/executor/parallel_apply.go"},"region":{"startLine":483}}}],"partialFingerprints":{"codehealthFindingId/v1":"ca225c23ea888d3f63dc08f058120f459a84472c898f58a6a6a81e368c61ab5c"}},{"ruleId":"D1","level":"warning","message":{"text":"DDLJobRetriever.appendJobToChunk (cyclomatic 25): DDLJobRetriever.appendJobToChunk 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":"pkg/executor/show_ddl_jobs.go"},"region":{"startLine":190}}}],"partialFingerprints":{"codehealthFindingId/v1":"38a1e693b3efe7fa865bb2be6e419fb67dbb5af69c357ece0e7bbc5ffc46bab0"}},{"ruleId":"D1","level":"warning","message":{"text":"SimpleExec.executeRevokeRole (cyclomatic 25): SimpleExec.executeRevokeRole 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":"pkg/executor/simple.go"},"region":{"startLine":698}}}],"partialFingerprints":{"codehealthFindingId/v1":"32f4261f07f038881f9441245ce562b877ec41484597906133cdde8d4665192c"}},{"ruleId":"D1","level":"warning","message":{"text":"SimpleExec.executeRenameUser (cyclomatic 25): SimpleExec.executeRenameUser 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":"pkg/executor/simple.go"},"region":{"startLine":2372}}}],"partialFingerprints":{"codehealthFindingId/v1":"25ef2f35807e66c6dab770cb0e4ea91d7f385084cd259b571692fd864a45bb18"}},{"ruleId":"D1","level":"warning","message":{"text":"expression.evalOneColumn (cyclomatic 25): expression.evalOneColumn has cyclomatic complexity 25 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/chunk_executor.go"},"region":{"startLine":215}}}],"partialFingerprints":{"codehealthFindingId/v1":"0ddbf652b604952a7a3f3cc147b9cc25e824350c0511e68a5595852246960057"}},{"ruleId":"D1","level":"warning","message":{"text":"expression.newFunctionImpl (cyclomatic 25): expression.newFunctionImpl 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":"pkg/expression/scalar_function.go"},"region":{"startLine":207}}}],"partialFingerprints":{"codehealthFindingId/v1":"c8a41137e463da4b768339f6201a9dc28e5f10c49f373fa518682842d49e211a"}},{"ruleId":"D1","level":"warning","message":{"text":"propConstSolver.propagateColumnEQ (cyclomatic 25): propConstSolver.propagateColumnEQ 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":"pkg/expression/constant_propagation.go"},"region":{"startLine":401}}}],"partialFingerprints":{"codehealthFindingId/v1":"6a80dd67e1cfb73dc1d322752eda73311f6a0e1164a65428b202415badaf2663"}},{"ruleId":"D1","level":"warning","message":{"text":"cardinality.expBackoffEstimation (cyclomatic 25): cardinality.expBackoffEstimation 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":"pkg/planner/cardinality/row_count_index.go"},"region":{"startLine":450}}}],"partialFingerprints":{"codehealthFindingId/v1":"50fc5b44aca34f7aff68c38aaaf1da5a3187e1c3d8db72a5d47da8b64f5bba78"}},{"ruleId":"D1","level":"warning","message":{"text":"core.preferHashJoin (cyclomatic 25): core.preferHashJoin has cyclomatic complexity 25 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/exhaust_physical_plans.go"},"region":{"startLine":1629}}}],"partialFingerprints":{"codehealthFindingId/v1":"48d0de4d95d6733843e233eaa0b60fe14b5e89a5aefa2352a284aeb11625174e"}},{"ruleId":"D1","level":"warning","message":{"text":"core.exhaustPhysicalPlans4LogicalJoin (cyclomatic 25): core.exhaustPhysicalPlans4LogicalJoin has cyclomatic complexity 25 (threshold 15). Of this number, 21 points are the body\u0027s own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/exhaust_physical_plans.go"},"region":{"startLine":2181}}}],"partialFingerprints":{"codehealthFindingId/v1":"e70705a8e3e0eb8f6d717d0ac8e657bfbd111abfa7f300fb982f69a7351fb102"}},{"ruleId":"D1","level":"warning","message":{"text":"core.generateANDIndexMerge4NormalIndex (cyclomatic 25): core.generateANDIndexMerge4NormalIndex has cyclomatic complexity 25 (threshold 15). 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, 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":"pkg/planner/core/indexmerge_path.go"},"region":{"startLine":273}}}],"partialFingerprints":{"codehealthFindingId/v1":"5d0f90b88f3dd58a8ae1106ad56c972a0344e33b1d724c84aa2dfa84a57425b7"}},{"ruleId":"D1","level":"warning","message":{"text":"FullTextIndexResolverRejectRemaining.visit (cyclomatic 25): FullTextIndexResolverRejectRemaining.visit 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":"pkg/planner/core/fts_resolve_index.go"},"region":{"startLine":375}}}],"partialFingerprints":{"codehealthFindingId/v1":"dba1c2c1531b94a4263a278df068c23ca5f011dc471998d2f25bc2a28a6a0158"}},{"ruleId":"D1","level":"warning","message":{"text":"preprocessor.checkLockClauseTables (cyclomatic 25): preprocessor.checkLockClauseTables 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":"pkg/planner/core/preprocess.go"},"region":{"startLine":1912}}}],"partialFingerprints":{"codehealthFindingId/v1":"41388593c9dba57dff9dc72d935918ce786f0607903d8e8316d7bc6ce7e65f1a"}},{"ruleId":"D1","level":"warning","message":{"text":"clientConn.executePreparedStmtAndWriteResult (cyclomatic 25): clientConn.executePreparedStmtAndWriteResult has cyclomatic complexity 25 (threshold 15). 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, 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":"pkg/server/conn_stmt.go"},"region":{"startLine":274}}}],"partialFingerprints":{"codehealthFindingId/v1":"9e3796a85ece6a865c1e4bbcb0b4a16b6b50b2d42586009c46c7307122ea59b0"}},{"ruleId":"D1","level":"warning","message":{"text":"Server.initTiDBListener (cyclomatic 25): Server.initTiDBListener 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":"pkg/server/server.go"},"region":{"startLine":374}}}],"partialFingerprints":{"codehealthFindingId/v1":"0903111dcb4ac84117f345cd54eeb3c7cdc4085bf071f95dbb2d9b1e59a29772"}},{"ruleId":"D1","level":"warning","message":{"text":"session.runStmt (cyclomatic 25): session.runStmt has cyclomatic complexity 25 (threshold 15). Of this number, 21 points are the body\u0027s own statements and 4 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":"pkg/session/session.go"},"region":{"startLine":2941}}}],"partialFingerprints":{"codehealthFindingId/v1":"c4b6016481c1ec3cb1dc727a3eafbaa4368e40fd41420c3e99a37770e328aba4"}},{"ruleId":"D1","level":"warning","message":{"text":"Handle.initStatsHistograms4Chunk (cyclomatic 25): Handle.initStatsHistograms4Chunk has cyclomatic complexity 25 (threshold 15). 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, 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":"pkg/statistics/handle/bootstrap.go"},"region":{"startLine":186}}}],"partialFingerprints":{"codehealthFindingId/v1":"3be206c9969c038baca59bf70b405be2eb498cbf13945074d1c5e433f625c093"}},{"ruleId":"D1","level":"warning","message":{"text":"copIteratorWorker.handleCopResponse (cyclomatic 25): copIteratorWorker.handleCopResponse 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":"pkg/store/copr/coprocessor.go"},"region":{"startLine":2134}}}],"partialFingerprints":{"codehealthFindingId/v1":"15a1c3aeba9920295c82b96d1381833908ac29f1ea04b29c84a6eb1c2a1d01f5"}},{"ruleId":"D1","level":"warning","message":{"text":"GCWorker.resolveLocks (cyclomatic 25): GCWorker.resolveLocks has cyclomatic complexity 25 (threshold 15). 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, 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":"pkg/store/gcworker/gc_worker.go"},"region":{"startLine":1250}}}],"partialFingerprints":{"codehealthFindingId/v1":"b0dca473784672d4a88ac15ed05a604e391d4ed03efa27e0bd2cd05dbc926ed2"}},{"ruleId":"D1","level":"warning","message":{"text":"MVCCStore.prewritePessimistic (cyclomatic 25): MVCCStore.prewritePessimistic 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":"pkg/store/mockstore/unistore/tikv/mvcc.go"},"region":{"startLine":850}}}],"partialFingerprints":{"codehealthFindingId/v1":"2034780a4a6d090e4a64b24a8b552fe29c8aa2f781da189995410e4990c56543"}},{"ruleId":"D1","level":"warning","message":{"text":"index.Delete (cyclomatic 25): index.Delete 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":"pkg/table/tables/index.go"},"region":{"startLine":572}}}],"partialFingerprints":{"codehealthFindingId/v1":"1af16c9320908a441b672633504a6bb1021ad6d307f5536dea7f6eb41e77a6de"}},{"ruleId":"D1","level":"warning","message":{"text":"cache.RowToTableStatus (cyclomatic 25): cache.RowToTableStatus 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":"pkg/ttl/cache/ttlstatus.go"},"region":{"startLine":112}}}],"partialFingerprints":{"codehealthFindingId/v1":"5a11c087b6b512a20520f14559f4e2059878823629a249d1c84258179fd058d8"}},{"ruleId":"D1","level":"warning","message":{"text":"ttlworker.prepareSession (cyclomatic 25): ttlworker.prepareSession has cyclomatic complexity 25 (threshold 15). Of this number, 16 points are the body\u0027s own statements and 9 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":"pkg/ttl/ttlworker/session.go"},"region":{"startLine":72}}}],"partialFingerprints":{"codehealthFindingId/v1":"015c3deed06cb3d30747bdeca583d814c6ca1c13edd08787abaeaeb2f5b4d680"}},{"ruleId":"D1","level":"warning","message":{"text":"types.DefaultTypeForValue (cyclomatic 25): types.DefaultTypeForValue has cyclomatic complexity 25 (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/types/field_type.go"},"region":{"startLine":228}}}],"partialFingerprints":{"codehealthFindingId/v1":"54fc85180f32ff5fee342359474ddc16ee1b51965937e430f6b0c09ebfb98913"}},{"ruleId":"D1","level":"warning","message":{"text":"types.ExtractDurationValue (cyclomatic 25): types.ExtractDurationValue 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":"pkg/types/time.go"},"region":{"startLine":2558}}}],"partialFingerprints":{"codehealthFindingId/v1":"d4eafa6e22af0bfeb05887e2079bcea60ad6b6b404ac19bebacba01ae084b62e"}},{"ruleId":"D1","level":"warning","message":{"text":"builder.newBuildFromPatternLike (cyclomatic 25): builder.newBuildFromPatternLike 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":"pkg/util/ranger/points.go"},"region":{"startLine":718}}}],"partialFingerprints":{"codehealthFindingId/v1":"ded420b743c675c1d018619a9efa73a70fec1a30ecf187d325007f8763aac225"}},{"ruleId":"D1","level":"warning","message":{"text":"DatumMapDecoder.decodeColDatum (cyclomatic 25): DatumMapDecoder.decodeColDatum 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":"pkg/util/rowcodec/decoder.go"},"region":{"startLine":102}}}],"partialFingerprints":{"codehealthFindingId/v1":"6907fbee6998285da7b13cd439219e3ae4ee1b258fab240a49d51ef83ab7f34d"}},{"ruleId":"D1","level":"warning","message":{"text":"LogFileManager.ReadFilteredEntriesFromFiles (cyclomatic 24): LogFileManager.ReadFilteredEntriesFromFiles 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":"br/pkg/restore/log_client/log_file_manager.go"},"region":{"startLine":480}}}],"partialFingerprints":{"codehealthFindingId/v1":"7b9b89fd94e2070cd9d1eb59152e1d6022a180b0286eb954b63ade4dd868e180"}},{"ruleId":"D1","level":"warning","message":{"text":"snapclient.CheckSysTableCompatibility (cyclomatic 24): snapclient.CheckSysTableCompatibility 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":"br/pkg/restore/snap_client/systable_restore.go"},"region":{"startLine":596}}}],"partialFingerprints":{"codehealthFindingId/v1":"41da9085ba05d8c9373ecdd40fe0605821fb706423bad7eb533e8a7897b3567f"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.checkIndexColumn (cyclomatic 24): ddl.checkIndexColumn 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":"pkg/ddl/index.go"},"region":{"startLine":240}}}],"partialFingerprints":{"codehealthFindingId/v1":"a2a57ff8da3cea513a15308fd643b6eea085ff5ac7218fd1e883a15b749dda34"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.ProcessModifyColumnOptions (cyclomatic 24): ddl.ProcessModifyColumnOptions has cyclomatic complexity 24 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/modify_column.go"},"region":{"startLine":2297}}}],"partialFingerprints":{"codehealthFindingId/v1":"3b8326ca9c42a4020ee40aa95437316c6b0c79643fa39c72a16cb92b37772522"}},{"ruleId":"D1","level":"warning","message":{"text":"executor.DropTablePartition (cyclomatic 24): executor.DropTablePartition 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":"pkg/ddl/executor.go"},"region":{"startLine":2909}}}],"partialFingerprints":{"codehealthFindingId/v1":"15268dc613ab066ae428a649760f84fddd9fe22604f949871ac7793b6f587889"}},{"ruleId":"D1","level":"warning","message":{"text":"worker.onDropColumn (cyclomatic 24): worker.onDropColumn 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":"pkg/ddl/column.go"},"region":{"startLine":142}}}],"partialFingerprints":{"codehealthFindingId/v1":"e21724bb88f6b90288954d29b8323d41e7efb69f621ec55937ece904025819b6"}},{"ruleId":"D1","level":"warning","message":{"text":"worker.onCreateColumnarIndex (cyclomatic 24): worker.onCreateColumnarIndex 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":"pkg/ddl/index.go"},"region":{"startLine":892}}}],"partialFingerprints":{"codehealthFindingId/v1":"7d7393761d8076a0c9a33c3a6ad7834b5def57a8b065f73a7e3e3d3b47a3b1fa"}},{"ruleId":"D1","level":"warning","message":{"text":"jobsubmit.SubmitBatch (cyclomatic 24): jobsubmit.SubmitBatch 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":"pkg/ddl/jobsubmit/submit.go"},"region":{"startLine":53}}}],"partialFingerprints":{"codehealthFindingId/v1":"321e299f33c52d3c4636e7b522b3a3877c6fc5a2ad7fdc8537e451e85450f1ab"}},{"ruleId":"D1","level":"warning","message":{"text":"executor.fetchClusterConfig (cyclomatic 24): executor.fetchClusterConfig has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 8 of the 24 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 212, 189). 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":"pkg/executor/memtable_reader.go"},"region":{"startLine":179}}}],"partialFingerprints":{"codehealthFindingId/v1":"877284c2299f0fb5bb06fd62eaf3951237c0c99855674271b223b9f67a8a8d83"}},{"ruleId":"D1","level":"warning","message":{"text":"cteProducer.computeRecursivePart (cyclomatic 24): cteProducer.computeRecursivePart has cyclomatic complexity 24 (threshold 15). Of this number, 16 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":"pkg/executor/cte.go"},"region":{"startLine":427}}}],"partialFingerprints":{"codehealthFindingId/v1":"47b4536e11ead83be5d7adf5dc675f5285c78e8e2df86f93f448e0a0bfeb44cf"}},{"ruleId":"D1","level":"warning","message":{"text":"memtableRetriever.setDataFromResourceGroups (cyclomatic 24): memtableRetriever.setDataFromResourceGroups 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":"pkg/executor/infoschema_reader.go"},"region":{"startLine":3934}}}],"partialFingerprints":{"codehealthFindingId/v1":"b1901e4d2e880f33ffcc64835be519ecc2e87caf75f4132bf3764f98e55b041c"}},{"ruleId":"D1","level":"warning","message":{"text":"ShuffleExec.Close (cyclomatic 24): ShuffleExec.Close 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":"pkg/executor/shuffle.go"},"region":{"startLine":152}}}],"partialFingerprints":{"codehealthFindingId/v1":"ed859f5ba0b16ec81e41bb6fac8867095f61e1c188d31b6f17a9e296ff524796"}},{"ruleId":"D1","level":"warning","message":{"text":"expression.TryPushCastIntoControlFunctionForHybridType (cyclomatic 24): expression.TryPushCastIntoControlFunctionForHybridType 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":"pkg/expression/builtin_cast.go"},"region":{"startLine":2898}}}],"partialFingerprints":{"codehealthFindingId/v1":"760fb97637cdd117f5665044b4c30d354a96cfb63a17d32d83f97f47f433abe3"}},{"ruleId":"D1","level":"warning","message":{"text":"expression.PBToExpr (cyclomatic 24): expression.PBToExpr has cyclomatic complexity 24 (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/expression/distsql_builtin.go"},"region":{"startLine":1218}}}],"partialFingerprints":{"codehealthFindingId/v1":"e70b2762229f7b3d0d4c021ecd0f82fb904c068aa60b30254623ad63a5de9e7e"}},{"ruleId":"D1","level":"warning","message":{"text":"builtinJSONContainsPathSig.vecEvalInt (cyclomatic 24): builtinJSONContainsPathSig.vecEvalInt has cyclomatic complexity 24 (threshold 15). Of this number, 22 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, 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":"pkg/expression/builtin_json_vec.go"},"region":{"startLine":1172}}}],"partialFingerprints":{"codehealthFindingId/v1":"e01d025433c2f7b2dc2e1849f74f311117e843eaabc563498fb216170fcbc3fc"}},{"ruleId":"D1","level":"warning","message":{"text":"isTrueOrFalseFunctionClass.getFunction (cyclomatic 24): isTrueOrFalseFunctionClass.getFunction 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":"pkg/expression/builtin_op.go"},"region":{"startLine":480}}}],"partialFingerprints":{"codehealthFindingId/v1":"af13c818f4b444c178945159b2d015fd3f33c68ef043acc761193259a6b37040"}},{"ruleId":"D1","level":"warning","message":{"text":"Engine.loadRangeBatchData (cyclomatic 24): Engine.loadRangeBatchData has cyclomatic complexity 24 (threshold 15). Of this number, 17 points are the body\u0027s own statements and 7 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ingestor/globalsort/engine.go"},"region":{"startLine":253}}}],"partialFingerprints":{"codehealthFindingId/v1":"2c0750ac2ed2f537ef80ae23b93b4b284d21011965413f06d51864d3b822df67"}},{"ruleId":"D1","level":"warning","message":{"text":"dbSSTIngester.mergeSSTs (cyclomatic 24): dbSSTIngester.mergeSSTs has cyclomatic complexity 24 (threshold 15). Of this number, 21 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":"pkg/ingestor/ingestctrl/engine.go"},"region":{"startLine":1601}}}],"partialFingerprints":{"codehealthFindingId/v1":"88bdcf90a9f2aabdd8cd019094b8d4bf928a9facd1a1755a4e95b9dc46d46aab"}},{"ruleId":"D1","level":"warning","message":{"text":"Conflict.adjust (cyclomatic 24): Conflict.adjust has cyclomatic complexity 24 (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":"pkg/lightning/config/config.go"},"region":{"startLine":1402}}}],"partialFingerprints":{"codehealthFindingId/v1":"25c8acb51606fae45e3f8108ffeae6bf070fbb32e8f85a1d804792f60f2c19a5"}},{"ruleId":"D1","level":"warning","message":{"text":"core.buildPartialPaths4MVIndex (cyclomatic 24): core.buildPartialPaths4MVIndex 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":"pkg/planner/core/indexmerge_path.go"},"region":{"startLine":838}}}],"partialFingerprints":{"codehealthFindingId/v1":"b588444b9f1326dce5c24727478c382a6794e4a955c28070c1fd99fbcef7e81a"}},{"ruleId":"D1","level":"warning","message":{"text":"core.NonPreparedPlanCacheableWithCtx (cyclomatic 24): core.NonPreparedPlanCacheableWithCtx 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":"pkg/planner/core/plan_cacheable_checker.go"},"region":{"startLine":235}}}],"partialFingerprints":{"codehealthFindingId/v1":"1e082f7dd971de166374c3a51483c6bcec7b91ffad8dfd2bde5ecec02a92c6b0"}},{"ruleId":"D1","level":"warning","message":{"text":"expressionRewriter.rewriteSystemVariable (cyclomatic 24): expressionRewriter.rewriteSystemVariable 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":"pkg/planner/core/expression_rewriter.go"},"region":{"startLine":1989}}}],"partialFingerprints":{"codehealthFindingId/v1":"aa16d8760e0078dda62de6102ea5f1224413ce770a770d7a56528f68e69aa1ad"}},{"ruleId":"D1","level":"warning","message":{"text":"PhysicalIndexJoin.ResolveIndices (cyclomatic 24): PhysicalIndexJoin.ResolveIndices 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":"pkg/planner/core/operator/physicalop/physical_index_join.go"},"region":{"startLine":374}}}],"partialFingerprints":{"codehealthFindingId/v1":"db5f64af1f924eda7f9f50bd50de0592fd9877fa2661b03dc56a7baeb9611802"}},{"ruleId":"D1","level":"warning","message":{"text":"variable.setPipelinedDmlResourcePolicy (cyclomatic 24): variable.setPipelinedDmlResourcePolicy 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":"pkg/sessionctx/variable/sysvar.go"},"region":{"startLine":4167}}}],"partialFingerprints":{"codehealthFindingId/v1":"8fd236cadd1aebdfb651dcd38eee7361c06dc76e28017ad7dfa7d8eecf63af01"}},{"ruleId":"D1","level":"warning","message":{"text":"RegionCache.SplitKeyRangesByBuckets (cyclomatic 24): RegionCache.SplitKeyRangesByBuckets has cyclomatic complexity 24 (threshold 15). Of this number, 19 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":"pkg/store/copr/region_cache.go"},"region":{"startLine":779}}}],"partialFingerprints":{"codehealthFindingId/v1":"5f8edb708dad83dce82ef329cdd26b6d57042da6a5f551acb40c80f059c4c329"}},{"ruleId":"D1","level":"warning","message":{"text":"table.handleZeroDatetime (cyclomatic 24): table.handleZeroDatetime 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":"pkg/table/column.go"},"region":{"startLine":237}}}],"partialFingerprints":{"codehealthFindingId/v1":"d8e1b76dc9813b568a9ab1fb7c0dfd618c3dc392cda93c0f8061dae20cbd7e29"}},{"ruleId":"D1","level":"warning","message":{"text":"types.GetTimezone (cyclomatic 24): types.GetTimezone has cyclomatic complexity 24 (threshold 15). Of this number, 21 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":"pkg/types/time.go"},"region":{"startLine":849}}}],"partialFingerprints":{"codehealthFindingId/v1":"b214bb2e407dc4dc7d0b12fab55b8f11020b1e9514b37ccd6249b41a6e8365b7"}},{"ruleId":"D1","level":"warning","message":{"text":"MyDecimal.FromBin (cyclomatic 24): MyDecimal.FromBin 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":"pkg/types/mydecimal.go"},"region":{"startLine":1476}}}],"partialFingerprints":{"codehealthFindingId/v1":"499c9b66fc97fc4c6ae0df9131547560e3a78b1e09d7f42cdecc41a9dc9d4a53"}},{"ruleId":"D1","level":"warning","message":{"text":"QBHintHandler.handleViewHints (cyclomatic 24): QBHintHandler.handleViewHints 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":"pkg/util/hint/hint_query_block.go"},"region":{"startLine":140}}}],"partialFingerprints":{"codehealthFindingId/v1":"9f65ef2bf8974e8e1e8df0bb65241b22e99a243cb88dd648a9e00bcf266f273d"}},{"ruleId":"D1","level":"warning","message":{"text":"Watcher.pollEvents (cyclomatic 24): Watcher.pollEvents has cyclomatic complexity 24 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/util/watcher/watcher.go"},"region":{"startLine":188}}}],"partialFingerprints":{"codehealthFindingId/v1":"c11f0eb930430218bee608a8027115b38d211538c7e03f06b802d8fc960fa5ad"}},{"ruleId":"D1","level":"warning","message":{"text":"LoadDataStmt.Restore (cyclomatic 24): LoadDataStmt.Restore 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":"pkg/parser/ast/dml.go"},"region":{"startLine":2010}}}],"partialFingerprints":{"codehealthFindingId/v1":"dbc07439ba45e4a89c4cad8313305c2b4283171219cc4a8c47f0eb0842f285d2"}},{"ruleId":"D1","level":"warning","message":{"text":"AlterUserStmt.Restore (cyclomatic 24): AlterUserStmt.Restore 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":"pkg/parser/ast/misc.go"},"region":{"startLine":1982}}}],"partialFingerprints":{"codehealthFindingId/v1":"caf6a7a277adb96846cb4417460930f9fa978ac482d244cff1c90d5dffbd3cf3"}},{"ruleId":"D1","level":"warning","message":{"text":"AnalyzeTableStmt.Restore (cyclomatic 24): AnalyzeTableStmt.Restore 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":"pkg/parser/ast/stats.go"},"region":{"startLine":104}}}],"partialFingerprints":{"codehealthFindingId/v1":"94f5d8a54e0d019584cbc019bedf033bc53cafc8b9c193de3e2b782e13a4e9b7"}},{"ruleId":"D1","level":"warning","message":{"text":"FieldType.CompactStr (cyclomatic 24): FieldType.CompactStr has cyclomatic complexity 24 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/parser/types/field_type.go"},"region":{"startLine":458}}}],"partialFingerprints":{"codehealthFindingId/v1":"b3fbc0a00773a8fd4fabfce3734b72b8db72d040c996c98beb44e725bd66399e"}},{"ruleId":"D1","level":"warning","message":{"text":"EC2Session.CreateSnapshots (cyclomatic 23): EC2Session.CreateSnapshots has cyclomatic complexity 23 (threshold 15). Of this number, 21 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":"br/pkg/aws/ebs.go"},"region":{"startLine":63}}}],"partialFingerprints":{"codehealthFindingId/v1":"0dba915837288aadee285135b56041b5be40e261a08ad2034493c61f11d5f54a"}},{"ruleId":"D1","level":"warning","message":{"text":"Schemas.BackupSchemas (cyclomatic 23): Schemas.BackupSchemas has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 5 of the 23 points are its own statements and the rest belongs to one function literal inside it that branches (line 104). 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":"br/pkg/backup/schema.go"},"region":{"startLine":80}}}],"partialFingerprints":{"codehealthFindingId/v1":"e25dbc5a6838a750ea3b0210455daa4689354e66da947e70ed23e27a6385544d"}},{"ruleId":"D1","level":"warning","message":{"text":"SnapFileImporter.batchDownloadSST (cyclomatic 23): SnapFileImporter.batchDownloadSST has cyclomatic complexity 23 (threshold 15). Of this number, 17 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":"br/pkg/restore/snap_client/import.go"},"region":{"startLine":781}}}],"partialFingerprints":{"codehealthFindingId/v1":"25e06f115d10f48cf3253b43191c32566f7424cc713382476109053a94bd9744"}},{"ruleId":"D1","level":"warning","message":{"text":"task.RunStreamStart (cyclomatic 23): task.RunStreamStart has cyclomatic complexity 23 (threshold 15). Of this number, 22 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":"br/pkg/task/stream.go"},"region":{"startLine":601}}}],"partialFingerprints":{"codehealthFindingId/v1":"91e87e3a227769b9fcc1117a073107877efc28ff07ceefada80268c52f7389ca"}},{"ruleId":"D1","level":"warning","message":{"text":"Dumper.concurrentDumpTable (cyclomatic 23): Dumper.concurrentDumpTable has cyclomatic complexity 23 (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":"dumpling/export/dump.go"},"region":{"startLine":784}}}],"partialFingerprints":{"codehealthFindingId/v1":"61a40102be7219cc075bd42da94828c59508663ab86ccc3042697c7f29eaceb1"}},{"ruleId":"D1","level":"warning","message":{"text":"Dumper.renewSelectTableRegionFuncForLowerTiDB (cyclomatic 23): Dumper.renewSelectTableRegionFuncForLowerTiDB has cyclomatic complexity 23 (threshold 15). Of this number, 19 points are the body\u0027s own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"dumpling/export/dump.go"},"region":{"startLine":1940}}}],"partialFingerprints":{"codehealthFindingId/v1":"4c77d3f9d85ccf0d7f9e2300770308d6ec56db159471da8b1888221a95e055a1"}},{"ruleId":"D1","level":"warning","message":{"text":"clusterResourceCheckItem.Check (cyclomatic 23): clusterResourceCheckItem.Check has cyclomatic complexity 23 (threshold 15). Of this number, 14 points are the body\u0027s own statements and 9 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":"lightning/pkg/importer/precheck_impl.go"},"region":{"startLine":101}}}],"partialFingerprints":{"codehealthFindingId/v1":"abf7fd4ca04ad8edea3c844409eb922e3bc3f217c2373449b195ea550a2e2abb"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.createTable (cyclomatic 23): ddl.createTable has cyclomatic complexity 23 (threshold 15). Of this number, 22 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":"pkg/ddl/create_table.go"},"region":{"startLine":59}}}],"partialFingerprints":{"codehealthFindingId/v1":"cf43196737a58d139d3c5719f9eaf12837f076d6b1acfe9241eda3ba88a806fd"}},{"ruleId":"D1","level":"warning","message":{"text":"executor.createIndex (cyclomatic 23): executor.createIndex has cyclomatic complexity 23 (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":"pkg/ddl/executor.go"},"region":{"startLine":5090}}}],"partialFingerprints":{"codehealthFindingId/v1":"5fdbf0a694467cfbd94c07ec222143dc7e82551689b979da2579af2e0b314f6d"}},{"ruleId":"D1","level":"warning","message":{"text":"balancer.doBalanceSubtasks (cyclomatic 23): balancer.doBalanceSubtasks has cyclomatic complexity 23 (threshold 15). Of this number, 22 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":"pkg/dxf/framework/scheduler/balancer.go"},"region":{"startLine":124}}}],"partialFingerprints":{"codehealthFindingId/v1":"09c4728806816bcd6efa7b19d364a724416e6ed09ee3621f794cb2f56d2b40ea"}},{"ruleId":"D1","level":"warning","message":{"text":"ExecStmt.FinishExecuteStmt (cyclomatic 23): ExecStmt.FinishExecuteStmt 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":"pkg/executor/adapter.go"},"region":{"startLine":1663}}}],"partialFingerprints":{"codehealthFindingId/v1":"eb1d4d56b553e6ee5d796401372e770115fe6667203a534ff2502a05249762b5"}},{"ruleId":"D1","level":"warning","message":{"text":"executorBuilder.buildHashJoinFromChildExecs (cyclomatic 23): executorBuilder.buildHashJoinFromChildExecs 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":"pkg/executor/builder.go"},"region":{"startLine":1976}}}],"partialFingerprints":{"codehealthFindingId/v1":"af2321b04942c7af9c5b9c44e7a4acfc3cdc5fac42d078b19eb921f69c9429cf"}},{"ruleId":"D1","level":"warning","message":{"text":"DeleteExec.deleteSingleTableByChunk (cyclomatic 23): DeleteExec.deleteSingleTableByChunk 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":"pkg/executor/delete.go"},"region":{"startLine":93}}}],"partialFingerprints":{"codehealthFindingId/v1":"ceb5a4fd99057b1f238811a74c779558951666713be60f9266254755d137f051"}},{"ruleId":"D1","level":"warning","message":{"text":"indexMergeProcessWorker.fetchLoopIntersection (cyclomatic 23): indexMergeProcessWorker.fetchLoopIntersection has cyclomatic complexity 23 (threshold 15). Of this number, 19 points are the body\u0027s own statements and 4 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":"pkg/executor/index_merge_reader.go"},"region":{"startLine":1577}}}],"partialFingerprints":{"codehealthFindingId/v1":"7fa255086b11d8e9293cb9d226f96a6970bad28e985a2520c30aa3176eede1b4"}},{"ruleId":"D1","level":"warning","message":{"text":"buildWorkerBase.fetchBuildSideRows (cyclomatic 23): buildWorkerBase.fetchBuildSideRows has cyclomatic complexity 23 (threshold 15). Of this number, 13 points are the body\u0027s own statements and 10 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":"pkg/executor/join/hash_join_base.go"},"region":{"startLine":257}}}],"partialFingerprints":{"codehealthFindingId/v1":"045229df26106ba437eb7a5ab77f71044c070f6226b4cc2d81bb441e070be2d4"}},{"ruleId":"D1","level":"warning","message":{"text":"ShowExec.fetchShowVariables (cyclomatic 23): ShowExec.fetchShowVariables 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":"pkg/executor/show.go"},"region":{"startLine":942}}}],"partialFingerprints":{"codehealthFindingId/v1":"56e9fb1584d1998ce4932cebf26568775661a6fa94377f21ad05508818b82c6e"}},{"ruleId":"D1","level":"warning","message":{"text":"ShowExec.fetchShowAffinity (cyclomatic 23): ShowExec.fetchShowAffinity 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":"pkg/executor/show_affinity.go"},"region":{"startLine":31}}}],"partialFingerprints":{"codehealthFindingId/v1":"ebb454906162dd99f75f26fa73a09a8748da20f175672008d710b865e93a77c9"}},{"ruleId":"D1","level":"warning","message":{"text":"ShowExec.fetchShowStatsMeta (cyclomatic 23): ShowExec.fetchShowStatsMeta 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":"pkg/executor/show_stats.go"},"region":{"startLine":36}}}],"partialFingerprints":{"codehealthFindingId/v1":"d6b4a913a4c2ef26e1b57972871fbf5b8c64f6ac2d221085d0c8719cd414f6c4"}},{"ruleId":"D1","level":"warning","message":{"text":"builtinBenchmarkSig.vecEvalInt (cyclomatic 23): builtinBenchmarkSig.vecEvalInt 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":"pkg/expression/builtin_info_vec.go"},"region":{"startLine":267}}}],"partialFingerprints":{"codehealthFindingId/v1":"7a58b26e4ba720d1a5b0c492c00a732b90bda691ba5a437b473864c3fb59c4f6"}},{"ruleId":"D1","level":"warning","message":{"text":"Loader.LoadWithTS (cyclomatic 23): Loader.LoadWithTS has cyclomatic complexity 23 (threshold 15). Of this number, 22 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":"pkg/infoschema/issyncer/loader.go"},"region":{"startLine":145}}}],"partialFingerprints":{"codehealthFindingId/v1":"a5f27457ee9ed9659a5d61415f1d6fa5a2a6e481095e43521fde66f2726140ff"}},{"ruleId":"D1","level":"warning","message":{"text":"core.preferIndexJoinFamily (cyclomatic 23): core.preferIndexJoinFamily has cyclomatic complexity 23 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/exhaust_physical_plans.go"},"region":{"startLine":1695}}}],"partialFingerprints":{"codehealthFindingId/v1":"97a9a45d06c57f0d5fa4576cd5ea5cbeeb1c3456582bb2ec7bed270d2638b3f5"}},{"ruleId":"D1","level":"warning","message":{"text":"core.checkColFuncDepend (cyclomatic 23): core.checkColFuncDepend 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":"pkg/planner/core/logical_plan_builder.go"},"region":{"startLine":3580}}}],"partialFingerprints":{"codehealthFindingId/v1":"7889f3217d306aab1e9ff75f819564fff33af3e40ab6bf4a1e30c67ed6e2de6a"}},{"ruleId":"D1","level":"warning","message":{"text":"expressionRewriter.toColumn (cyclomatic 23): expressionRewriter.toColumn 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":"pkg/planner/core/expression_rewriter.go"},"region":{"startLine":3083}}}],"partialFingerprints":{"codehealthFindingId/v1":"65d99237abe21d3f6510ed7dbe610717048bd9498ba7819178ad24969f4e0ae9"}},{"ruleId":"D1","level":"warning","message":{"text":"DataSource.HandleColsToAppend (cyclomatic 23): DataSource.HandleColsToAppend 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":"pkg/planner/core/operator/logicalop/logical_datasource.go"},"region":{"startLine":632}}}],"partialFingerprints":{"codehealthFindingId/v1":"26bdcfc6bf35a99e4c7aec24d56a1a0a16114d1cb45ab03c3b5ebe5ad28d9eef"}},{"ruleId":"D1","level":"warning","message":{"text":"physicalop.tryToGetMppWindows (cyclomatic 23): physicalop.tryToGetMppWindows 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":"pkg/planner/core/operator/physicalop/physical_window.go"},"region":{"startLine":340}}}],"partialFingerprints":{"codehealthFindingId/v1":"3477319f090018c25a2ae7b93425b35af887b9012edb817c87176a19ebba970b"}},{"ruleId":"D1","level":"warning","message":{"text":"PlanBuilder.buildSetOpr (cyclomatic 23): PlanBuilder.buildSetOpr 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":"pkg/planner/core/logical_plan_builder.go"},"region":{"startLine":2114}}}],"partialFingerprints":{"codehealthFindingId/v1":"d87b4ed94c904c6284c0d3297e632d3c8b4e2341e61095370b84312b54f6c85d"}},{"ruleId":"D1","level":"warning","message":{"text":"rule.rewriteJoinEqConds (cyclomatic 23): rule.rewriteJoinEqConds 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":"pkg/planner/core/rule/rule_join_key_type_cast.go"},"region":{"startLine":99}}}],"partialFingerprints":{"codehealthFindingId/v1":"9df418e1ca24bc773383b01e27a20c4767a8871afb422e4c6044e995744c5785"}},{"ruleId":"D1","level":"warning","message":{"text":"JoinReOrderSolver.optimizeRecursive (cyclomatic 23): JoinReOrderSolver.optimizeRecursive has cyclomatic complexity 23 (threshold 15). Of this number, 22 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":"pkg/planner/core/rule_join_reorder.go"},"region":{"startLine":326}}}],"partialFingerprints":{"codehealthFindingId/v1":"76056dfa53b44ff492b15101b6b6a13e4afdc25cb480e1135ed95d8b6fc46fad"}},{"ruleId":"D1","level":"warning","message":{"text":"clientConn.handleQuery (cyclomatic 23): clientConn.handleQuery 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":"pkg/server/conn.go"},"region":{"startLine":1857}}}],"partialFingerprints":{"codehealthFindingId/v1":"f0b95b3b0ea3a5150dbe9173f59efb1cf0bb68110acd85cc47207fe46cac1a04"}},{"ruleId":"D1","level":"warning","message":{"text":"session.EncodeStates (cyclomatic 23): session.EncodeStates 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":"pkg/session/session.go"},"region":{"startLine":5622}}}],"partialFingerprints":{"codehealthFindingId/v1":"e2ef5b7b0cf43d1f2230a2da23fb5afe7e1f5e9a1e7dde241d81eaefbdb3e646"}},{"ruleId":"D1","level":"warning","message":{"text":"storage.indexStatsFromStorage (cyclomatic 23): storage.indexStatsFromStorage 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":"pkg/statistics/handle/storage/read.go"},"region":{"startLine":247}}}],"partialFingerprints":{"codehealthFindingId/v1":"9b55d8a67e1638a76cc5da9d31aa467ea9cbba697a8c95ab9deee08bc054cc62"}},{"ruleId":"D1","level":"warning","message":{"text":"types.getValidFloatPrefix (cyclomatic 23): types.getValidFloatPrefix 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":"pkg/types/convert.go"},"region":{"startLine":703}}}],"partialFingerprints":{"codehealthFindingId/v1":"2ff7d2e62b2484fb46effea13ceb835deeea8ec59c69155661c4d8127a891bcd"}},{"ruleId":"D1","level":"warning","message":{"text":"Datum.Compare (cyclomatic 23): Datum.Compare has cyclomatic complexity 23 (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/types/datum.go"},"region":{"startLine":738}}}],"partialFingerprints":{"codehealthFindingId/v1":"9e292550b56a1a9adb218973f3154504576917ad78ab1d4ba9a687bdf47fa4ec"}},{"ruleId":"D1","level":"warning","message":{"text":"MyDecimal.Shift (cyclomatic 23): MyDecimal.Shift 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":"pkg/types/mydecimal.go"},"region":{"startLine":555}}}],"partialFingerprints":{"codehealthFindingId/v1":"6e4bf3a66de32df1a2ca762841992623cb55ce7c23ff1925dcbd8d473153caa1"}},{"ruleId":"D1","level":"warning","message":{"text":"codec.EncodeHashChunkRowIdx (cyclomatic 23): codec.EncodeHashChunkRowIdx 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":"pkg/util/codec/codec.go"},"region":{"startLine":346}}}],"partialFingerprints":{"codehealthFindingId/v1":"3edbbc16e776c5979878d9a7e668c21e04feab0927e8c9c1f95142706ad112ce"}},{"ruleId":"D1","level":"warning","message":{"text":"cet.getImplicitWeight0900 (cyclomatic 23): cet.getImplicitWeight0900 has cyclomatic complexity 23 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/util/collate/ucadata/generator/main.go"},"region":{"startLine":309}}}],"partialFingerprints":{"codehealthFindingId/v1":"45bead0754d251e9136c3d1920699808324730c389ce4f60f37700f5935f667a"}},{"ruleId":"D1","level":"warning","message":{"text":"Handle.Run (cyclomatic 23): Handle.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":"pkg/util/expensivequery/expensivequery.go"},"region":{"startLine":51}}}],"partialFingerprints":{"codehealthFindingId/v1":"25d5f92e3c559edab06c745b1695def3c976c3e86cccebb1a3c6214869522311"}},{"ruleId":"D1","level":"warning","message":{"text":"indentFormatter.format (cyclomatic 23): indentFormatter.format has cyclomatic complexity 23 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/util/format/format.go"},"region":{"startLine":86}}}],"partialFingerprints":{"codehealthFindingId/v1":"93c46ce2065b0ca5476c7dd39020bb394534fc908d50cbe5bbae3f5186dc6dff"}},{"ruleId":"D1","level":"warning","message":{"text":"workloadlearning.extractMetricsFromOperatorTree (cyclomatic 23): workloadlearning.extractMetricsFromOperatorTree 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":"pkg/workloadlearning/handle.go"},"region":{"startLine":414}}}],"partialFingerprints":{"codehealthFindingId/v1":"a6cff74624099e39eebb9c38d72079ad4328234dc3c0bed6ea9214ca9f02e4af"}},{"ruleId":"D1","level":"warning","message":{"text":"UpdateStmt.Restore (cyclomatic 23): UpdateStmt.Restore 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":"pkg/parser/ast/dml.go"},"region":{"startLine":2960}}}],"partialFingerprints":{"codehealthFindingId/v1":"9f3c3004b2522801b5499ee9cb52230499a21a11407c9ed1f00d3526f4255fa4"}},{"ruleId":"D1","level":"warning","message":{"text":"indentFormatter.format (cyclomatic 23): indentFormatter.format has cyclomatic complexity 23 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/parser/format/format.go"},"region":{"startLine":86}}}],"partialFingerprints":{"codehealthFindingId/v1":"126f2d630baa6ca6a9d05e172ddb119eb82470ab8df906ec4021ac4e439b418e"}},{"ruleId":"D1","level":"warning","message":{"text":"backup.BuildBackupSchemas (cyclomatic 22): backup.BuildBackupSchemas has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 9 of the 22 points are its own statements and the rest belongs to one function literal inside it that branches (line 875). 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":"br/pkg/backup/client.go"},"region":{"startLine":847}}}],"partialFingerprints":{"codehealthFindingId/v1":"d6c04e52dcc026b54f71a587e276deb123e8eb445f9f46530d12d24f1e713ee2"}},{"ruleId":"D1","level":"warning","message":{"text":"LogClient.RefreshMetaForTables (cyclomatic 22): LogClient.RefreshMetaForTables has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"br/pkg/restore/log_client/client.go"},"region":{"startLine":2539}}}],"partialFingerprints":{"codehealthFindingId/v1":"1fa6765bfd1bd1005d22d69057b7b4188aba807869480c934ca76c2a62a72e27"}},{"ruleId":"D1","level":"warning","message":{"text":"TableMappingManager.ParseMetaKvAndUpdateIdMapping (cyclomatic 22): TableMappingManager.ParseMetaKvAndUpdateIdMapping has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"br/pkg/stream/table_mapping.go"},"region":{"startLine":159}}}],"partialFingerprints":{"codehealthFindingId/v1":"82bf44d9693e3433362c10da31526393cd6ae04ffeb2e9b383dd43e8f10bcbee"}},{"ruleId":"D1","level":"warning","message":{"text":"TableMappingManager.MergeBaseDBReplace (cyclomatic 22): TableMappingManager.MergeBaseDBReplace has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"br/pkg/stream/table_mapping.go"},"region":{"startLine":573}}}],"partialFingerprints":{"codehealthFindingId/v1":"2df831d77d2c5a5f76ddc85f592595db4ed42b78fe16d245848e68c2c5a45fea"}},{"ruleId":"D1","level":"warning","message":{"text":"task.buildKeyRangesFromSchemasReplace (cyclomatic 22): task.buildKeyRangesFromSchemasReplace has cyclomatic complexity 22 (threshold 15). Of this number, 19 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":"br/pkg/task/stream.go"},"region":{"startLine":2595}}}],"partialFingerprints":{"codehealthFindingId/v1":"2e7a1fccf700e965c2c6c2cd0bfd081a5812fc8c3723feadc3fb4536986984fa"}},{"ruleId":"D1","level":"warning","message":{"text":"export.WriteInsert (cyclomatic 22): export.WriteInsert 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":"dumpling/export/writer_util.go"},"region":{"startLine":150}}}],"partialFingerprints":{"codehealthFindingId/v1":"495a953904212c922358035cc41503cd8dc3ea55095aa104521f76ed59ba4bbf"}},{"ruleId":"D1","level":"warning","message":{"text":"main.run (cyclomatic 22): main.run has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lightning/cmd/tidb-lightning-ctl/main.go"},"region":{"startLine":57}}}],"partialFingerprints":{"codehealthFindingId/v1":"72d1836c2444f64c59ecc00fcf95163365d8a21db8f4137565c16ee46de0fc5b"}},{"ruleId":"D1","level":"warning","message":{"text":"Controller.listenCheckpointUpdates (cyclomatic 22): Controller.listenCheckpointUpdates has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 5 of the 22 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 980, 969, 908, \u2026). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals\u0027 work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lightning/pkg/importer/import.go"},"region":{"startLine":900}}}],"partialFingerprints":{"codehealthFindingId/v1":"4ff88a96e301595bb1888b0a1680ad1f5115dcf757e7e6c280d9e575dd21a079"}},{"ruleId":"D1","level":"warning","message":{"text":"dbTaskMetaMgr.CheckAndPausePdSchedulers (cyclomatic 22): dbTaskMetaMgr.CheckAndPausePdSchedulers has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 7 of the 22 points are its own statements and the rest belongs to one function literal inside it that branches (line 770). 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":"lightning/pkg/importer/meta_manager.go"},"region":{"startLine":748}}}],"partialFingerprints":{"codehealthFindingId/v1":"57cfed9154f4d1f918e322fb50a5554f05a2b5ca1827ae43a9f7064621839ae1"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.convertReorgPartitionJob2RollbackJob (cyclomatic 22): ddl.convertReorgPartitionJob2RollbackJob has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/rollingback.go"},"region":{"startLine":405}}}],"partialFingerprints":{"codehealthFindingId/v1":"1b79cb2fc7e1e264b89344aeade691897b98ea72848c65245421be05fbe4c754"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.normalizeSplitPolicy (cyclomatic 22): ddl.normalizeSplitPolicy has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/split_region.go"},"region":{"startLine":344}}}],"partialFingerprints":{"codehealthFindingId/v1":"6aceb93a40f65d1d3e9f64c42b0a146da44a3a0a67df7ceed653e6f4c027d76f"}},{"ruleId":"D1","level":"warning","message":{"text":"runningJobs.checkRunnable (cyclomatic 22): runningJobs.checkRunnable has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/ddl_running_jobs.go"},"region":{"startLine":87}}}],"partialFingerprints":{"codehealthFindingId/v1":"0331277a3588768c0bc4796bcc3b6b93091e1ad4b141e6f9e050478661933132"}},{"ruleId":"D1","level":"warning","message":{"text":"executor.AddTablePartitions (cyclomatic 22): executor.AddTablePartitions has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/executor.go"},"region":{"startLine":2285}}}],"partialFingerprints":{"codehealthFindingId/v1":"018e2397cb62560d9d03de27edb14e8825426822c7df8aebd493c0f124736c7e"}},{"ruleId":"D1","level":"warning","message":{"text":"executor.checkHistoryJobInTest (cyclomatic 22): executor.checkHistoryJobInTest has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/sanity_check.go"},"region":{"startLine":195}}}],"partialFingerprints":{"codehealthFindingId/v1":"92570c3691a319e734b1a7daf17fc499629ff87701162c6a3185b283af6f36ce"}},{"ruleId":"D1","level":"warning","message":{"text":"worker.onDropTableOrView (cyclomatic 22): worker.onDropTableOrView has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/table.go"},"region":{"startLine":62}}}],"partialFingerprints":{"codehealthFindingId/v1":"5b0200c27c38fa22f4713451199a7fdf324757b930dc5dff9610da743bfad290"}},{"ruleId":"D1","level":"warning","message":{"text":"placement.NewBundleFromSugarOptions (cyclomatic 22): placement.NewBundleFromSugarOptions has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/placement/bundle.go"},"region":{"startLine":164}}}],"partialFingerprints":{"codehealthFindingId/v1":"cf66113f421b62df15cb9fe2b546dae81845a77f8aa49de10cf35c10008c48fc"}},{"ruleId":"D1","level":"warning","message":{"text":"BaseScheduler.scheduleTask (cyclomatic 22): BaseScheduler.scheduleTask has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/dxf/framework/scheduler/scheduler.go"},"region":{"startLine":180}}}],"partialFingerprints":{"codehealthFindingId/v1":"0529d97349985bdf483825d95a30033cbaf287b277d1f161269a7a465c744b40"}},{"ruleId":"D1","level":"warning","message":{"text":"executor.getColumnValueFactoryByName (cyclomatic 22): executor.getColumnValueFactoryByName has cyclomatic complexity 22 (threshold 15). Of this number, 11 points are the body\u0027s own statements and 11 belong to 8 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":"pkg/executor/slow_query.go"},"region":{"startLine":1080}}}],"partialFingerprints":{"codehealthFindingId/v1":"e932981455634273c2f5cacb2bd61f7025a844b5f263b2d3eba022019c17f9da"}},{"ruleId":"D1","level":"warning","message":{"text":"executorBuilder.buildBatchPointGet (cyclomatic 22): executorBuilder.buildBatchPointGet has cyclomatic complexity 22 (threshold 15). Of this number, 20 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, 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":"pkg/executor/builder.go"},"region":{"startLine":5727}}}],"partialFingerprints":{"codehealthFindingId/v1":"c4c26fa54a47e56574d0af6afeea34b586940b5c884f6376b042bcb96edf908c"}},{"ruleId":"D1","level":"warning","message":{"text":"Compiler.Compile (cyclomatic 22): Compiler.Compile has cyclomatic complexity 22 (threshold 15). Of this number, 15 points are the body\u0027s own statements and 7 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/compiler.go"},"region":{"startLine":50}}}],"partialFingerprints":{"codehealthFindingId/v1":"5d093aaaabfd615c675db5aced0f5868dde39965defc694dc065e411294b2db6"}},{"ruleId":"D1","level":"warning","message":{"text":"InsertValues.fillRow (cyclomatic 22): InsertValues.fillRow has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/insert_common.go"},"region":{"startLine":705}}}],"partialFingerprints":{"codehealthFindingId/v1":"c1e2826c73fc5d16ec2d5a01f16715cd4d44a1dd21a603f93e31d699ed895491"}},{"ruleId":"D1","level":"warning","message":{"text":"InsertValues.lazyAdjustAutoIncrementDatum (cyclomatic 22): InsertValues.lazyAdjustAutoIncrementDatum has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/insert_common.go"},"region":{"startLine":869}}}],"partialFingerprints":{"codehealthFindingId/v1":"887ab794590919e61b6b6b9d4096a6d80e9194e2e444c132d4d9121381af2ea1"}},{"ruleId":"D1","level":"warning","message":{"text":"inspectionSummaryRetriever.retrieve (cyclomatic 22): inspectionSummaryRetriever.retrieve has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/inspection_summary.go"},"region":{"startLine":412}}}],"partialFingerprints":{"codehealthFindingId/v1":"5d64395ffa4d62d95cba3e9d29d7f46ed78a737b7fe41b8b7f5aa6cf8070b3af"}},{"ruleId":"D1","level":"warning","message":{"text":"Executor.parseCalibrateDuration (cyclomatic 22): Executor.parseCalibrateDuration has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/internal/calibrateresource/calibrate_resource.go"},"region":{"startLine":148}}}],"partialFingerprints":{"codehealthFindingId/v1":"de113ad47d728545a1851242aab9da029b31ef3fe33da1c81c01a3937fa6007c"}},{"ruleId":"D1","level":"warning","message":{"text":"baseJoinProbe.appendBuildRowToChunkInternal (cyclomatic 22): baseJoinProbe.appendBuildRowToChunkInternal has cyclomatic complexity 22 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/join/base_join_probe.go"},"region":{"startLine":589}}}],"partialFingerprints":{"codehealthFindingId/v1":"2e006e6dcc42aebcb8598317842ca8d54ffc1a4526c0c3bb8be7d3319c1cc0ad"}},{"ruleId":"D1","level":"warning","message":{"text":"ProbeWorkerV1.join2Chunk (cyclomatic 22): ProbeWorkerV1.join2Chunk 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":"pkg/executor/join/hash_join_v1.go"},"region":{"startLine":841}}}],"partialFingerprints":{"codehealthFindingId/v1":"76244e24ff84cbef2cc630fd95a3c5cadf756b0c59083ca296cfef1b51016484"}},{"ruleId":"D1","level":"warning","message":{"text":"UpdateExec.updateRows (cyclomatic 22): UpdateExec.updateRows has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/update.go"},"region":{"startLine":392}}}],"partialFingerprints":{"codehealthFindingId/v1":"a7a979469c78b599078c1ba36ba67ca67940976dad8e0708abdf13402a59bc9c"}},{"ruleId":"D1","level":"warning","message":{"text":"PipelinedWindowExec.produce (cyclomatic 22): PipelinedWindowExec.produce has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/windows/pipelined_window.go"},"region":{"startLine":343}}}],"partialFingerprints":{"codehealthFindingId/v1":"99ab3e5418d6ea921aa2c8ddc78d202485125806c6f466a9aac6a0d293144a59"}},{"ruleId":"D1","level":"warning","message":{"text":"aggregation.NewDistAggFunc (cyclomatic 22): aggregation.NewDistAggFunc has cyclomatic complexity 22 (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/expression/aggregation/aggregation.go"},"region":{"startLine":52}}}],"partialFingerprints":{"codehealthFindingId/v1":"6514e7390265655abe1ae178382d993c99a68ae0ad9cde65234e82a99a45832d"}},{"ruleId":"D1","level":"warning","message":{"text":"expression.GetTimeValue (cyclomatic 22): expression.GetTimeValue has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/helper.go"},"region":{"startLine":90}}}],"partialFingerprints":{"codehealthFindingId/v1":"7a2c5dd726085c7a2a3e3570cbb5692db583cfdd7cf2d4df7195b458b728bae7"}},{"ruleId":"D1","level":"warning","message":{"text":"expression.eliminateCastFunction (cyclomatic 22): expression.eliminateCastFunction has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/util.go"},"region":{"startLine":993}}}],"partialFingerprints":{"codehealthFindingId/v1":"5ea9298fe914810341525a543c97b910fedaba7561523e50fddaf47a3af564c9"}},{"ruleId":"D1","level":"warning","message":{"text":"Column.Equals (cyclomatic 22): Column.Equals has cyclomatic complexity 22 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/column.go"},"region":{"startLine":545}}}],"partialFingerprints":{"codehealthFindingId/v1":"3c1840ecc50f693ec5ddd636fb4ad6a80979df8ba680e5274202ff9abbb5f7ef"}},{"ruleId":"D1","level":"warning","message":{"text":"infoschema.applyCreateTable (cyclomatic 22): infoschema.applyCreateTable has cyclomatic complexity 22 (threshold 15). 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: 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":"pkg/infoschema/builder.go"},"region":{"startLine":840}}}],"partialFingerprints":{"codehealthFindingId/v1":"9d6acb8927a46c66e2c59b36034719f7e4f7671027a7df2eb7c9a0c241c17b76"}},{"ruleId":"D1","level":"warning","message":{"text":"simplesst.newMergePropBaseIter (cyclomatic 22): simplesst.newMergePropBaseIter has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 5 of the 22 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 664, 723, 713). 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":"pkg/ingestor/simplesst/iter.go"},"region":{"startLine":630}}}],"partialFingerprints":{"codehealthFindingId/v1":"db4b6043f31a0a4fbefe493e12f2370fe47ba83bee2dc1b38250b98ddc2e6032"}},{"ruleId":"D1","level":"warning","message":{"text":"common.isSingleRetryableError (cyclomatic 22): common.isSingleRetryableError has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/lightning/common/retry.go"},"region":{"startLine":146}}}],"partialFingerprints":{"codehealthFindingId/v1":"a89a1b6aecf06cd05ce60c28e1dab5854ea3e1c9e916210d7ddcec4831933744"}},{"ruleId":"D1","level":"warning","message":{"text":"TikvImporter.adjust (cyclomatic 22): TikvImporter.adjust has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/lightning/config/config.go"},"region":{"startLine":1142}}}],"partialFingerprints":{"codehealthFindingId/v1":"2956ad1e816937e8c1f0239bfd77746aff1ebbc0a44cce7d3cfd4e62f5d4b839"}},{"ruleId":"D1","level":"warning","message":{"text":"worker.runTask (cyclomatic 22): worker.runTask 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":"pkg/lightning/duplicate/worker.go"},"region":{"startLine":59}}}],"partialFingerprints":{"codehealthFindingId/v1":"468916837a6bcba8c431b8e23cca72a047ffa813ee107210b02111876491b47b"}},{"ruleId":"D1","level":"warning","message":{"text":"regexRouterParser.Parse (cyclomatic 22): regexRouterParser.Parse has cyclomatic complexity 22 (threshold 15). Of this number, 16 points are the body\u0027s own statements and 6 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":"pkg/lightning/mydump/router.go"},"region":{"startLine":275}}}],"partialFingerprints":{"codehealthFindingId/v1":"56e3cd717158e8904bd060045f035f16ef2f57d42933d33d1f87df55dd593c04"}},{"ruleId":"D1","level":"warning","message":{"text":"LocalStorage.WalkDir (cyclomatic 22): LocalStorage.WalkDir has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 2 of the 22 points are its own statements and the rest belongs to one function literal inside it that branches (line 141). 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":"pkg/objstore/local.go"},"region":{"startLine":136}}}],"partialFingerprints":{"codehealthFindingId/v1":"87e0847759c73e77b191838c138e813344731a1e2282d69d9eae5807953a937d"}},{"ruleId":"D1","level":"warning","message":{"text":"core.generateANDIndexMerge4ComposedIndex (cyclomatic 22): core.generateANDIndexMerge4ComposedIndex has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/indexmerge_path.go"},"region":{"startLine":627}}}],"partialFingerprints":{"codehealthFindingId/v1":"45993cc2b2fbd5632500a74b1eb6ed78a602f4a28091501c269bc97be49f916c"}},{"ruleId":"D1","level":"warning","message":{"text":"core.buildRangesForPointGet (cyclomatic 22): core.buildRangesForPointGet has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/plan_cache_rebuild.go"},"region":{"startLine":256}}}],"partialFingerprints":{"codehealthFindingId/v1":"af489b0214960e421cc1951b7d36c9083ee7b44cf695111378ed29449f149b97"}},{"ruleId":"D1","level":"warning","message":{"text":"core.isPhysicalPlanCacheable (cyclomatic 22): core.isPhysicalPlanCacheable has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/plan_cacheable_checker.go"},"region":{"startLine":595}}}],"partialFingerprints":{"codehealthFindingId/v1":"5a7fac9e4cf2fd87fc4b35ffe6f4920c69603f7fe62f3e3793274fe8408d9ec2"}},{"ruleId":"D1","level":"warning","message":{"text":"core.deriveTablePathStats (cyclomatic 22): core.deriveTablePathStats has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/stats.go"},"region":{"startLine":294}}}],"partialFingerprints":{"codehealthFindingId/v1":"30a60ad97c9336cd9d6eda54bedac2c73fa766493a03b4a46bcb5c7c0b9c1a9f"}},{"ruleId":"D1","level":"warning","message":{"text":"core.needConvert (cyclomatic 22): core.needConvert has cyclomatic complexity 22 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/task.go"},"region":{"startLine":250}}}],"partialFingerprints":{"codehealthFindingId/v1":"83d10316664346467298fc73571bb833bc650be3d6f93f2ee1a325f1ca8dc066"}},{"ruleId":"D1","level":"warning","message":{"text":"core.attach2TaskForMpp4PhysicalHashJoin (cyclomatic 22): core.attach2TaskForMpp4PhysicalHashJoin has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/task.go"},"region":{"startLine":432}}}],"partialFingerprints":{"codehealthFindingId/v1":"0fdf7a05c66d669deb985b243efe4e56a4ffdb14af5f846aec4163451bdc3fb1"}},{"ruleId":"D1","level":"warning","message":{"text":"tidbCodecFuncHelper.decodeRecordKey (cyclomatic 22): tidbCodecFuncHelper.decodeRecordKey has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/expression_codec_fn.go"},"region":{"startLine":291}}}],"partialFingerprints":{"codehealthFindingId/v1":"a3efc94550d02b64f8876c49d37b2e94345add292a0ad6634fe8517fc5d4af37"}},{"ruleId":"D1","level":"warning","message":{"text":"expressionRewriter.inToExpression (cyclomatic 22): expressionRewriter.inToExpression has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/expression_rewriter.go"},"region":{"startLine":2183}}}],"partialFingerprints":{"codehealthFindingId/v1":"47edb730194485c62e254ff3ef86c59c8cc6328267515df71c94ff555cc877e1"}},{"ruleId":"D1","level":"warning","message":{"text":"expressionRewriter.rewriteFuncCall (cyclomatic 22): expressionRewriter.rewriteFuncCall has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/expression_rewriter.go"},"region":{"startLine":2845}}}],"partialFingerprints":{"codehealthFindingId/v1":"ede8069f5d77f457ca9d7c98bd4fd9c25754bba2e6edc37979ac27d57bb0cd79"}},{"ruleId":"D1","level":"warning","message":{"text":"LogicalJoin.ExtractFDForOuterJoin (cyclomatic 22): LogicalJoin.ExtractFDForOuterJoin has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/operator/logicalop/logical_join.go"},"region":{"startLine":857}}}],"partialFingerprints":{"codehealthFindingId/v1":"90c7774d384b2880ca0d2c2682759d33e483903d7c535af67922c7e21684d051"}},{"ruleId":"D1","level":"warning","message":{"text":"PhysicalHashJoin.explainInfo (cyclomatic 22): PhysicalHashJoin.explainInfo has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/operator/physicalop/physical_hash_join.go"},"region":{"startLine":221}}}],"partialFingerprints":{"codehealthFindingId/v1":"875b7b366aeda1fc49d4f96712f7177d5f2c6adf734c92dda959671fc7c93cc0"}},{"ruleId":"D1","level":"warning","message":{"text":"PlanBuilder.checkOnlyFullGroupByWithGroupClause (cyclomatic 22): PlanBuilder.checkOnlyFullGroupByWithGroupClause has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/logical_plan_builder.go"},"region":{"startLine":3787}}}],"partialFingerprints":{"codehealthFindingId/v1":"3f9353ce36c2c4dd78d3e8d179b65e8d9ab98e71b94462ee1f1352e41b67ab91"}},{"ruleId":"D1","level":"warning","message":{"text":"PlanBuilder.tryBuildCTE (cyclomatic 22): PlanBuilder.tryBuildCTE has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/logical_plan_builder.go"},"region":{"startLine":4742}}}],"partialFingerprints":{"codehealthFindingId/v1":"b8f882f924e777d6274cf1d793977ebb88dc89e410242e0215d84230845103f9"}},{"ruleId":"D1","level":"warning","message":{"text":"PlanBuilder.buildWindowFunctionFrameBound (cyclomatic 22): PlanBuilder.buildWindowFunctionFrameBound has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/logical_plan_builder.go"},"region":{"startLine":6872}}}],"partialFingerprints":{"codehealthFindingId/v1":"306baa6f9bd5c30341069ad93ef0a0872ba973343d7cbfada0cb1caaec92cebe"}},{"ruleId":"D1","level":"warning","message":{"text":"rule.MakePartitionByFnCol (cyclomatic 22): rule.MakePartitionByFnCol has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/rule/rule_partition_processor.go"},"region":{"startLine":1106}}}],"partialFingerprints":{"codehealthFindingId/v1":"2eb30d855ea3d8712b75b1bd2fd07a2d83f22d99401c0cf5d90332f18e2c4069"}},{"ruleId":"D1","level":"warning","message":{"text":"rule.scoreIndexPath (cyclomatic 22): rule.scoreIndexPath has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/rule/rule_prune_indexes.go"},"region":{"startLine":459}}}],"partialFingerprints":{"codehealthFindingId/v1":"0131b909bf0830c1bef7ed13b587d78147d07a04e68ac91625ae8fa8be894e75"}},{"ruleId":"D1","level":"warning","message":{"text":"RangePruner.extractDataForPrune (cyclomatic 22): RangePruner.extractDataForPrune has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/rule/rule_partition_processor.go"},"region":{"startLine":1577}}}],"partialFingerprints":{"codehealthFindingId/v1":"0e554a709391d27d89b4b7bd546ea9678ff1ef0d602a8ff1a8f0425e67db5843"}},{"ruleId":"D1","level":"warning","message":{"text":"privileges.compareHost (cyclomatic 22): privileges.compareHost has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/privilege/privileges/cache.go"},"region":{"startLine":768}}}],"partialFingerprints":{"codehealthFindingId/v1":"bfce09740d098650645af7880302fcdc771b706ef2a69c598ccb4759b78303a1"}},{"ruleId":"D1","level":"warning","message":{"text":"server.parseBinaryParams (cyclomatic 22): server.parseBinaryParams has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/server/conn_stmt_params.go"},"region":{"startLine":38}}}],"partialFingerprints":{"codehealthFindingId/v1":"2cc53e11e1ee174ac73e71e2e979a7c5b6bd170ea493d5954442d23c2960440e"}},{"ruleId":"D1","level":"warning","message":{"text":"clientConn.writeChunks (cyclomatic 22): clientConn.writeChunks has cyclomatic complexity 22 (threshold 15). Of this number, 13 points are the body\u0027s own statements and 9 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":"pkg/server/conn.go"},"region":{"startLine":2531}}}],"partialFingerprints":{"codehealthFindingId/v1":"8dfe3333adab94a3395ffd56dca78a8e99935e6a73f8b0489f294c33ec801dd9"}},{"ruleId":"D1","level":"warning","message":{"text":"AnalysisPriorityQueue.fetchAllTablesAndBuildAnalysisJobs (cyclomatic 22): AnalysisPriorityQueue.fetchAllTablesAndBuildAnalysisJobs has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 1 of the 22 points is its own statement and the rest belongs to one function literal inside it that branches (line 529). 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":"pkg/statistics/handle/autoanalyze/priorityqueue/queue.go"},"region":{"startLine":528}}}],"partialFingerprints":{"codehealthFindingId/v1":"1a46de7de65ae78fb5c7871e915a462a4d6732f1f6069873961fc37d89def62f"}},{"ruleId":"D1","level":"warning","message":{"text":"copr.buildExceedsBoundDiagFields (cyclomatic 22): copr.buildExceedsBoundDiagFields has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/store/copr/coprocessor.go"},"region":{"startLine":2005}}}],"partialFingerprints":{"codehealthFindingId/v1":"ff7fac7161fb4137c7377a7a97e6fd12fe60a5e807c865c83d8e024d499084ce"}},{"ruleId":"D1","level":"warning","message":{"text":"gcworker.doGCPlacementRules (cyclomatic 22): gcworker.doGCPlacementRules has cyclomatic complexity 22 (threshold 15). Of this number, 20 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/store/gcworker/gc_worker.go"},"region":{"startLine":1665}}}],"partialFingerprints":{"codehealthFindingId/v1":"a5c5232e945324e03e1e5aef15149ac63d6378f2ea6a2150040e4e6b2f04bff7"}},{"ruleId":"D1","level":"warning","message":{"text":"Datum.convertToString (cyclomatic 22): Datum.convertToString has cyclomatic complexity 22 (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/types/datum.go"},"region":{"startLine":1150}}}],"partialFingerprints":{"codehealthFindingId/v1":"380d83576976e9c21470076f783b76d1dc68e51ecaef2faf2878f328a384d55e"}},{"ruleId":"D1","level":"warning","message":{"text":"plancodec.decodeBinaryOperator (cyclomatic 22): plancodec.decodeBinaryOperator has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/util/plancodec/binary_plan_decode.go"},"region":{"startLine":203}}}],"partialFingerprints":{"codehealthFindingId/v1":"5f24e325853db6c16f2050e5e4894fd62958d671d38cb84bb2dd59b94af12ed0"}},{"ruleId":"D1","level":"warning","message":{"text":"PartitionOptions.Validate (cyclomatic 22): PartitionOptions.Validate has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/parser/ast/ddl.go"},"region":{"startLine":4877}}}],"partialFingerprints":{"codehealthFindingId/v1":"937c386b48661f68f9cedd6dc9d494d2a6a373e8ca474416dc62338e2e2716af"}},{"ruleId":"D1","level":"warning","message":{"text":"ValueExpr.Restore (cyclomatic 22): ValueExpr.Restore has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/parser/test_driver/test_driver.go"},"region":{"startLine":60}}}],"partialFingerprints":{"codehealthFindingId/v1":"93c29d265a3eef319b4e2919b1a72859de614fd74ab1c11874055aa935254d86"}},{"ruleId":"D1","level":"warning","message":{"text":"LogClient.generateRepairIngestIndexSQLs (cyclomatic 21): LogClient.generateRepairIngestIndexSQLs has cyclomatic complexity 21 (threshold 15). Of this number, 11 points are the body\u0027s own statements and 10 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":"br/pkg/restore/log_client/client.go"},"region":{"startLine":1948}}}],"partialFingerprints":{"codehealthFindingId/v1":"06b8b8b4141d59553479afb785b78af4e7e7351fffa590cf655ab764d29c14f4"}},{"ruleId":"D1","level":"warning","message":{"text":"TableMappingManager.ReplaceTemporaryIDs (cyclomatic 21): TableMappingManager.ReplaceTemporaryIDs has cyclomatic complexity 21 (threshold 15). Of this number, 18 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":"br/pkg/stream/table_mapping.go"},"region":{"startLine":654}}}],"partialFingerprints":{"codehealthFindingId/v1":"daa82d4d5b27319e5d2acc1d0f1774f900edba525eda0af8c19e507fb30e1af5"}},{"ruleId":"D1","level":"warning","message":{"text":"MetaDataClient.waitCheckpointEvent (cyclomatic 21): MetaDataClient.waitCheckpointEvent has cyclomatic complexity 21 (threshold 15). Of this number, 20 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":"br/pkg/streamhelper/advancer_cliext.go"},"region":{"startLine":413}}}],"partialFingerprints":{"codehealthFindingId/v1":"195cc01a7e5b7bdc5a7211be1ca85fc5c2790b222437ab5b18d51af0e4483fc7"}},{"ruleId":"D1","level":"warning","message":{"text":"Config.adjustSecurityConfig (cyclomatic 21): Config.adjustSecurityConfig 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":"pkg/config/config.go"},"region":{"startLine":1521}}}],"partialFingerprints":{"codehealthFindingId/v1":"efd9558f97ef345c45fb26374f502514c4fff8842a901508e57791ccfa6b72e1"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.generateOriginDefaultValue (cyclomatic 21): ddl.generateOriginDefaultValue 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":"pkg/ddl/column.go"},"region":{"startLine":1281}}}],"partialFingerprints":{"codehealthFindingId/v1":"5f01ac245b27680b0ed6d0fb006932dd62fddd3dc191530410f2a7babff04bd9"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.writeChunk (cyclomatic 21): ddl.writeChunk has cyclomatic complexity 21 (threshold 15). Of this number, 20 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":"pkg/ddl/index.go"},"region":{"startLine":2705}}}],"partialFingerprints":{"codehealthFindingId/v1":"c3d8591b7c666f320f8b2aef3fa7129f0a41a90dc788a6b73e38943bbdfcb7a0"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.fillMultiSchemaInfo (cyclomatic 21): ddl.fillMultiSchemaInfo has cyclomatic complexity 21 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/multi_schema_change.go"},"region":{"startLine":259}}}],"partialFingerprints":{"codehealthFindingId/v1":"d0f7dc3035c277abc8d375d9dafe7a8198fda2b72fc4687a3aacf77c70f75245"}},{"ruleId":"D1","level":"warning","message":{"text":"worker.analyzeTableInner (cyclomatic 21): worker.analyzeTableInner has cyclomatic complexity 21 (threshold 15). Of this number, 16 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":"pkg/ddl/index.go"},"region":{"startLine":1532}}}],"partialFingerprints":{"codehealthFindingId/v1":"1eab6707820e79bd71891b56f99aaa60e48dbe555353bb2f4d8ce0d158d05bf3"}},{"ruleId":"D1","level":"warning","message":{"text":"worker.onDropSchema (cyclomatic 21): worker.onDropSchema 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":"pkg/ddl/schema.go"},"region":{"startLine":158}}}],"partialFingerprints":{"codehealthFindingId/v1":"330b973989dfac1bbfd7a5082d4e78e78062f59650f372e87e544b94176afaf2"}},{"ruleId":"D1","level":"warning","message":{"text":"jobsubmit.assignGIDsForJobs (cyclomatic 21): jobsubmit.assignGIDsForJobs 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":"pkg/ddl/jobsubmit/submit.go"},"region":{"startLine":287}}}],"partialFingerprints":{"codehealthFindingId/v1":"4fb40f1ca3f7fe8024408fdcc0aecd57052b55166c18dd80451d8487888f8187"}},{"ruleId":"D1","level":"warning","message":{"text":"executor.addUnchangedKeysForLockByRow (cyclomatic 21): executor.addUnchangedKeysForLockByRow 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":"pkg/executor/write.go"},"region":{"startLine":366}}}],"partialFingerprints":{"codehealthFindingId/v1":"8715c67e37552b3fad254ceca122f7000346ce0e77aced7d8fcef7c5bdd9d11b"}},{"ruleId":"D1","level":"warning","message":{"text":"executorBuilder.buildTableReader (cyclomatic 21): executorBuilder.buildTableReader has cyclomatic complexity 21 (threshold 15). Of this number, 18 points are the body\u0027s own statements and 3 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":"pkg/executor/builder.go"},"region":{"startLine":3934}}}],"partialFingerprints":{"codehealthFindingId/v1":"fec353cadc37a273920e0cd7533ad08c5174b45af9520a65d63c5fd911a9d6da"}},{"ruleId":"D1","level":"warning","message":{"text":"tableWorker.executeTask (cyclomatic 21): tableWorker.executeTask 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":"pkg/executor/distsql.go"},"region":{"startLine":2145}}}],"partialFingerprints":{"codehealthFindingId/v1":"c7947958a36da88c45a86dc5077e9fdb561a772ff8977b9b3e527373e20bef25"}},{"ruleId":"D1","level":"warning","message":{"text":"querywatch.setWatchOption (cyclomatic 21): querywatch.setWatchOption 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":"pkg/executor/internal/querywatch/query_watch.go"},"region":{"startLine":38}}}],"partialFingerprints":{"codehealthFindingId/v1":"45fd8a678f74c2f1d691a8a1e5b097153ee4749ded16b450fd1b725fc4ca735c"}},{"ruleId":"D1","level":"warning","message":{"text":"join.NewJoinProbe (cyclomatic 21): join.NewJoinProbe 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":"pkg/executor/join/base_join_probe.go"},"region":{"startLine":850}}}],"partialFingerprints":{"codehealthFindingId/v1":"322adcffa7c406d5fd33ed479084574f7a017a585e0ad1305adbfc39b481d6d1"}},{"ruleId":"D1","level":"warning","message":{"text":"NestedLoopApplyExec.Next (cyclomatic 21): NestedLoopApplyExec.Next 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":"pkg/executor/join/hash_join_v1.go"},"region":{"startLine":1347}}}],"partialFingerprints":{"codehealthFindingId/v1":"48ba8d135b87ae85569bb8dde2b579be632b080575ad87be97e73e58aeafe29c"}},{"ruleId":"D1","level":"warning","message":{"text":"indexHashJoinInnerWorker.doJoinInOrder (cyclomatic 21): indexHashJoinInnerWorker.doJoinInOrder has cyclomatic complexity 21 (threshold 15). Of this number, 16 points are the body\u0027s own statements and 5 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":"pkg/executor/join/index_lookup_hash_join.go"},"region":{"startLine":918}}}],"partialFingerprints":{"codehealthFindingId/v1":"0a44f6313898c474fcff062d721963e306b3f5ca5d59ddf367dd194b5a94dcfa"}},{"ruleId":"D1","level":"warning","message":{"text":"leftOuterSemiJoinProbe.buildResult (cyclomatic 21): leftOuterSemiJoinProbe.buildResult 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":"pkg/executor/join/left_outer_semi_join_probe.go"},"region":{"startLine":175}}}],"partialFingerprints":{"codehealthFindingId/v1":"909366665101cc61796cf3be639496d8531a2dad5fe4a65cb16468b1d78ae9ea"}},{"ruleId":"D1","level":"warning","message":{"text":"MetricsSummaryByLabelRetriever.retrieve (cyclomatic 21): MetricsSummaryByLabelRetriever.retrieve 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":"pkg/executor/metrics_reader.go"},"region":{"startLine":273}}}],"partialFingerprints":{"codehealthFindingId/v1":"76221d1530fb1d139f6728ad8addfa27cd518b382d15547e4a020b423bc0b154"}},{"ruleId":"D1","level":"warning","message":{"text":"ParallelNestedLoopApplyExec.fetchAllInners (cyclomatic 21): ParallelNestedLoopApplyExec.fetchAllInners has cyclomatic complexity 21 (threshold 15). Of this number, 18 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":"pkg/executor/parallel_apply.go"},"region":{"startLine":631}}}],"partialFingerprints":{"codehealthFindingId/v1":"17f4650d4a861803204b5822871a175ec580a2b7eba710af2e3180e0f3bc187b"}},{"ruleId":"D1","level":"warning","message":{"text":"ShowExec.fetchShowColumns (cyclomatic 21): ShowExec.fetchShowColumns 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":"pkg/executor/show.go"},"region":{"startLine":696}}}],"partialFingerprints":{"codehealthFindingId/v1":"1e59be1a1a668183876a3558d85a11a26eae95aa49d7781f33706ccf921e30b3"}},{"ruleId":"D1","level":"warning","message":{"text":"ShowExec.fetchShowIndex (cyclomatic 21): ShowExec.fetchShowIndex 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":"pkg/executor/show.go"},"region":{"startLine":788}}}],"partialFingerprints":{"codehealthFindingId/v1":"93d0c5f233c2407f4268c3b36e13179b67efe444c94875dd5b3f82f290da410e"}},{"ruleId":"D1","level":"warning","message":{"text":"ShowExec.fetchShowImportGroups (cyclomatic 21): ShowExec.fetchShowImportGroups 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":"pkg/executor/show.go"},"region":{"startLine":2721}}}],"partialFingerprints":{"codehealthFindingId/v1":"f5721c427da529c3fbb1d41fa7236451e7a0bb9b6a06c12da990961396e2b418"}},{"ruleId":"D1","level":"warning","message":{"text":"parallelSortSpillHelper.spillImpl (cyclomatic 21): parallelSortSpillHelper.spillImpl has cyclomatic complexity 21 (threshold 15). Of this number, 11 points are the body\u0027s own statements and 10 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":"pkg/executor/sortexec/parallel_sort_spill_helper.go"},"region":{"startLine":197}}}],"partialFingerprints":{"codehealthFindingId/v1":"27ba1fa46c73bd6a174b57f206501e95eb958a3503029c3ff09cf763f1031ab3"}},{"ruleId":"D1","level":"warning","message":{"text":"windows.Build (cyclomatic 21): windows.Build 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":"pkg/executor/windows/builder.go"},"region":{"startLine":45}}}],"partialFingerprints":{"codehealthFindingId/v1":"8eff6b2c6bb54a04479923bd1245d4397b5ab7fab9a9bac99ee31f6a15dc8b6d"}},{"ruleId":"D1","level":"warning","message":{"text":"rangeFrameWindowProcessor.appendResult2Chunk (cyclomatic 21): rangeFrameWindowProcessor.appendResult2Chunk 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":"pkg/executor/windows/window.go"},"region":{"startLine":444}}}],"partialFingerprints":{"codehealthFindingId/v1":"5e8fcad041b35dd2477a8c3af8e9c96638c8a0526c0e045c73d667ac9aac6845"}},{"ruleId":"D1","level":"warning","message":{"text":"builtinArithmeticMinusIntSig.overflowCheck (cyclomatic 21): builtinArithmeticMinusIntSig.overflowCheck 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":"pkg/expression/builtin_arithmetic.go"},"region":{"startLine":491}}}],"partialFingerprints":{"codehealthFindingId/v1":"651a116dea45a76e9447b0d05b775de0cf051664e3c2621dc08acf636551a2af"}},{"ruleId":"D1","level":"warning","message":{"text":"builtinAesDecryptIVSig.vecEvalString (cyclomatic 21): builtinAesDecryptIVSig.vecEvalString 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":"pkg/expression/builtin_encryption_vec.go"},"region":{"startLine":292}}}],"partialFingerprints":{"codehealthFindingId/v1":"54a10242a609fdae6452ba474fb2cd10bdb9bda4a8d5bb089705d28f2d8fad2a"}},{"ruleId":"D1","level":"warning","message":{"text":"builtinAesEncryptIVSig.vecEvalString (cyclomatic 21): builtinAesEncryptIVSig.vecEvalString 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":"pkg/expression/builtin_encryption_vec.go"},"region":{"startLine":119}}}],"partialFingerprints":{"codehealthFindingId/v1":"829bd5c7d412eb0b5fb598be6667c9d3104a5a4685942c5768a0486aee5f8d5b"}},{"ruleId":"D1","level":"warning","message":{"text":"builtinConvSig.conv (cyclomatic 21): builtinConvSig.conv has cyclomatic complexity 21 (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":"pkg/expression/builtin_math.go"},"region":{"startLine":1315}}}],"partialFingerprints":{"codehealthFindingId/v1":"36d3b789051dd6ce97c0381471b8e37c67848f60179abfa31dcb5a9505347136"}},{"ruleId":"D1","level":"warning","message":{"text":"PbConverter.encodeDatum (cyclomatic 21): PbConverter.encodeDatum has cyclomatic complexity 21 (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/expression/expr_to_pb.go"},"region":{"startLine":117}}}],"partialFingerprints":{"codehealthFindingId/v1":"281c5f881b5e83e933245ebbc4613acf8eef7fefee4ac4b60ec63f2a5a5d27c2"}},{"ruleId":"D1","level":"warning","message":{"text":"Backend.ImportEngine (cyclomatic 21): Backend.ImportEngine 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":"pkg/ingestor/ingestctrl/local.go"},"region":{"startLine":1406}}}],"partialFingerprints":{"codehealthFindingId/v1":"fa58283e90a08f8902bb51589216acde09c10010b8526a04ef14ac7ef31c812d"}},{"ruleId":"D1","level":"warning","message":{"text":"mdLoaderSetup.route (cyclomatic 21): mdLoaderSetup.route has cyclomatic complexity 21 (threshold 15). Of this number, 16 points are the body\u0027s own statements and 5 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":"pkg/lightning/mydump/loader.go"},"region":{"startLine":671}}}],"partialFingerprints":{"codehealthFindingId/v1":"82a76d024d194cc5959fb2040bf8694546f12c35f4cd05c0defc30b7d9434b62"}},{"ruleId":"D1","level":"warning","message":{"text":"objstore.parseBackend (cyclomatic 21): objstore.parseBackend 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":"pkg/objstore/parse.go"},"region":{"startLine":71}}}],"partialFingerprints":{"codehealthFindingId/v1":"35145240cd7ae6d44595ab8cec7fd3704333190c7fb14736f0660e81ea4ff92b"}},{"ruleId":"D1","level":"warning","message":{"text":"Optimizer.implGroup (cyclomatic 21): Optimizer.implGroup 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":"pkg/planner/cascades/old/optimize.go"},"region":{"startLine":268}}}],"partialFingerprints":{"codehealthFindingId/v1":"1e79562494e85a178e0c0201a23238d55e6874227a9387a5fd6dee516a3449f1"}},{"ruleId":"D1","level":"warning","message":{"text":"core.getTaskPlanCost (cyclomatic 21): core.getTaskPlanCost 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":"pkg/planner/core/find_best_task.go"},"region":{"startLine":498}}}],"partialFingerprints":{"codehealthFindingId/v1":"da14c3f3918c48625b3b7a767125429d048d003eb4353898240b4202d75c7b90"}},{"ruleId":"D1","level":"warning","message":{"text":"core.genHintTblForJoinNodes (cyclomatic 21): core.genHintTblForJoinNodes 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":"pkg/planner/core/hint_utils.go"},"region":{"startLine":379}}}],"partialFingerprints":{"codehealthFindingId/v1":"67641b8b5b74a0f04cf2f250e5f9523fd48ce6e8838e466212885c9cda749484"}},{"ruleId":"D1","level":"warning","message":{"text":"core.GetPlanFromPlanCache (cyclomatic 21): core.GetPlanFromPlanCache 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":"pkg/planner/core/plan_cache.go"},"region":{"startLine":205}}}],"partialFingerprints":{"codehealthFindingId/v1":"39d26ca8d1eaec2a68f1e0163f35b14e8df822bf9495ef0a3dbc0c2780bb10c6"}},{"ruleId":"D1","level":"warning","message":{"text":"core.tryPointGetPlan (cyclomatic 21): core.tryPointGetPlan 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":"pkg/planner/core/point_get_plan.go"},"region":{"startLine":523}}}],"partialFingerprints":{"codehealthFindingId/v1":"3e191d7198efe65db2f3bc0939b77faff69de023bade539b3adfe7a34c1b0e42"}},{"ruleId":"D1","level":"warning","message":{"text":"core.indexIsAvailableByHints (cyclomatic 21): core.indexIsAvailableByHints has cyclomatic complexity 21 (threshold 15). Of this number, 20 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":"pkg/planner/core/point_get_plan.go"},"region":{"startLine":676}}}],"partialFingerprints":{"codehealthFindingId/v1":"3e69838b8280cb51b14e387c12e240df22b3c98cd3bb7319c9e864dc0e6ae640"}},{"ruleId":"D1","level":"warning","message":{"text":"core.adjust3StagePhaseAgg (cyclomatic 21): core.adjust3StagePhaseAgg 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":"pkg/planner/core/task.go"},"region":{"startLine":1849}}}],"partialFingerprints":{"codehealthFindingId/v1":"0bcdbe530137588692fe774d959821ce03b88e83b44e599ae09c6eda50220156"}},{"ruleId":"D1","level":"warning","message":{"text":"FullTextIndexResolverProjection.onEnterDataSource (cyclomatic 21): FullTextIndexResolverProjection.onEnterDataSource 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":"pkg/planner/core/fts_resolve_index.go"},"region":{"startLine":289}}}],"partialFingerprints":{"codehealthFindingId/v1":"4df9917e1c5fa572e4b0a903cd909632fa56cd25e51ba403cc0b33b64ad8ce83"}},{"ruleId":"D1","level":"warning","message":{"text":"gbyResolver.Leave (cyclomatic 21): gbyResolver.Leave 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":"pkg/planner/core/logical_plan_builder.go"},"region":{"startLine":3407}}}],"partialFingerprints":{"codehealthFindingId/v1":"e92c85a438cb5dd76122a42f019caaefbaea934e4598d5e56641cdf4c83862e9"}},{"ruleId":"D1","level":"warning","message":{"text":"extractHelper.extractTimeRange (cyclomatic 21): extractHelper.extractTimeRange 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":"pkg/planner/core/memtable_predicate_extractor.go"},"region":{"startLine":528}}}],"partialFingerprints":{"codehealthFindingId/v1":"2a1f58fc1359d32a901af42d030ae2affbc425d261591e48c82d09b573eb34c0"}},{"ruleId":"D1","level":"warning","message":{"text":"physicalop.GetMergeJoin (cyclomatic 21): physicalop.GetMergeJoin 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":"pkg/planner/core/operator/physicalop/physical_merge_join.go"},"region":{"startLine":50}}}],"partialFingerprints":{"codehealthFindingId/v1":"7629bc21d74fa88a85930ef23a94d602722eae4f7bb6dbd6346331530fd1b028"}},{"ruleId":"D1","level":"warning","message":{"text":"PhysicalHashJoin.ResolveIndicesItself (cyclomatic 21): PhysicalHashJoin.ResolveIndicesItself 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":"pkg/planner/core/operator/physicalop/physical_hash_join.go"},"region":{"startLine":379}}}],"partialFingerprints":{"codehealthFindingId/v1":"4fd59fba2c1783c6b69e96e1763139681808f3a2ea8c7c19ae637bc51c9d8fc6"}},{"ruleId":"D1","level":"warning","message":{"text":"PhysicalIndexScan.InitSchema (cyclomatic 21): PhysicalIndexScan.InitSchema 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":"pkg/planner/core/operator/physicalop/physical_index_scan.go"},"region":{"startLine":363}}}],"partialFingerprints":{"codehealthFindingId/v1":"57b9e3e9ce1a6a240e3f7c5a5f913e817b23b212e6e0dd84585abab2a4742d01"}},{"ruleId":"D1","level":"warning","message":{"text":"rule.minCmp (cyclomatic 21): rule.minCmp has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 1 of the 21 points is its own statement and the rest belongs to one function literal inside it that branches (line 1207). 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":"pkg/planner/core/rule/rule_partition_processor.go"},"region":{"startLine":1206}}}],"partialFingerprints":{"codehealthFindingId/v1":"9912348f0a3a85d9ac6a03a0c508ba33a2a22defdac7fd981a43c291130d5a16"}},{"ruleId":"D1","level":"warning","message":{"text":"PartitionProcessor.resolveOptimizeHint (cyclomatic 21): PartitionProcessor.resolveOptimizeHint 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":"pkg/planner/core/rule/rule_partition_processor.go"},"region":{"startLine":1791}}}],"partialFingerprints":{"codehealthFindingId/v1":"317417830d86c9d8dc8bb92bc7776cd58a14dcf8f59405fda01389c7ff69b62d"}},{"ruleId":"D1","level":"warning","message":{"text":"listPartitionPruner.locateColumnPartitionsByCondition (cyclomatic 21): listPartitionPruner.locateColumnPartitionsByCondition 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":"pkg/planner/core/rule/rule_partition_processor.go"},"region":{"startLine":659}}}],"partialFingerprints":{"codehealthFindingId/v1":"744bccaa44fed881864b7cb87874f66f05e483ca213a8491baaf84bdd15fb29b"}},{"ruleId":"D1","level":"warning","message":{"text":"joinReorderDPSolver.solve (cyclomatic 21): joinReorderDPSolver.solve 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":"pkg/planner/core/rule_join_reorder_dp.go"},"region":{"startLine":44}}}],"partialFingerprints":{"codehealthFindingId/v1":"b22009027e916586a7d7bbe3d93a23297a8cf9f523913ca691a636b54826ede0"}},{"ruleId":"D1","level":"warning","message":{"text":"indexadvisor.CollectIndexableColumnsFromQuery (cyclomatic 21): indexadvisor.CollectIndexableColumnsFromQuery has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 4 of the 21 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 390, 433). 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":"pkg/planner/indexadvisor/utils.go"},"region":{"startLine":372}}}],"partialFingerprints":{"codehealthFindingId/v1":"23800ad2f66938ff2dae1af3f570387210452ac4eac38e6a5f3c738386dcc92c"}},{"ruleId":"D1","level":"warning","message":{"text":"autoAdmin.heuristicCoveredIndexes (cyclomatic 21): autoAdmin.heuristicCoveredIndexes 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":"pkg/planner/indexadvisor/algorithm.go"},"region":{"startLine":185}}}],"partialFingerprints":{"codehealthFindingId/v1":"7b8f5b8746ab55112c52e018f25b0fe0a3db3a5186516be74c1eff93667639a7"}},{"ruleId":"D1","level":"warning","message":{"text":"optimizor.handleDownloadFile (cyclomatic 21): optimizor.handleDownloadFile 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":"pkg/server/handler/optimizor/plan_replayer.go"},"region":{"startLine":87}}}],"partialFingerprints":{"codehealthFindingId/v1":"f65f5853e1bbc9b10db7262fb5030405f92544655e4093bb8ad2851be07e6cf8"}},{"ruleId":"D1","level":"warning","message":{"text":"session.upgradeToVer282 (cyclomatic 21): session.upgradeToVer282 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":"pkg/session/upgrade_def.go"},"region":{"startLine":2169}}}],"partialFingerprints":{"codehealthFindingId/v1":"bd1ef9fd44edea690cc1b83a1cf0dcaa83142563fc04e232dc453641179a74a2"}},{"ruleId":"D1","level":"warning","message":{"text":"session.SetProcessInfo (cyclomatic 21): session.SetProcessInfo has cyclomatic complexity 21 (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":"pkg/session/session.go"},"region":{"startLine":1733}}}],"partialFingerprints":{"codehealthFindingId/v1":"ef44ff5adb294b028f21e36a8d0106a86bd6fceae6f6fc6df7e42b50d02ed455"}},{"ruleId":"D1","level":"warning","message":{"text":"storage.loadNeededColumnHistograms (cyclomatic 21): storage.loadNeededColumnHistograms 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":"pkg/statistics/handle/storage/read.go"},"region":{"startLine":627}}}],"partialFingerprints":{"codehealthFindingId/v1":"e73bacb8980e7e65e52d9e288eaff95dd521309bb4173bfc15f3122ffe3f4b12"}},{"ruleId":"D1","level":"warning","message":{"text":"copr.checkAliveStore (cyclomatic 21): copr.checkAliveStore 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":"pkg/store/copr/batch_coprocessor.go"},"region":{"startLine":1105}}}],"partialFingerprints":{"codehealthFindingId/v1":"97feacd2c07c7eb5418e99427f501d4f2f2e020e7d59e5ac95f6335c355110a9"}},{"ruleId":"D1","level":"warning","message":{"text":"copr.buildBatchCopTasksConsistentHashForPD (cyclomatic 21): copr.buildBatchCopTasksConsistentHashForPD 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":"pkg/store/copr/batch_coprocessor.go"},"region":{"startLine":1601}}}],"partialFingerprints":{"codehealthFindingId/v1":"fae4cc0ccfa14afbb070dad103299f7ac1dda1163627acdeef4754545b0f56ac"}},{"ruleId":"D1","level":"warning","message":{"text":"MPPClient.DispatchMPPTask (cyclomatic 21): MPPClient.DispatchMPPTask 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":"pkg/store/copr/mpp.go"},"region":{"startLine":94}}}],"partialFingerprints":{"codehealthFindingId/v1":"da25b0d3ebea400c053bf7d9199b71265adf0d40711b765527fa8d554a3806fe"}},{"ruleId":"D1","level":"warning","message":{"text":"tables.DecodeRawRowData (cyclomatic 21): tables.DecodeRawRowData 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":"pkg/table/tables/tables.go"},"region":{"startLine":1083}}}],"partialFingerprints":{"codehealthFindingId/v1":"4d0ce9ddbf66bcff8ae99783b47c62318939c71a02a492ae2e1259732ebddb18"}},{"ruleId":"D1","level":"warning","message":{"text":"TimerGroupRuntime.tryTriggerTimerEvents (cyclomatic 21): TimerGroupRuntime.tryTriggerTimerEvents has cyclomatic complexity 21 (threshold 15). Of this number, 11 points are the body\u0027s own statements and 10 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":"pkg/timer/runtime/runtime.go"},"region":{"startLine":254}}}],"partialFingerprints":{"codehealthFindingId/v1":"58264a6b6410097f30308df5c977c108981d5e833759acf55808ef62b9f3deff"}},{"ruleId":"D1","level":"warning","message":{"text":"types.DecimalMul (cyclomatic 21): types.DecimalMul 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":"pkg/types/mydecimal.go"},"region":{"startLine":2052}}}],"partialFingerprints":{"codehealthFindingId/v1":"ca1b4165327cf7b2438add7b4ef55db59ec735f1fab15ba97c34b40225450571"}},{"ruleId":"D1","level":"warning","message":{"text":"Datum.toSignedInteger (cyclomatic 21): Datum.toSignedInteger 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":"pkg/types/datum.go"},"region":{"startLine":1990}}}],"partialFingerprints":{"codehealthFindingId/v1":"c17a704259423a76027c38ad7e0127ed6b57cee8ff9995e168b0cae7d798b05f"}},{"ruleId":"D1","level":"warning","message":{"text":"util.GenLogFields (cyclomatic 21): util.GenLogFields 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":"pkg/util/util.go"},"region":{"startLine":79}}}],"partialFingerprints":{"codehealthFindingId/v1":"9d7b8356d53f6ae8afa2e96bfc9d8f416a9d73417f26d64f6d1d5e1b8b5ccfd0"}},{"ruleId":"D1","level":"warning","message":{"text":"rowcodec.appendDatumForChecksum (cyclomatic 21): rowcodec.appendDatumForChecksum has cyclomatic complexity 21 (threshold 15). Of this number, 20 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. 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/util/rowcodec/common.go"},"region":{"startLine":295}}}],"partialFingerprints":{"codehealthFindingId/v1":"28c66030af8edcee8807e9d9a12ce7a479a26d145683d0856faa83bb256efa90"}},{"ruleId":"D1","level":"warning","message":{"text":"matcherParser.parseWildcardPattern (cyclomatic 21): matcherParser.parseWildcardPattern 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":"pkg/util/table-filter/parser.go"},"region":{"startLine":206}}}],"partialFingerprints":{"codehealthFindingId/v1":"a74327c89700ce2aa73dc56e6612c6c61fcf38f9b54a5e6bda1b663c2226f92e"}},{"ruleId":"D1","level":"warning","message":{"text":"ResourceGroupOption.Restore (cyclomatic 21): ResourceGroupOption.Restore 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":"pkg/parser/ast/ddl.go"},"region":{"startLine":2519}}}],"partialFingerprints":{"codehealthFindingId/v1":"1a3f5172c39c7b98dc98c38cdfd6cac29f0cfa01f8257ee0b40b280c71de5f9a"}},{"ruleId":"D1","level":"warning","message":{"text":"PartitionMethod.Restore (cyclomatic 21): PartitionMethod.Restore 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":"pkg/parser/ast/ddl.go"},"region":{"startLine":4771}}}],"partialFingerprints":{"codehealthFindingId/v1":"1b89623feb0e5c374f309666b8c762dfdc8860bffd107ed43631e19ceb553894"}},{"ruleId":"D1","level":"warning","message":{"text":"hintScanner.Lex (cyclomatic 21): hintScanner.Lex 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":"pkg/parser/hintparserimpl.go"},"region":{"startLine":101}}}],"partialFingerprints":{"codehealthFindingId/v1":"ab5f8db74a5dc8358b174c06067580bb200884ec696d73de7a833494d09a36aa"}},{"ruleId":"D1","level":"warning","message":{"text":"split.SplitPoint (cyclomatic 20): split.SplitPoint has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 4 of the 20 points are its own statements and the rest belongs to one function literal inside it that branches (line 251). 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":"br/pkg/restore/split/splitter.go"},"region":{"startLine":220}}}],"partialFingerprints":{"codehealthFindingId/v1":"aa7829f39b3888ac99582a23292cf2f6538fd3a371e105db88d7058fd228dff7"}},{"ruleId":"D1","level":"warning","message":{"text":"AdvancerExt.startListen (cyclomatic 20): AdvancerExt.startListen has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 1 of the 20 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 259, 281, 244). 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":"br/pkg/streamhelper/advancer_cliext.go"},"region":{"startLine":238}}}],"partialFingerprints":{"codehealthFindingId/v1":"11aa5045a81a091a5d0574e80fb1b41d6c99d5e59fb1501710eb09a9b4593c22"}},{"ruleId":"D1","level":"warning","message":{"text":"spans.ValuedSetEquals (cyclomatic 20): spans.ValuedSetEquals has cyclomatic complexity 20 (threshold 15). Of this number, 18 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":"br/pkg/streamhelper/spans/utils.go"},"region":{"startLine":84}}}],"partialFingerprints":{"codehealthFindingId/v1":"983eba0d91a7b1217f19b9c5f0f179a144567e83974b694021abbe3e50fb9cbf"}},{"ruleId":"D1","level":"warning","message":{"text":"task.processLogBackupTableHistory (cyclomatic 20): task.processLogBackupTableHistory 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":"br/pkg/task/restore.go"},"region":{"startLine":2210}}}],"partialFingerprints":{"codehealthFindingId/v1":"4833270ca038c2e437bb2b3026d02b6945dc9e0418855e289f48238c9f9993ae"}},{"ruleId":"D1","level":"warning","message":{"text":"task.RunRestoreAbort (cyclomatic 20): task.RunRestoreAbort 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":"br/pkg/task/restore.go"},"region":{"startLine":2845}}}],"partialFingerprints":{"codehealthFindingId/v1":"2cbf31a9b7a8c6dbbbc159a5002c24c97d8d7a6987ecc171b451671fc8dbc48c"}},{"ruleId":"D1","level":"warning","message":{"text":"export.WriteInsertInCsv (cyclomatic 20): export.WriteInsertInCsv 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":"dumpling/export/writer_util.go"},"region":{"startLine":329}}}],"partialFingerprints":{"codehealthFindingId/v1":"a55c68b7e73cc2e9c35506f71e98fef171d5e95137a093965c185c3f70d16000"}},{"ruleId":"D1","level":"warning","message":{"text":"TableImporter.preDeduplicate (cyclomatic 20): TableImporter.preDeduplicate 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":"lightning/pkg/importer/table_import.go"},"region":{"startLine":1719}}}],"partialFingerprints":{"codehealthFindingId/v1":"f3056e1cd133a927850b0c0fa1f1729d0c5b045541e504b079aab1bfb08cc11f"}},{"ruleId":"D1","level":"warning","message":{"text":"bindinfo.breadthFirstPlanSearch (cyclomatic 20): bindinfo.breadthFirstPlanSearch 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":"pkg/bindinfo/binding_plan_generation.go"},"region":{"startLine":303}}}],"partialFingerprints":{"codehealthFindingId/v1":"bbb1a3749cab8d0273f5563025371ef5d271b06f4786bf0a40cbf834d4f93e36"}},{"ruleId":"D1","level":"warning","message":{"text":"bindinfo.extractSelectIndexHints (cyclomatic 20): bindinfo.extractSelectIndexHints 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":"pkg/bindinfo/binding_plan_generation.go"},"region":{"startLine":920}}}],"partialFingerprints":{"codehealthFindingId/v1":"2e07e80862bab9d6c35e11397cac3ed3ddc563b168160251817f52b2d705b3cc"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.generateMergeSortPlan (cyclomatic 20): ddl.generateMergeSortPlan has cyclomatic complexity 20 (threshold 15). Of this number, 17 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":"pkg/ddl/backfilling_dist_scheduler.go"},"region":{"startLine":649}}}],"partialFingerprints":{"codehealthFindingId/v1":"b56a0e577a4d231f80f460c0c037621686dc21181fbe8dbb520998b64dab8fc5"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.SendPrepareFlashbackToVersionRPC (cyclomatic 20): ddl.SendPrepareFlashbackToVersionRPC has cyclomatic complexity 20 (threshold 15). Of this number, 18 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":"pkg/ddl/cluster.go"},"region":{"startLine":455}}}],"partialFingerprints":{"codehealthFindingId/v1":"b7fb439995d233087b77b270a46d7bd0094142f9e48b366af67e9359cbb54c8f"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.checkAlterTableCharset (cyclomatic 20): ddl.checkAlterTableCharset 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":"pkg/ddl/executor.go"},"region":{"startLine":4084}}}],"partialFingerprints":{"codehealthFindingId/v1":"dae8eed33dfb556e75007c242d6b7385a6890ef614984ace1190e9e00abddb33"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.checkModifyColumnWithForeignKeyConstraint (cyclomatic 20): ddl.checkModifyColumnWithForeignKeyConstraint 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":"pkg/ddl/foreign_key.go"},"region":{"startLine":301}}}],"partialFingerprints":{"codehealthFindingId/v1":"745e6b41080e370c92337457fbee1bc09b6262c136ae2971ee3dff866d74dfe9"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.buildListPartitionDefinitions (cyclomatic 20): ddl.buildListPartitionDefinitions 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":"pkg/ddl/partition.go"},"region":{"startLine":1543}}}],"partialFingerprints":{"codehealthFindingId/v1":"70d9c1f0cba9154a385ebf59ed90d981201e8ed92e4ba2ae26fe81d2654d091d"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.buildCheckSQLConditionForRangeColumnsPartition (cyclomatic 20): ddl.buildCheckSQLConditionForRangeColumnsPartition 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":"pkg/ddl/partition.go"},"region":{"startLine":4510}}}],"partialFingerprints":{"codehealthFindingId/v1":"00c4f0aff776b1c5c9b1d816d393168fa98de827c80b0d6c5b02a35d230a8c81"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.handleSequenceOptions (cyclomatic 20): ddl.handleSequenceOptions 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":"pkg/ddl/sequence.go"},"region":{"startLine":85}}}],"partialFingerprints":{"codehealthFindingId/v1":"17db203a0d7cfa5fa2e4a61f28c4144a301f20ee4f4068b8b8e4e60e0e484fcb"}},{"ruleId":"D1","level":"warning","message":{"text":"executor.CreateSchema (cyclomatic 20): executor.CreateSchema 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":"pkg/ddl/executor.go"},"region":{"startLine":218}}}],"partialFingerprints":{"codehealthFindingId/v1":"c7dca3f31d1131c948da40ce4cb47493d9165dc7e774958ce6f8b804ccd20442"}},{"ruleId":"D1","level":"warning","message":{"text":"executor.BatchCreateTableWithInfo (cyclomatic 20): executor.BatchCreateTableWithInfo 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":"pkg/ddl/executor.go"},"region":{"startLine":1237}}}],"partialFingerprints":{"codehealthFindingId/v1":"919a71ee90fd96283e69ecb73068ecaacb3e6c68345aa5f13d95dab5c8836a2e"}},{"ruleId":"D1","level":"warning","message":{"text":"worker.onAddColumn (cyclomatic 20): worker.onAddColumn 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":"pkg/ddl/add_column.go"},"region":{"startLine":54}}}],"partialFingerprints":{"codehealthFindingId/v1":"4e4f574a90bab2b3747f706315f462eedcd00ec26acb18b457a5aecc883be000"}},{"ruleId":"D1","level":"warning","message":{"text":"testutils.WriteParquetFile (cyclomatic 20): testutils.WriteParquetFile 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":"pkg/dumpformat/testutils/parquet_writer.go"},"region":{"startLine":167}}}],"partialFingerprints":{"codehealthFindingId/v1":"e00bb0df3b22d34365f31d8f14bbfd74790bad8052807ca669924b3b12ea7ff5"}},{"ruleId":"D1","level":"warning","message":{"text":"executor.showCommentsFromJob (cyclomatic 20): executor.showCommentsFromJob 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":"pkg/executor/show_ddl_jobs.go"},"region":{"startLine":302}}}],"partialFingerprints":{"codehealthFindingId/v1":"48777504cbea204fed2fc3b4f9b19a9242393e92fb5cc9c7759f2bc88b9b7d55"}},{"ruleId":"D1","level":"warning","message":{"text":"ExecStmt.LogSlowQuery (cyclomatic 20): ExecStmt.LogSlowQuery has cyclomatic complexity 20 (threshold 15). Of this number, 18 points are the body\u0027s own statements and 2 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":"pkg/executor/adapter.go"},"region":{"startLine":1952}}}],"partialFingerprints":{"codehealthFindingId/v1":"3a97b75181050785b7431411575b87f50426ae1de2063753d7f4284c149aef20"}},{"ruleId":"D1","level":"warning","message":{"text":"AnalyzeColumnsExec.handleNDVForSpecialIndexes (cyclomatic 20): AnalyzeColumnsExec.handleNDVForSpecialIndexes 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":"pkg/executor/analyze_col_sampling.go"},"region":{"startLine":420}}}],"partialFingerprints":{"codehealthFindingId/v1":"af03926c75119d298a7ed941d7309d4e798af7cba1d07160ed975612be0da2a5"}},{"ruleId":"D1","level":"warning","message":{"text":"executorBuilder.buildIndexLookUpJoin (cyclomatic 20): executorBuilder.buildIndexLookUpJoin 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":"pkg/executor/builder.go"},"region":{"startLine":3507}}}],"partialFingerprints":{"codehealthFindingId/v1":"8c7f6e1db6952419ef0f509de0fde5aa2ddc1e3441add2045aa1070c5eb48d5d"}},{"ruleId":"D1","level":"warning","message":{"text":"IndexMergeReaderExecutor.startPartialIndexWorker (cyclomatic 20): IndexMergeReaderExecutor.startPartialIndexWorker has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 4 of the 20 points are its own statements and the rest belongs to one function literal inside it that branches (line 407). 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":"pkg/executor/index_merge_reader.go"},"region":{"startLine":380}}}],"partialFingerprints":{"codehealthFindingId/v1":"6bb64be8f1a633a171588af1aa7a5351d65cb4b22cca4ce1158223b362ab96d4"}},{"ruleId":"D1","level":"warning","message":{"text":"memtableRetriever.dataForTableTiFlashReplica (cyclomatic 20): memtableRetriever.dataForTableTiFlashReplica 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":"pkg/executor/infoschema_reader.go"},"region":{"startLine":2816}}}],"partialFingerprints":{"codehealthFindingId/v1":"aa9718ac1c7a1e3ee976bb660850231e68455f6cbfc1f9284a2b028642fdd614"}},{"ruleId":"D1","level":"warning","message":{"text":"encodeWorker.parserData2TableData (cyclomatic 20): encodeWorker.parserData2TableData has cyclomatic complexity 20 (threshold 15). Of this number, 18 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":"pkg/executor/load_data.go"},"region":{"startLine":505}}}],"partialFingerprints":{"codehealthFindingId/v1":"cbe57d25dee2331c4dbc8bad5a0024eeaed1889cb83ea589ab014b684d379f72"}},{"ruleId":"D1","level":"warning","message":{"text":"TableReaderExecutor.buildRespForGroupedRanges (cyclomatic 20): TableReaderExecutor.buildRespForGroupedRanges 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":"pkg/executor/table_reader.go"},"region":{"startLine":401}}}],"partialFingerprints":{"codehealthFindingId/v1":"a0eec34503ad411a9fc8c1c09ea6974c638ac3e956391027618d6aa5acacabf2"}},{"ruleId":"D1","level":"warning","message":{"text":"aggregation.NewWindowFuncDesc (cyclomatic 20): aggregation.NewWindowFuncDesc 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":"pkg/expression/aggregation/window_func.go"},"region":{"startLine":33}}}],"partialFingerprints":{"codehealthFindingId/v1":"8fbd6d5bd4f3afee279f5b43ba88cd360004b56fd31ad4a1134d7b1393c8ef04"}},{"ruleId":"D1","level":"warning","message":{"text":"AggFuncDesc.GetAggFunc (cyclomatic 20): AggFuncDesc.GetAggFunc has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform \u2014 the same kind of value, with no behaviour of its own \u2014 a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/aggregation/descriptor.go"},"region":{"startLine":280}}}],"partialFingerprints":{"codehealthFindingId/v1":"87b8087c9b6f96622f5144eb4ed8e02c7df39c58a34d2808f04f165e2db4867c"}},{"ruleId":"D1","level":"warning","message":{"text":"expression.addUnitToTime (cyclomatic 20): expression.addUnitToTime 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":"pkg/expression/builtin_time.go"},"region":{"startLine":6605}}}],"partialFingerprints":{"codehealthFindingId/v1":"a88bbf73ca03c46ac10ea332b7e2531d1455d74f3e4c253fdf96b34fbdfc5ad6"}},{"ruleId":"D1","level":"warning","message":{"text":"unaryMinusFunctionClass.getFunction (cyclomatic 20): unaryMinusFunctionClass.getFunction 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":"pkg/expression/builtin_op.go"},"region":{"startLine":1018}}}],"partialFingerprints":{"codehealthFindingId/v1":"f3934d93fff01bfea8f3375af4bb7f5d13588e6f28fbe5d1aab7f1c8e25b0ead"}},{"ruleId":"D1","level":"warning","message":{"text":"builtinInsertSig.vecEvalString (cyclomatic 20): builtinInsertSig.vecEvalString 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":"pkg/expression/builtin_string_vec.go"},"region":{"startLine":553}}}],"partialFingerprints":{"codehealthFindingId/v1":"b8f3a635ef6f0b663c0222034b6123bc2a404e0119052e28e4c030071409c730"}},{"ruleId":"D1","level":"warning","message":{"text":"builtinTranslateBinarySig.vecEvalString (cyclomatic 20): builtinTranslateBinarySig.vecEvalString 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":"pkg/expression/builtin_string_vec.go"},"region":{"startLine":3094}}}],"partialFingerprints":{"codehealthFindingId/v1":"430c8713986c8ac3cb1372ca9ee377e507349f04368a2452096a8e555568ce70"}},{"ruleId":"D1","level":"warning","message":{"text":"builtinTranslateUTF8Sig.vecEvalString (cyclomatic 20): builtinTranslateUTF8Sig.vecEvalString 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":"pkg/expression/builtin_string_vec.go"},"region":{"startLine":3167}}}],"partialFingerprints":{"codehealthFindingId/v1":"608cb911fc4dd2ae3a49f060386c36000e4beee8dc1cb90f6429f06bbb56c88a"}},{"ruleId":"D1","level":"warning","message":{"text":"Constant.Equals (cyclomatic 20): Constant.Equals has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/constant.go"},"region":{"startLine":577}}}],"partialFingerprints":{"codehealthFindingId/v1":"93c829a6b0658528669978ef16a17a3bb728a2d8dbc60ca996e83a061b0f94e9"}},{"ruleId":"D1","level":"warning","message":{"text":"ScalarFunction.GetSingleColumn (cyclomatic 20): ScalarFunction.GetSingleColumn has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform \u2014 the same kind of value, with no behaviour of its own \u2014 a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/scalar_function.go"},"region":{"startLine":857}}}],"partialFingerprints":{"codehealthFindingId/v1":"a7ad7137ddc16c17166b9c76c7e0ab9fbcd8eb884a62ffd393f4e547b3672963"}},{"ruleId":"D1","level":"warning","message":{"text":"dupeDetector.RecordIndexConflictError (cyclomatic 20): dupeDetector.RecordIndexConflictError has cyclomatic complexity 20 (threshold 15). Of this number, 16 points are the body\u0027s own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ingestor/ingestctrl/duplicate.go"},"region":{"startLine":553}}}],"partialFingerprints":{"codehealthFindingId/v1":"86fe6bf5c8971cd45c4b994f72f3b33840a67aec19afd576abbb5a73b4eeae49"}},{"ruleId":"D1","level":"warning","message":{"text":"targetInfoGetter.FetchRemoteTableModels (cyclomatic 20): targetInfoGetter.FetchRemoteTableModels has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 5 of the 20 points are its own statements and the rest belongs to one function literal inside it that branches (line 199). 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":"pkg/lightning/backend/tidb/tidb.go"},"region":{"startLine":182}}}],"partialFingerprints":{"codehealthFindingId/v1":"8378a7a98c087fc120be4764751eafffe28765a4f9d762256f254ee7b984a64f"}},{"ruleId":"D1","level":"warning","message":{"text":"MydumperRuntime.adjust (cyclomatic 20): MydumperRuntime.adjust 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":"pkg/lightning/config/config.go"},"region":{"startLine":921}}}],"partialFingerprints":{"codehealthFindingId/v1":"79cdf4f42f56040f5f631ed888b2671e042925ad35658efa5232d1e5c4cb2efb"}},{"ruleId":"D1","level":"warning","message":{"text":"ResourceGroupSettings.String (cyclomatic 20): ResourceGroupSettings.String 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":"pkg/meta/model/resource_group.go"},"region":{"startLine":78}}}],"partialFingerprints":{"codehealthFindingId/v1":"3e57f2c7abd6e1fd7f513b4b19e90da33d092250b4e119fb38004c1c6eb7ddac"}},{"ruleId":"D1","level":"warning","message":{"text":"ossstore.NewOSSStorage (cyclomatic 20): ossstore.NewOSSStorage 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":"pkg/objstore/ossstore/store.go"},"region":{"startLine":77}}}],"partialFingerprints":{"codehealthFindingId/v1":"1487e7f6df67f9fcd99639dd809718951a0e82908e311d2a6205cbc4f1f05abd"}},{"ruleId":"D1","level":"warning","message":{"text":"cardinality.getIndexRowCountForStatsV1 (cyclomatic 20): cardinality.getIndexRowCountForStatsV1 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":"pkg/planner/cardinality/row_count_index.go"},"region":{"startLine":82}}}],"partialFingerprints":{"codehealthFindingId/v1":"2d994ecb80da40b9ca13d41f9859f4b363b15d0f1dcec5db85a6e6bedeee2280"}},{"ruleId":"D1","level":"warning","message":{"text":"core.convertToBatchPointGet (cyclomatic 20): core.convertToBatchPointGet 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":"pkg/planner/core/find_best_task.go"},"region":{"startLine":3071}}}],"partialFingerprints":{"codehealthFindingId/v1":"e180b917e2a3bae4d10d67d5cc9b2ae40b1e5d0244d512795348165768bf9407"}},{"ruleId":"D1","level":"warning","message":{"text":"core.InjectProjBelowAgg (cyclomatic 20): core.InjectProjBelowAgg 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":"pkg/planner/core/rule_inject_extra_projection.go"},"region":{"startLine":119}}}],"partialFingerprints":{"codehealthFindingId/v1":"71cc2218520e41fcf285ffc8416c2ca011015f96345275e79dd4c39abcab9151"}},{"ruleId":"D1","level":"warning","message":{"text":"core.attach2Task4PhysicalLimit (cyclomatic 20): core.attach2Task4PhysicalLimit 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":"pkg/planner/core/task.go"},"region":{"startLine":619}}}],"partialFingerprints":{"codehealthFindingId/v1":"91e94431bbea9ae275818bdf07ff363717b56676d777a3d6487cee2aaff7a609"}},{"ruleId":"D1","level":"warning","message":{"text":"expressionRewriter.handleScalarSubquery (cyclomatic 20): expressionRewriter.handleScalarSubquery 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":"pkg/planner/core/expression_rewriter.go"},"region":{"startLine":1527}}}],"partialFingerprints":{"codehealthFindingId/v1":"e5b108597c76106d87a43ef3a885b98be7a5f5c2c4335a8a8fa9b4540757bb24"}},{"ruleId":"D1","level":"warning","message":{"text":"DataSource.PruneColumns (cyclomatic 20): DataSource.PruneColumns has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/operator/logicalop/logical_datasource.go"},"region":{"startLine":200}}}],"partialFingerprints":{"codehealthFindingId/v1":"c747d5bd5f01ccc855702a5f0fbad6325bb2f06bfe02a1c9129688a55dc6e27e"}},{"ruleId":"D1","level":"warning","message":{"text":"BasePhysicalAgg.canUse3Stage4MultiDistinctAgg (cyclomatic 20): BasePhysicalAgg.canUse3Stage4MultiDistinctAgg has cyclomatic complexity 20 (threshold 15). Of this number, 18 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":"pkg/planner/core/operator/physicalop/base_physical_agg.go"},"region":{"startLine":348}}}],"partialFingerprints":{"codehealthFindingId/v1":"860cef7b323665481c8c8f81b2b21dcf11f462731b6e33c22345143015447fbb"}},{"ruleId":"D1","level":"warning","message":{"text":"PlanBuilder.buildPhysicalIndexLookUpReaders (cyclomatic 20): PlanBuilder.buildPhysicalIndexLookUpReaders 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":"pkg/planner/core/planbuilder.go"},"region":{"startLine":1954}}}],"partialFingerprints":{"codehealthFindingId/v1":"ea87148e5fe604bf4407be96ae29f5871fc901c79bbaa596988ebef4a82653d8"}},{"ruleId":"D1","level":"warning","message":{"text":"autoAdmin.calculateBestIndexes (cyclomatic 20): autoAdmin.calculateBestIndexes 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":"pkg/planner/indexadvisor/algorithm.go"},"region":{"startLine":68}}}],"partialFingerprints":{"codehealthFindingId/v1":"ba08187066bdfe02917b8c57da7b4cd99a6d63e8f05f23fce19100a4cea0c05b"}},{"ruleId":"D1","level":"warning","message":{"text":"autoAdmin.heuristicMergeIndexes (cyclomatic 20): autoAdmin.heuristicMergeIndexes 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":"pkg/planner/indexadvisor/algorithm.go"},"region":{"startLine":269}}}],"partialFingerprints":{"codehealthFindingId/v1":"fa688527ca1df4a06cfb50031e4be781a27dd7807d15512bb6f05ef820e231c0"}},{"ruleId":"D1","level":"warning","message":{"text":"PhysicalProperty.HashCode (cyclomatic 20): PhysicalProperty.HashCode has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/property/physical_property.go"},"region":{"startLine":617}}}],"partialFingerprints":{"codehealthFindingId/v1":"8b981b829e9673d80954413821c7e9f95e93708a428090b83b9a6cf0a2b3d379"}},{"ruleId":"D1","level":"warning","message":{"text":"UserPrivileges.RequestVerification (cyclomatic 20): UserPrivileges.RequestVerification 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":"pkg/privilege/privileges/privileges.go"},"region":{"startLine":164}}}],"partialFingerprints":{"codehealthFindingId/v1":"b2bcad542063b4cb3b4acbf22e073069546d1fe893febf50cb786ed1e808257e"}},{"ruleId":"D1","level":"warning","message":{"text":"parse.HandshakeResponseBody (cyclomatic 20): parse.HandshakeResponseBody 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":"pkg/server/internal/parse/parse.go"},"region":{"startLine":76}}}],"partialFingerprints":{"codehealthFindingId/v1":"e9015e8f3cf5a215df888fdfc51f1810effb3d9059761dc233bd328d5c5eca56"}},{"ruleId":"D1","level":"warning","message":{"text":"session.checkConstraint (cyclomatic 20): session.checkConstraint 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":"pkg/session/nontransactional.go"},"region":{"startLine":191}}}],"partialFingerprints":{"codehealthFindingId/v1":"c786b43404a4cfc2dd4d568c9705115d1ea1186d8fbfb997efb086d4ed14b523"}},{"ruleId":"D1","level":"warning","message":{"text":"baseTxnContextProvider.SetOptionsBeforeCommit (cyclomatic 20): baseTxnContextProvider.SetOptionsBeforeCommit 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":"pkg/sessiontxn/isolation/base.go"},"region":{"startLine":560}}}],"partialFingerprints":{"codehealthFindingId/v1":"2ba2531ffdac51285d35f22fdc9643bbdd8ceb2069a433d5758bbba3b0db1ac7"}},{"ruleId":"D1","level":"warning","message":{"text":"autoanalyze.tryAutoAnalyzePartitionTableInDynamicMode (cyclomatic 20): autoanalyze.tryAutoAnalyzePartitionTableInDynamicMode has cyclomatic complexity 20 (threshold 15). Of this number, 18 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":"pkg/statistics/handle/autoanalyze/autoanalyze.go"},"region":{"startLine":635}}}],"partialFingerprints":{"codehealthFindingId/v1":"5197209a9f5d4d2cba32679a993aed27b238ff4729d73e600b7b2fe9fc030bd9"}},{"ruleId":"D1","level":"warning","message":{"text":"storage.TableStatsFromJSON (cyclomatic 20): storage.TableStatsFromJSON 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":"pkg/statistics/handle/storage/json.go"},"region":{"startLine":135}}}],"partialFingerprints":{"codehealthFindingId/v1":"bbb16ab9dbf92d563b191e994b4fc8bec9c0b1e4c04b1263ff1421b5db015e92"}},{"ruleId":"D1","level":"warning","message":{"text":"copr.buildBatchCopTasksConsistentHash (cyclomatic 20): copr.buildBatchCopTasksConsistentHash 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":"pkg/store/copr/batch_coprocessor.go"},"region":{"startLine":602}}}],"partialFingerprints":{"codehealthFindingId/v1":"ae3a306523c6b75d3a4d10aefe38144cc26256c70b84af2b724c8d99609e31e2"}},{"ruleId":"D1","level":"warning","message":{"text":"indexScanExec.Process (cyclomatic 20): indexScanExec.Process 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":"pkg/store/mockstore/unistore/cophandler/mpp_exec.go"},"region":{"startLine":321}}}],"partialFingerprints":{"codehealthFindingId/v1":"d484446133f293b4670308de0610d41ac15a8bd82aeb784eea20ef1e0ce12730"}},{"ruleId":"D1","level":"warning","message":{"text":"table.castColumnValue (cyclomatic 20): table.castColumnValue has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/table/column.go"},"region":{"startLine":350}}}],"partialFingerprints":{"codehealthFindingId/v1":"f351ad6dba7d892ab4cb49b2c109e31b661c2a441479bf2d4b7a4b85edecc2d3"}},{"ruleId":"D1","level":"warning","message":{"text":"tableTimerStoreCore.listWithSctx (cyclomatic 20): tableTimerStoreCore.listWithSctx 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":"pkg/timer/tablestore/store.go"},"region":{"startLine":131}}}],"partialFingerprints":{"codehealthFindingId/v1":"cd202b8a558679c0696aaf506557827eedb944c01dcc0545c2c7c4c16c70314c"}},{"ruleId":"D1","level":"warning","message":{"text":"types.appendBinaryJSON (cyclomatic 20): types.appendBinaryJSON has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function taking that case\u0027s concrete type, so the dispatch reads one line per case. These arms are selected by TYPE rather than by value, so there is no key a lookup table could be built on; where you own the matched types, giving them one shared interface method and calling that is the form a table would have taken, and where you do not, keep the cases \u2014 they stay explicit and reviewable."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/types/json_binary.go"},"region":{"startLine":759}}}],"partialFingerprints":{"codehealthFindingId/v1":"0697057156ce95ec1ca63175397f906aa5388ee11b5d3eb7c9b150fb96f72f8d"}},{"ruleId":"D1","level":"warning","message":{"text":"types.parseTimeValue (cyclomatic 20): types.parseTimeValue has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/types/time.go"},"region":{"startLine":2442}}}],"partialFingerprints":{"codehealthFindingId/v1":"3ce3ac2f6891359eca88bb88d1ad7f0425943b8c2547f783f4c0ed1c5361e4bd"}},{"ruleId":"D1","level":"warning","message":{"text":"ValueExpr.Restore (cyclomatic 20): ValueExpr.Restore has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform \u2014 the same kind of value, with no behaviour of its own \u2014 a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/types/parser_driver/value_expr.go"},"region":{"startLine":83}}}],"partialFingerprints":{"codehealthFindingId/v1":"c698fe04bb26c72a4c25517e929bae0a9900fdc4af8c8552b9604d6f90a16871"}},{"ruleId":"D1","level":"warning","message":{"text":"MemArbitrator.UpdateDigestProfileCache (cyclomatic 20): MemArbitrator.UpdateDigestProfileCache 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":"pkg/util/memory/arbitrator.go"},"region":{"startLine":852}}}],"partialFingerprints":{"codehealthFindingId/v1":"e51f24db592acccc57ba637b5c796240e70575c57c10eaf3631133a0e93c1f58"}},{"ruleId":"D1","level":"warning","message":{"text":"MemArbitrator.updateMemMagnification (cyclomatic 20): MemArbitrator.updateMemMagnification 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":"pkg/util/memory/arbitrator.go"},"region":{"startLine":2413}}}],"partialFingerprints":{"codehealthFindingId/v1":"3a2a2f6b29e0b3d39e35cbfd392e815443702c11b654e537a94077c59ab07e51"}},{"ruleId":"D1","level":"warning","message":{"text":"redact.DeRedact (cyclomatic 20): redact.DeRedact 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":"pkg/util/redact/redact.go"},"region":{"startLine":104}}}],"partialFingerprints":{"codehealthFindingId/v1":"43bde78423becebe2802d6380384c382d8b340697fb384b3e104bdaffc5db492"}},{"ruleId":"D1","level":"warning","message":{"text":"trieSelector.insert (cyclomatic 20): trieSelector.insert 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":"pkg/util/table-rule-selector/trie_selector.go"},"region":{"startLine":302}}}],"partialFingerprints":{"codehealthFindingId/v1":"2bedad18705db89003761ef4b009d0204cac05b2276fa44d1f5abb4d42e2596b"}},{"ruleId":"D1","level":"warning","message":{"text":"sqlDigester.normalize (cyclomatic 20): sqlDigester.normalize 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":"pkg/parser/digester.go"},"region":{"startLine":216}}}],"partialFingerprints":{"codehealthFindingId/v1":"740dd4a4f5197fd0ab0dfdbbc96f44d7e791025db4699b4b55173fb34200f5cd"}},{"ruleId":"D1","level":"warning","message":{"text":"main.newBackupMetaValidateCommand (cyclomatic 19): main.newBackupMetaValidateCommand has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 1 of the 19 points is its own statement and the rest belongs to one function literal inside it that branches (line 161). 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":"br/cmd/br/debug.go"},"region":{"startLine":157}}}],"partialFingerprints":{"codehealthFindingId/v1":"acc861d88bb31f8b1bdc88bde1bc528287c70727ad2683003fed9a926036dd29"}},{"ruleId":"D1","level":"warning","message":{"text":"CheckpointRunner.startCheckpointMainLoop (cyclomatic 19): CheckpointRunner.startCheckpointMainLoop has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 1 of the 19 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 451, 438). 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":"br/pkg/checkpoint/checkpoint.go"},"region":{"startLine":431}}}],"partialFingerprints":{"codehealthFindingId/v1":"c1c35196492424349e8d3cdb957b817c404c2e3f46dba668c7b817d58a88f4a8"}},{"ruleId":"D1","level":"warning","message":{"text":"MigrationExt.MergeAndMigrateTo (cyclomatic 19): MigrationExt.MergeAndMigrateTo 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":"br/pkg/stream/stream_metas.go"},"region":{"startLine":932}}}],"partialFingerprints":{"codehealthFindingId/v1":"e4fb102cc08aad38546b1609c4dd5471a4cdce767226b6a2a502b1b6f163ee94"}},{"ruleId":"D1","level":"warning","message":{"text":"taskRegister.keepaliveLoop (cyclomatic 19): taskRegister.keepaliveLoop has cyclomatic complexity 19 (threshold 15). Of this number, 18 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, 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":"br/pkg/utils/register.go"},"region":{"startLine":191}}}],"partialFingerprints":{"codehealthFindingId/v1":"85c2ba251192670cc097f7259b0ef3f326ab59e11fb9493610532aef10dfb3b5"}},{"ruleId":"D1","level":"warning","message":{"text":"column.parseRule (cyclomatic 19): column.parseRule 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":"cmd/importer/parser.go"},"region":{"startLine":59}}}],"partialFingerprints":{"codehealthFindingId/v1":"64e4d57c86877651137c415669fe07b0b4b64554174fbb480621ad90622d4201"}},{"ruleId":"D1","level":"warning","message":{"text":"main.main (cyclomatic 19): main.main has cyclomatic complexity 19 (threshold 15). 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: 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":"lightning/cmd/tidb-lightning/main.go"},"region":{"startLine":34}}}],"partialFingerprints":{"codehealthFindingId/v1":"9dd5b914c3663ba285d12b798bd01d82c9c82f48ab5b175e2ca0070b4326d93f"}},{"ruleId":"D1","level":"warning","message":{"text":"MySQLCheckpointsDB.Update (cyclomatic 19): MySQLCheckpointsDB.Update has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 1 of the 19 points is its own statement and the rest belongs to one function literal inside it that branches (line 1057). 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":"lightning/pkg/checkpoints/checkpoints.go"},"region":{"startLine":1049}}}],"partialFingerprints":{"codehealthFindingId/v1":"fc931d898df0a3fbf97b4384d73f1bfcc5d156a04efc06aa32d339993e738d5e"}},{"ruleId":"D1","level":"warning","message":{"text":"emptyRegionCheckItem.Check (cyclomatic 19): emptyRegionCheckItem.Check 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":"lightning/pkg/importer/precheck_impl.go"},"region":{"startLine":255}}}],"partialFingerprints":{"codehealthFindingId/v1":"55ebe82da4d9da4486aaa54a52923d0c78131df98c0b0fa30ce158eb1425a7f9"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.CreateNewColumn (cyclomatic 19): ddl.CreateNewColumn 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":"pkg/ddl/add_column.go"},"region":{"startLine":213}}}],"partialFingerprints":{"codehealthFindingId/v1":"dd754ec45aebc4d0ecff14535868d493af846c30918b7ff35f2388ea7be2d0a1"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.SendFlashbackToVersionRPC (cyclomatic 19): ddl.SendFlashbackToVersionRPC 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":"pkg/ddl/cluster.go"},"region":{"startLine":548}}}],"partialFingerprints":{"codehealthFindingId/v1":"1605f4b76b4c0de705d04d3ef0885211eff8d13bfa9f18b206fc3721ba812b96"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.formatListPartitionValue (cyclomatic 19): ddl.formatListPartitionValue 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":"pkg/ddl/partition.go"},"region":{"startLine":1975}}}],"partialFingerprints":{"codehealthFindingId/v1":"3c13827b8d85d39f36b1e39a119160c063ccda6256c967e8c3047e2a4d0f747a"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.getReorgInfo (cyclomatic 19): ddl.getReorgInfo has cyclomatic complexity 19 (threshold 15). Of this number, 13 points are the body\u0027s own statements and 6 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/reorg.go"},"region":{"startLine":911}}}],"partialFingerprints":{"codehealthFindingId/v1":"bc5015718f8e1a4435bed483ec1dea8bf6b3e9f5bc0088956b6d0fe9a912eaec"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.SetDirectResourceGroupSettings (cyclomatic 19): ddl.SetDirectResourceGroupSettings 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":"pkg/ddl/resource_group.go"},"region":{"startLine":201}}}],"partialFingerprints":{"codehealthFindingId/v1":"59256d08c9b377fd1355875a5f0932e0c561888741d4a131afa86ef179680fec"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.applySplitPoliciesForTable (cyclomatic 19): ddl.applySplitPoliciesForTable 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":"pkg/ddl/split_region.go"},"region":{"startLine":236}}}],"partialFingerprints":{"codehealthFindingId/v1":"55a2362d90f6c41e9861c114460c57bb4417ba436a53cf3236705dd1ec2ac30d"}},{"ruleId":"D1","level":"warning","message":{"text":"executor.createColumnarIndex (cyclomatic 19): executor.createColumnarIndex 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":"pkg/ddl/executor.go"},"region":{"startLine":4946}}}],"partialFingerprints":{"codehealthFindingId/v1":"f532dade4c09499063f1b7c1081e57959ddf2d4abac51e4fb3e187852ab1f890"}},{"ruleId":"D1","level":"warning","message":{"text":"worker.onDropTablePartition (cyclomatic 19): worker.onDropTablePartition 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":"pkg/ddl/partition.go"},"region":{"startLine":2304}}}],"partialFingerprints":{"codehealthFindingId/v1":"910be194df967924502161898221af3e93cd4dbaa282bf7e7773ac952590968a"}},{"ruleId":"D1","level":"warning","message":{"text":"worker.onRecoverTable (cyclomatic 19): worker.onRecoverTable 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":"pkg/ddl/table.go"},"region":{"startLine":159}}}],"partialFingerprints":{"codehealthFindingId/v1":"ec56f12c6032efbe162f290d99833019d82740b56db4ed00199cc835ec393545"}},{"ruleId":"D1","level":"warning","message":{"text":"reorgPartitionWorker.BackfillData (cyclomatic 19): reorgPartitionWorker.BackfillData has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 1 of the 19 points is its own statement and the rest belongs to one function literal inside it that branches (line 3900). 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":"pkg/ddl/partition.go"},"region":{"startLine":3897}}}],"partialFingerprints":{"codehealthFindingId/v1":"581d34c3ef9d8279650aa756ee33ce190c190f21f1f68d43369b3a09595a2522"}},{"ruleId":"D1","level":"warning","message":{"text":"parquetfile.getStringFromParquetByte (cyclomatic 19): parquetfile.getStringFromParquetByte 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":"pkg/dumpformat/parquetfile/type_converter.go"},"region":{"startLine":82}}}],"partialFingerprints":{"codehealthFindingId/v1":"e9cf631735cdff89f39cfc3f69c3e25fbd1124585b522370ca62d291a169f1e2"}},{"ruleId":"D1","level":"warning","message":{"text":"importinto.GetRuntimeInfoForJob (cyclomatic 19): importinto.GetRuntimeInfoForJob has cyclomatic complexity 19 (threshold 15). Of this number, 18 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/dxf/importinto/job.go"},"region":{"startLine":296}}}],"partialFingerprints":{"codehealthFindingId/v1":"ee4806d6e10d167f5e964e8769061e49e2e97be4ef0c02903631572f531e3be5"}},{"ruleId":"D1","level":"warning","message":{"text":"executor.splitByColon (cyclomatic 19): executor.splitByColon 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":"pkg/executor/slow_query.go"},"region":{"startLine":858}}}],"partialFingerprints":{"codehealthFindingId/v1":"60d0952a9c26910afa1f62578b6ea6e73fb28ddb0335f63785866901e6a8120e"}},{"ruleId":"D1","level":"warning","message":{"text":"aggfuncs.buildMaxMinCount (cyclomatic 19): aggfuncs.buildMaxMinCount has cyclomatic complexity 19 (threshold 15). Of this number, 16 points are the body\u0027s own statements and 3 belong to one function literal inside it that branches. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. 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/executor/aggfuncs/builder.go"},"region":{"startLine":523}}}],"partialFingerprints":{"codehealthFindingId/v1":"583bcf121ccb40cd96085fe55105530426d02f8b37decc8778ac95bdb01cd783"}},{"ruleId":"D1","level":"warning","message":{"text":"AnalyzeIndexExec.buildStatsFromResult (cyclomatic 19): AnalyzeIndexExec.buildStatsFromResult 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":"pkg/executor/analyze_idx.go"},"region":{"startLine":185}}}],"partialFingerprints":{"codehealthFindingId/v1":"5f8bc6a0fbb8e8d950df6fb7f5d488eef7637e700a0c932fe6dd322a25218f42"}},{"ruleId":"D1","level":"warning","message":{"text":"tableWorker.compareData (cyclomatic 19): tableWorker.compareData has cyclomatic complexity 19 (threshold 15). Of this number, 15 points are the body\u0027s own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/distsql.go"},"region":{"startLine":2014}}}],"partialFingerprints":{"codehealthFindingId/v1":"3dfd3b893b82c3a24fb935f8b45b635952b4716be2cf9ef0485625829349bf75"}},{"ruleId":"D1","level":"warning","message":{"text":"ExplainExec.executeAnalyzeExec (cyclomatic 19): ExplainExec.executeAnalyzeExec has cyclomatic complexity 19 (threshold 15). 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, 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":"pkg/executor/explain.go"},"region":{"startLine":98}}}],"partialFingerprints":{"codehealthFindingId/v1":"f0a62c6e1b7feae1723f5f769eca4de765826ea84e3bcb54d5f38dc104448672"}},{"ruleId":"D1","level":"warning","message":{"text":"FKCheckExec.checkRows (cyclomatic 19): FKCheckExec.checkRows 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":"pkg/executor/foreign_key.go"},"region":{"startLine":557}}}],"partialFingerprints":{"codehealthFindingId/v1":"81027c0843d9d6346f0b478d31b7115ab11c246cef708a62d1aea4b598819e1b"}},{"ruleId":"D1","level":"warning","message":{"text":"memtableRetriever.setDataForTiKVRegionStatus (cyclomatic 19): memtableRetriever.setDataForTiKVRegionStatus 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":"pkg/executor/infoschema_reader.go"},"region":{"startLine":2095}}}],"partialFingerprints":{"codehealthFindingId/v1":"e73a5b02c38b1025780c2e4ef8e5f92176a09ed1c274a0d6798782da717a0cfa"}},{"ruleId":"D1","level":"warning","message":{"text":"InsertExec.batchUpdateDupRows (cyclomatic 19): InsertExec.batchUpdateDupRows 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":"pkg/executor/insert.go"},"region":{"startLine":226}}}],"partialFingerprints":{"codehealthFindingId/v1":"d3aa01a26025c9be60e8beac7389e6b67d9748390dac8d24d1c8c33269cfdd8f"}},{"ruleId":"D1","level":"warning","message":{"text":"inspectionResultRetriever.retrieve (cyclomatic 19): inspectionResultRetriever.retrieve has cyclomatic complexity 19 (threshold 15). Of this number, 13 points are the body\u0027s own statements and 6 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/inspection_result.go"},"region":{"startLine":117}}}],"partialFingerprints":{"codehealthFindingId/v1":"0934db28013aa20b5d44f521e8c9a2599dec2068c6fc6ae7b1d4f10e833c4ba8"}},{"ruleId":"D1","level":"warning","message":{"text":"MockDataSource.GenColDatums (cyclomatic 19): MockDataSource.GenColDatums has cyclomatic complexity 19 (threshold 15). Of this number, 16 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":"pkg/executor/internal/testutil/testutil.go"},"region":{"startLine":72}}}],"partialFingerprints":{"codehealthFindingId/v1":"795d00cbdb3e418d2547857b8205ecab5ab317590ede79e7791d64fb770829dd"}},{"ruleId":"D1","level":"warning","message":{"text":"join.setupJoinKeys (cyclomatic 19): join.setupJoinKeys 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":"pkg/executor/join/join_table_meta.go"},"region":{"startLine":260}}}],"partialFingerprints":{"codehealthFindingId/v1":"12080454b6a2bf0153f76a9a304150222e13f853608fb8f863255198a7c903b4"}},{"ruleId":"D1","level":"warning","message":{"text":"indexHashJoinInnerWorker.run (cyclomatic 19): indexHashJoinInnerWorker.run 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":"pkg/executor/join/index_lookup_hash_join.go"},"region":{"startLine":543}}}],"partialFingerprints":{"codehealthFindingId/v1":"afc55856e201e0ba7588724a9a7f70970711a0e0cc55886197e1e3afe36af60d"}},{"ruleId":"D1","level":"warning","message":{"text":"innerMergeWorker.handleTask (cyclomatic 19): innerMergeWorker.handleTask has cyclomatic complexity 19 (threshold 15). Of this number, 13 points are the body\u0027s own statements and 6 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/join/index_lookup_merge_join.go"},"region":{"startLine":424}}}],"partialFingerprints":{"codehealthFindingId/v1":"b887f23e4514792ea302eba4725ede9debb27221784c433516bd85dbafe717aa"}},{"ruleId":"D1","level":"warning","message":{"text":"MergeJoinTable.fetchNextInnerGroup (cyclomatic 19): MergeJoinTable.fetchNextInnerGroup 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":"pkg/executor/join/merge_join.go"},"region":{"startLine":178}}}],"partialFingerprints":{"codehealthFindingId/v1":"669cd888d9638e7a6f0abdea079fceac22864ff5ad62275bc97e2dde8c22985b"}},{"ruleId":"D1","level":"warning","message":{"text":"ShowExec.fetchShowTables (cyclomatic 19): ShowExec.fetchShowTables has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/show.go"},"region":{"startLine":573}}}],"partialFingerprints":{"codehealthFindingId/v1":"efd6e65d79020fb911a21a7a062fc8afd50acaea94576895b32fcfdc1b693b84"}},{"ruleId":"D1","level":"warning","message":{"text":"passwordOrLockOptionsInfo.loadOptions (cyclomatic 19): passwordOrLockOptionsInfo.loadOptions has cyclomatic complexity 19 (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/executor/simple.go"},"region":{"startLine":877}}}],"partialFingerprints":{"codehealthFindingId/v1":"40f6bf371b3d6d51cb55c001e2b72c2f5b87ef11e41c6d113e4f12c2c236ea64"}},{"ruleId":"D1","level":"warning","message":{"text":"rowFrameWindowProcessor.appendResult2Chunk (cyclomatic 19): rowFrameWindowProcessor.appendResult2Chunk 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":"pkg/executor/windows/window.go"},"region":{"startLine":295}}}],"partialFingerprints":{"codehealthFindingId/v1":"a9b6557e4bd6753a9d1dfac589d01955ed73f1c7b98bb9a72992667610c94e87"}},{"ruleId":"D1","level":"warning","message":{"text":"expression.convertJSON2Tp (cyclomatic 19): expression.convertJSON2Tp has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 6 of the 19 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 737, 718, 730, \u2026). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals\u0027 work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/builtin_cast.go"},"region":{"startLine":708}}}],"partialFingerprints":{"codehealthFindingId/v1":"bc5cd0bb83da126ff2f6fbd477d35e65f30a0e7f49e10a68fa1e5525ab12bd6d"}},{"ruleId":"D1","level":"warning","message":{"text":"expression.replaceEqCondtionWithTrue (cyclomatic 19): expression.replaceEqCondtionWithTrue 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":"pkg/expression/constant_propagation.go"},"region":{"startLine":165}}}],"partialFingerprints":{"codehealthFindingId/v1":"a760552becf02f87f6fd9ca9d087a42dc89ac160be883ae283b5b99b4423ea78"}},{"ruleId":"D1","level":"warning","message":{"text":"expression.extractEquivalenceColumns (cyclomatic 19): expression.extractEquivalenceColumns 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":"pkg/expression/util.go"},"region":{"startLine":337}}}],"partialFingerprints":{"codehealthFindingId/v1":"cea1416a0ec0d8b096c2ddb9472c0eaf709b087af3f5d3b637c2e4d8e266ed42"}},{"ruleId":"D1","level":"warning","message":{"text":"builtinCastJSONAsTimeSig.vecEvalTime (cyclomatic 19): builtinCastJSONAsTimeSig.vecEvalTime 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":"pkg/expression/builtin_cast_vec.go"},"region":{"startLine":479}}}],"partialFingerprints":{"codehealthFindingId/v1":"86e4abe95ffbc98db65da7d576db1a3431d2853424ee7761d27dac89f04800e4"}},{"ruleId":"D1","level":"warning","message":{"text":"builtinJSONArrayAppendSig.vecEvalJSON (cyclomatic 19): builtinJSONArrayAppendSig.vecEvalJSON has cyclomatic complexity 19 (threshold 15). 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, 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":"pkg/expression/builtin_json_vec.go"},"region":{"startLine":1255}}}],"partialFingerprints":{"codehealthFindingId/v1":"91d3ed3a9bee8053879d65725d39f1552fa4a2caab425f6220ef1c8d39ec1e60"}},{"ruleId":"D1","level":"warning","message":{"text":"builtinJSONSearchSig.evalJSON (cyclomatic 19): builtinJSONSearchSig.evalJSON 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":"pkg/expression/builtin_json.go"},"region":{"startLine":1656}}}],"partialFingerprints":{"codehealthFindingId/v1":"f3ccedaa18ed094d81bad5c503063ba8b7a41134bf3acc8125f68f89caf25069"}},{"ruleId":"D1","level":"warning","message":{"text":"inFunctionClass.getFunction (cyclomatic 19): inFunctionClass.getFunction 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":"pkg/expression/builtin_other.go"},"region":{"startLine":89}}}],"partialFingerprints":{"codehealthFindingId/v1":"e2260daa17a71a2bff2f2d670a7df901691b04fcf56751ba4874e1e60a44fee6"}},{"ruleId":"D1","level":"warning","message":{"text":"builtinLpadUTF8Sig.vecEvalString (cyclomatic 19): builtinLpadUTF8Sig.vecEvalString 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":"pkg/expression/builtin_string_vec.go"},"region":{"startLine":1048}}}],"partialFingerprints":{"codehealthFindingId/v1":"83a3dd1b03ba1fcf71fde82b4b42103f30a4ac41a0ab1c48a2ca59967ee2e256"}},{"ruleId":"D1","level":"warning","message":{"text":"builtinRpadUTF8Sig.vecEvalString (cyclomatic 19): builtinRpadUTF8Sig.vecEvalString 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":"pkg/expression/builtin_string_vec.go"},"region":{"startLine":2605}}}],"partialFingerprints":{"codehealthFindingId/v1":"20475e0f99761e109165fbb3b57cbb70b7b978c00c2ff6a21e5d9dc3603f1c87"}},{"ruleId":"D1","level":"warning","message":{"text":"builtinInsertUTF8Sig.vecEvalString (cyclomatic 19): builtinInsertUTF8Sig.vecEvalString 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":"pkg/expression/builtin_string_vec.go"},"region":{"startLine":1885}}}],"partialFingerprints":{"codehealthFindingId/v1":"ac654660be8f6b5466498a3383a56401167485920a416af2a7a1c7c7bba872bb"}},{"ruleId":"D1","level":"warning","message":{"text":"baseDateArithmetical.getIntervalFromDecimal (cyclomatic 19): baseDateArithmetical.getIntervalFromDecimal has cyclomatic complexity 19 (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/expression/builtin_time.go"},"region":{"startLine":3106}}}],"partialFingerprints":{"codehealthFindingId/v1":"0dc352fc4b2352cfb2988cdc2d46696c5be39b7db5be8b4c75f0dc15bfadd5b5"}},{"ruleId":"D1","level":"warning","message":{"text":"testutil.RunEmbedderContract (cyclomatic 19): testutil.RunEmbedderContract has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 2 of the 19 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 117, 84, 95, \u2026). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals\u0027 work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/inference/embedding/internal/testutil/testutil.go"},"region":{"startLine":70}}}],"partialFingerprints":{"codehealthFindingId/v1":"e1707801335a6c249f77064842216fbae7dbfbd407791696e5b44355fddbd267"}},{"ruleId":"D1","level":"warning","message":{"text":"Job.IsRollbackable (cyclomatic 19): Job.IsRollbackable has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/meta/model/job.go"},"region":{"startLine":864}}}],"partialFingerprints":{"codehealthFindingId/v1":"235c2a4a25fd4b4bc689d48ec2cb458b993fe80f6c447e53316be81543d030dd"}},{"ruleId":"D1","level":"warning","message":{"text":"core.generateMVIndexMergePartialPaths4And (cyclomatic 19): core.generateMVIndexMergePartialPaths4And 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":"pkg/planner/core/indexmerge_path.go"},"region":{"startLine":410}}}],"partialFingerprints":{"codehealthFindingId/v1":"cdf85958dc88dd221f0dc051fa34b411217787ef4fc984cb377a61598cdef7d3"}},{"ruleId":"D1","level":"warning","message":{"text":"joinorder.FindAndRemovePlanByAstHint (cyclomatic 19): joinorder.FindAndRemovePlanByAstHint 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":"pkg/planner/core/joinorder/util.go"},"region":{"startLine":361}}}],"partialFingerprints":{"codehealthFindingId/v1":"9e582325ef1638c583b41ff5590a01bb5aa14800622dc6528b167bd819a6d85a"}},{"ruleId":"D1","level":"warning","message":{"text":"DataSource.CheckPartialIndexes (cyclomatic 19): DataSource.CheckPartialIndexes has cyclomatic complexity 19 (threshold 15). Of this number, 16 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":"pkg/planner/core/operator/logicalop/logical_datasource.go"},"region":{"startLine":870}}}],"partialFingerprints":{"codehealthFindingId/v1":"5358b7bb8a268396de02a3645265974c2e84063ed86392027eaab57188dcd939"}},{"ruleId":"D1","level":"warning","message":{"text":"mppTaskGenerator.untwistPlanAndRemoveUnionAll (cyclomatic 19): mppTaskGenerator.untwistPlanAndRemoveUnionAll 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":"pkg/planner/core/operator/physicalop/fragment.go"},"region":{"startLine":420}}}],"partialFingerprints":{"codehealthFindingId/v1":"ab84c4d62336ab05769649e7b9e27b40e4ea05ed8ecf4a568500017220b8e02d"}},{"ruleId":"D1","level":"warning","message":{"text":"PlanBuilder.resolveHavingAndOrderBy (cyclomatic 19): PlanBuilder.resolveHavingAndOrderBy 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":"pkg/planner/core/logical_plan_builder.go"},"region":{"startLine":2911}}}],"partialFingerprints":{"codehealthFindingId/v1":"fca63d4652e86652ba93117c56bdc8b03086daa993348ce015fb2b95fe6a7c16"}},{"ruleId":"D1","level":"warning","message":{"text":"PlanBuilder.resolveWindowFunction (cyclomatic 19): PlanBuilder.resolveWindowFunction 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":"pkg/planner/core/logical_plan_builder.go"},"region":{"startLine":3054}}}],"partialFingerprints":{"codehealthFindingId/v1":"00829cd3c668ac4898539370b7f2bab05711eb47c132468b38f65ae1dd80da30"}},{"ruleId":"D1","level":"warning","message":{"text":"PlanBuilder.checkOnlyFullGroupByWithOutGroupClause (cyclomatic 19): PlanBuilder.checkOnlyFullGroupByWithOutGroupClause 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":"pkg/planner/core/logical_plan_builder.go"},"region":{"startLine":3876}}}],"partialFingerprints":{"codehealthFindingId/v1":"71ccddc99ac96acf53fdf828f46e8e01f3799c43078ed5ecfde9988964ffe0cf"}},{"ruleId":"D1","level":"warning","message":{"text":"PlanBuilder.getInsertColExpr (cyclomatic 19): PlanBuilder.getInsertColExpr 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":"pkg/planner/core/planbuilder.go"},"region":{"startLine":4277}}}],"partialFingerprints":{"codehealthFindingId/v1":"edc21815dd680777c3cd27b751986a041b6b718cf2fb40a6670a41b5c6f85944"}},{"ruleId":"D1","level":"warning","message":{"text":"rule.FindPredicateType (cyclomatic 19): rule.FindPredicateType 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":"pkg/planner/core/rule/rule_predicate_simplification.go"},"region":{"startLine":90}}}],"partialFingerprints":{"codehealthFindingId/v1":"94a04c35b3e765da7ab91378f0b6c9f842c3867ac46262ad9a2f6159aec6029c"}},{"ruleId":"D1","level":"warning","message":{"text":"rule.shortCircuitANDORLogicalConstants (cyclomatic 19): rule.shortCircuitANDORLogicalConstants has cyclomatic complexity 19 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/rule/rule_predicate_simplification.go"},"region":{"startLine":477}}}],"partialFingerprints":{"codehealthFindingId/v1":"d63fa86861bad911a4a0f94c0ace8790349a822e43a0ce72898652b9104e7d17"}},{"ruleId":"D1","level":"warning","message":{"text":"planner.Optimize (cyclomatic 19): planner.Optimize has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 7 of the 19 points are its own statements and the rest belongs to one function literal inside it that branches (line 156). 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":"pkg/planner/optimize.go"},"region":{"startLine":141}}}],"partialFingerprints":{"codehealthFindingId/v1":"b3f25f2f44ca70862f79ee2786aa41bf177fbed229bff9d80c13677e8a5a7318"}},{"ruleId":"D1","level":"warning","message":{"text":"planner.buildAndOptimizeLogicalPlanRound (cyclomatic 19): planner.buildAndOptimizeLogicalPlanRound 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":"pkg/planner/optimize.go"},"region":{"startLine":496}}}],"partialFingerprints":{"codehealthFindingId/v1":"098202051143926eb5b2ad402067e6fd30191d30a318a0bb4e3e7c0e1f1020d1"}},{"ruleId":"D1","level":"warning","message":{"text":"planner.optimize (cyclomatic 19): planner.optimize has cyclomatic complexity 19 (threshold 15). Of this number, 12 points are the body\u0027s own statements and 7 belong to 4 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":"pkg/planner/optimize.go"},"region":{"startLine":716}}}],"partialFingerprints":{"codehealthFindingId/v1":"d0b96fcbac7e981be306a06ffa97f71e1231409f3f0afc5dff1ac1f8dabcf0bd"}},{"ruleId":"D1","level":"warning","message":{"text":"util.ExtractTableAlias (cyclomatic 19): util.ExtractTableAlias 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":"pkg/planner/util/misc.go"},"region":{"startLine":244}}}],"partialFingerprints":{"codehealthFindingId/v1":"f9932a10a252a102b048ce2c0ceed30c3ba2bf6ef672650e677f426aea6a0473"}},{"ruleId":"D1","level":"warning","message":{"text":"util.proveNullRejectedScalarFunc (cyclomatic 19): util.proveNullRejectedScalarFunc has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/util/null_misc.go"},"region":{"startLine":172}}}],"partialFingerprints":{"codehealthFindingId/v1":"a5f204709ff20c6d3fd235cfa84728efdf3c829aea363574318bd0bdba1c83c6"}},{"ruleId":"D1","level":"warning","message":{"text":"MySQLPrivilege.DBIsVisible (cyclomatic 19): MySQLPrivilege.DBIsVisible 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":"pkg/privilege/privileges/cache.go"},"region":{"startLine":1693}}}],"partialFingerprints":{"codehealthFindingId/v1":"e7de8195625a9dcce0f00e3f6cfb1abbfbd67969fe197cec3eb6149ee62c2719"}},{"ruleId":"D1","level":"warning","message":{"text":"Manager.deleteExpiredRows (cyclomatic 19): Manager.deleteExpiredRows has cyclomatic complexity 19 (threshold 15). Of this number, 18 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, 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":"pkg/resourcegroup/runaway/record.go"},"region":{"startLine":245}}}],"partialFingerprints":{"codehealthFindingId/v1":"71a620a0a695abd29b31b9d130eeb82fa53b69728f534db97c9ea62499db598a"}},{"ruleId":"D1","level":"warning","message":{"text":"Server.onConn (cyclomatic 19): Server.onConn has cyclomatic complexity 19 (threshold 15). Of this number, 15 points are the body\u0027s own statements and 4 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":"pkg/server/server.go"},"region":{"startLine":766}}}],"partialFingerprints":{"codehealthFindingId/v1":"bb68774d4e40167bd4b21cbf78452f3eb04ab4f59855ea7d4ad3d90009299db8"}},{"ruleId":"D1","level":"warning","message":{"text":"session.doCommitWithRetry (cyclomatic 19): session.doCommitWithRetry has cyclomatic complexity 19 (threshold 15). Of this number, 16 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":"pkg/session/session.go"},"region":{"startLine":808}}}],"partialFingerprints":{"codehealthFindingId/v1":"246a29f4a2a71401bda9b4ec027673b9f79b0749388491a1ce3309b62f6ae69f"}},{"ruleId":"D1","level":"warning","message":{"text":"session.retry (cyclomatic 19): session.retry has cyclomatic complexity 19 (threshold 15). Of this number, 15 points are the body\u0027s own statements and 4 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":"pkg/session/session.go"},"region":{"startLine":1164}}}],"partialFingerprints":{"codehealthFindingId/v1":"363df66f5f573093ee0a56033784ea769b708d78d4905db37650d8bb76bc1b29"}},{"ruleId":"D1","level":"warning","message":{"text":"variable.parseByteSize (cyclomatic 19): variable.parseByteSize has cyclomatic complexity 19 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/sessionctx/variable/varsutil.go"},"region":{"startLine":317}}}],"partialFingerprints":{"codehealthFindingId/v1":"dd27bf0465b42edc995b029b67c5ac4938f7967794dbec306add69691fa4b6ca"}},{"ruleId":"D1","level":"warning","message":{"text":"StatsCacheImpl.Update (cyclomatic 19): StatsCacheImpl.Update has cyclomatic complexity 19 (threshold 15). 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, 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":"pkg/statistics/handle/cache/statscache.go"},"region":{"startLine":122}}}],"partialFingerprints":{"codehealthFindingId/v1":"f1ba17552851ad23233ec8356730095f274ee73e84048f6e4f59ad172ece258d"}},{"ruleId":"D1","level":"warning","message":{"text":"storage.InsertColStats2KV (cyclomatic 19): storage.InsertColStats2KV 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":"pkg/statistics/handle/storage/save.go"},"region":{"startLine":408}}}],"partialFingerprints":{"codehealthFindingId/v1":"0acf39f2dba9125afe7ecd697b6b7d4494e4e7657ffebee665c9a38fe8dfc135"}},{"ruleId":"D1","level":"warning","message":{"text":"RegionCache.SplitKeyRangesByLocations (cyclomatic 19): RegionCache.SplitKeyRangesByLocations 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":"pkg/store/copr/region_cache.go"},"region":{"startLine":668}}}],"partialFingerprints":{"codehealthFindingId/v1":"a12f2bbc1a74f68268151179b77c60a26ca426435471a25ad7eb3b893b4e93e9"}},{"ruleId":"D1","level":"warning","message":{"text":"UnionIter.updateCur (cyclomatic 19): UnionIter.updateCur 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":"pkg/store/driver/txn/union_iter.go"},"region":{"startLine":66}}}],"partialFingerprints":{"codehealthFindingId/v1":"b60a4d227ef84568eca1d88bcaa62acc053daee976717241830596e9d55db524"}},{"ruleId":"D1","level":"warning","message":{"text":"MVCCStore.CheckTxnStatus (cyclomatic 19): MVCCStore.CheckTxnStatus 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":"pkg/store/mockstore/unistore/tikv/mvcc.go"},"region":{"startLine":497}}}],"partialFingerprints":{"codehealthFindingId/v1":"3d6e2b5e09da2e607dde8ff212cccbdd5225d99a5125aadb8830726f2e432232"}},{"ruleId":"D1","level":"warning","message":{"text":"MVCCStore.Flush (cyclomatic 19): MVCCStore.Flush 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":"pkg/store/mockstore/unistore/tikv/mvcc.go"},"region":{"startLine":986}}}],"partialFingerprints":{"codehealthFindingId/v1":"0988a238c4e0bb847e1a9b22bab76f5f372e460caaeffec848ed2a6f1bbb4b8f"}},{"ruleId":"D1","level":"warning","message":{"text":"tables.IterRecords (cyclomatic 19): tables.IterRecords 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":"pkg/table/tables/tables.go"},"region":{"startLine":1340}}}],"partialFingerprints":{"codehealthFindingId/v1":"b99979a5950731824497ec7b05d7b189badef8702c498969e63c195b9edaeefb"}},{"ruleId":"D1","level":"warning","message":{"text":"testKitRows.Next (cyclomatic 19): testKitRows.Next 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":"pkg/testkit/db_driver.go"},"region":{"startLine":228}}}],"partialFingerprints":{"codehealthFindingId/v1":"713045879c696270d397a759b66cac766a6c95bb67bf37211bffe035329e8df3"}},{"ruleId":"D1","level":"warning","message":{"text":"TimerUpdate.apply (cyclomatic 19): TimerUpdate.apply has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/timer/api/store.go"},"region":{"startLine":195}}}],"partialFingerprints":{"codehealthFindingId/v1":"55bb1be43f9d35f231b248aca08d7da7a2d1d0f051beef4ae6f5e578044aa8ac"}},{"ruleId":"D1","level":"warning","message":{"text":"hookWorker.triggerEvent (cyclomatic 19): hookWorker.triggerEvent 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":"pkg/timer/runtime/worker.go"},"region":{"startLine":275}}}],"partialFingerprints":{"codehealthFindingId/v1":"2792e82e15008af1b0171571297a6822db33a356b81bea412cfb72048634e934"}},{"ruleId":"D1","level":"warning","message":{"text":"tablestore.buildUpdateCriteria (cyclomatic 19): tablestore.buildUpdateCriteria has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/timer/tablestore/sql.go"},"region":{"startLine":365}}}],"partialFingerprints":{"codehealthFindingId/v1":"54541de748e5d8f10d242c02303f2cce27b7ad6ecee7eccb4c94a8234973382f"}},{"ruleId":"D1","level":"warning","message":{"text":"cache.RowToTTLTask (cyclomatic 19): cache.RowToTTLTask 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":"pkg/ttl/cache/task.go"},"region":{"startLine":124}}}],"partialFingerprints":{"codehealthFindingId/v1":"5c1d59c03036d6042550de8f3de1dfeb9056b38eb16847c2003500eb33aadd4f"}},{"ruleId":"D1","level":"warning","message":{"text":"types.AggFieldType (cyclomatic 19): types.AggFieldType has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/types/field_type.go"},"region":{"startLine":63}}}],"partialFingerprints":{"codehealthFindingId/v1":"a524495e13b644231de0fa6ae30c12f9e9f9d43af48cb1505264ca111120ed44"}},{"ruleId":"D1","level":"warning","message":{"text":"types.CheckModifyTypeCompatible (cyclomatic 19): types.CheckModifyTypeCompatible 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":"pkg/types/field_type.go"},"region":{"startLine":1476}}}],"partialFingerprints":{"codehealthFindingId/v1":"fdca950a4a6823cefe184f2efc31e571437542cfed25dba5f7f9c85a3188b9f4"}},{"ruleId":"D1","level":"warning","message":{"text":"types.unquoteJSONString (cyclomatic 19): types.unquoteJSONString 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":"pkg/types/json_binary_functions.go"},"region":{"startLine":109}}}],"partialFingerprints":{"codehealthFindingId/v1":"49c2ef4cc412378de079e97bb4d4c6d2a2d5074793305dafb99f5c9d495b13cb"}},{"ruleId":"D1","level":"warning","message":{"text":"types.doAdd (cyclomatic 19): types.doAdd 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":"pkg/types/mydecimal.go"},"region":{"startLine":1898}}}],"partialFingerprints":{"codehealthFindingId/v1":"2e4d37a85aa542e682140ec2abb3a8d516130a0cdbc5172b9c6cdf6dc0e8465b"}},{"ruleId":"D1","level":"warning","message":{"text":"Datum.convertToMysqlDuration (cyclomatic 19): Datum.convertToMysqlDuration 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":"pkg/types/datum.go"},"region":{"startLine":1500}}}],"partialFingerprints":{"codehealthFindingId/v1":"10e429cd16af7a4498f2b2341298a43c2808eb345d91767166f8adc1970d97b3"}},{"ruleId":"D1","level":"warning","message":{"text":"Datum.convertToMysqlDecimal (cyclomatic 19): Datum.convertToMysqlDecimal has cyclomatic complexity 19 (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/types/datum.go"},"region":{"startLine":1572}}}],"partialFingerprints":{"codehealthFindingId/v1":"75bc331c99ba4cfa3750a4cc84a4a889a5532037daab7b911abb863840c1db35"}},{"ruleId":"D1","level":"warning","message":{"text":"codec.DecodeOne (cyclomatic 19): codec.DecodeOne has cyclomatic complexity 19 (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/util/codec/codec.go"},"region":{"startLine":1342}}}],"partialFingerprints":{"codehealthFindingId/v1":"e9785a8dffccf683ca046822b48c47cf06ba4d98a7c4e9020565c206c6f99dbc"}},{"ruleId":"D1","level":"warning","message":{"text":"util.LoadTLSCertificates (cyclomatic 19): util.LoadTLSCertificates has cyclomatic complexity 19 (threshold 15). 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, 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":"pkg/util/misc.go"},"region":{"startLine":385}}}],"partialFingerprints":{"codehealthFindingId/v1":"4fa94fc3dbceb7951bc170708d13b8d9b08a74f31a390416f249fe2e97c0eabf"}},{"ruleId":"D1","level":"warning","message":{"text":"Filter.matchTable (cyclomatic 19): Filter.matchTable 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":"pkg/util/filter/filter.go"},"region":{"startLine":364}}}],"partialFingerprints":{"codehealthFindingId/v1":"6395f942ae8106459773e11d6439ceee6f53ba2b776f4e2cb413983291a1c257"}},{"ruleId":"D1","level":"warning","message":{"text":"memArbitrator.intoBigBudget (cyclomatic 19): memArbitrator.intoBigBudget has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/util/memory/tracker.go"},"region":{"startLine":1109}}}],"partialFingerprints":{"codehealthFindingId/v1":"e7afe81ebd4ac0ab3514d3d47398e78b54ad08b2c647bc3960f502a413aea35c"}},{"ruleId":"D1","level":"warning","message":{"text":"conditionChecker.checkLikeFunc (cyclomatic 19): conditionChecker.checkLikeFunc 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":"pkg/util/ranger/checker.go"},"region":{"startLine":160}}}],"partialFingerprints":{"codehealthFindingId/v1":"99f906d3c30cc105e384e89f491bf28571f90b2c35efbea49b02cd91c0cdfbb4"}},{"ruleId":"D1","level":"warning","message":{"text":"builder.buildFromIn (cyclomatic 19): builder.buildFromIn 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":"pkg/util/ranger/points.go"},"region":{"startLine":620}}}],"partialFingerprints":{"codehealthFindingId/v1":"94579eb1c0cce5fd44f229b0058a4ae5e5bed013625ea69674e43a81b7f13cad"}},{"ruleId":"D1","level":"warning","message":{"text":"rowcodec.encodeValueDatum (cyclomatic 19): rowcodec.encodeValueDatum has cyclomatic complexity 19 (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/util/rowcodec/encoder.go"},"region":{"startLine":174}}}],"partialFingerprints":{"codehealthFindingId/v1":"8b89c10a6b99f79676ae21c8487b4359790837b5b54e59b91c3af9c29020d9d2"}},{"ruleId":"D1","level":"warning","message":{"text":"StmtSummary.evictedLogLoop (cyclomatic 19): StmtSummary.evictedLogLoop has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 9 of the 19 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 559, 529, 539, \u2026). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals\u0027 work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/util/stmtsummary/v2/stmtsummary.go"},"region":{"startLine":507}}}],"partialFingerprints":{"codehealthFindingId/v1":"9fd4f687362ebb92495a3cabccd357f3e56fb8e7180375cc4fcfef3d457b0a70"}},{"ruleId":"D1","level":"warning","message":{"text":"ruCollecting.compactWithLimits (cyclomatic 19): ruCollecting.compactWithLimits 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":"pkg/util/topsql/reporter/ru_datamodel.go"},"region":{"startLine":553}}}],"partialFingerprints":{"codehealthFindingId/v1":"c82a1b7f9d8aa7aa9869fc3f6f800428dadf56b02e1ec973c5f150b354484032"}},{"ruleId":"D1","level":"warning","message":{"text":"PlanReplayerStmt.Restore (cyclomatic 19): PlanReplayerStmt.Restore 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":"pkg/parser/ast/misc.go"},"region":{"startLine":324}}}],"partialFingerprints":{"codehealthFindingId/v1":"8bf934611ad49864f78aca34834078dd30e9dc6d643932990dc4f16160106e8b"}},{"ruleId":"D1","level":"warning","message":{"text":"CreateUserStmt.Restore (cyclomatic 19): CreateUserStmt.Restore 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":"pkg/parser/ast/misc.go"},"region":{"startLine":1875}}}],"partialFingerprints":{"codehealthFindingId/v1":"fc0b30a01be5935861f6fd395b613744ec8743f6526c3dfe03b2eab7a08e2076"}},{"ruleId":"D1","level":"warning","message":{"text":"charset.peek (cyclomatic 19): charset.peek has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/parser/charset/encoding_gb18030.go"},"region":{"startLine":55}}}],"partialFingerprints":{"codehealthFindingId/v1":"50a4d4787becc6a1cd87c32b74dcedcc15e3b87af148006777d8935d2f7f111f"}},{"ruleId":"D1","level":"warning","message":{"text":"parser.startWithSlash (cyclomatic 19): parser.startWithSlash 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":"pkg/parser/lexer.go"},"region":{"startLine":559}}}],"partialFingerprints":{"codehealthFindingId/v1":"1e3ba5fb853ec1a99e1df9cb000a59ea19216af8b21b98532ae95083ec858b9a"}},{"ruleId":"D1","level":"warning","message":{"text":"parser.startWithNumber (cyclomatic 19): parser.startWithNumber has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/parser/lexer.go"},"region":{"startLine":842}}}],"partialFingerprints":{"codehealthFindingId/v1":"7e79424487571139e73251e3b76062850b7a5ca28a969c7797f3ab0c572fb4f5"}},{"ruleId":"D1","level":"warning","message":{"text":"sqlDigester.reduceLit (cyclomatic 19): sqlDigester.reduceLit 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":"pkg/parser/digester.go"},"region":{"startLine":317}}}],"partialFingerprints":{"codehealthFindingId/v1":"51dc6a5438af8668d487a7ced253830cf3951ed2b28b77df981494415f0b71f9"}},{"ruleId":"D1","level":"warning","message":{"text":"main.Init (cyclomatic 18): main.Init has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to one function literal inside it that branches (line 225). 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":"br/cmd/br/cmd.go"},"region":{"startLine":224}}}],"partialFingerprints":{"codehealthFindingId/v1":"ebc6da023806eadf1f4cad5ec2aabb111f4d7ed8ce5e140caec7bb4b14bc8a7e"}},{"ruleId":"D1","level":"warning","message":{"text":"snapclient.SortAndValidateFileRanges (cyclomatic 18): snapclient.SortAndValidateFileRanges 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":"br/pkg/restore/snap_client/tikv_sender.go"},"region":{"startLine":106}}}],"partialFingerprints":{"codehealthFindingId/v1":"af3860b807546e41ddef62099476e877f4a9c2db3c4eadf46ef05c249d354159"}},{"ruleId":"D1","level":"warning","message":{"text":"RewriteRules.Equal (cyclomatic 18): RewriteRules.Equal has cyclomatic complexity 18 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"br/pkg/restore/utils/rewrite_rule.go"},"region":{"startLine":100}}}],"partialFingerprints":{"codehealthFindingId/v1":"a84427635ac76b7efaacb540cd29056fb7bf2fa0099f25dcd37cfd14b482d0ef"}},{"ruleId":"D1","level":"warning","message":{"text":"checksumTableCtx.loadPitrIdMap (cyclomatic 18): checksumTableCtx.loadPitrIdMap 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":"br/pkg/task/operator/checksum_table.go"},"region":{"startLine":196}}}],"partialFingerprints":{"codehealthFindingId/v1":"d2ff42bdfc1c2fbda00029a21a13c90e92851710af653050d1a5f29ad629a63b"}},{"ruleId":"D1","level":"warning","message":{"text":"dupDetector.addKeysByChunk (cyclomatic 18): dupDetector.addKeysByChunk 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":"lightning/pkg/importer/dup_detect.go"},"region":{"startLine":201}}}],"partialFingerprints":{"codehealthFindingId/v1":"8af61e3e2adc798f804f2ca5a4c2d6caeb05f12ee26c17a6f78e753623356643"}},{"ruleId":"D1","level":"warning","message":{"text":"Controller.estimateChunkCountIntoMetrics (cyclomatic 18): Controller.estimateChunkCountIntoMetrics 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":"lightning/pkg/importer/import.go"},"region":{"startLine":789}}}],"partialFingerprints":{"codehealthFindingId/v1":"9f5e9cf6dd64dd3c59799b356e22b64e6a9ec73eaf5497b4d6fcb5c0c2396890"}},{"ruleId":"D1","level":"warning","message":{"text":"dbTableMetaMgr.CheckAndUpdateLocalChecksum (cyclomatic 18): dbTableMetaMgr.CheckAndUpdateLocalChecksum has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 6 of the 18 points are its own statements and the rest belongs to one function literal inside it that branches (line 430). 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":"lightning/pkg/importer/meta_manager.go"},"region":{"startLine":404}}}],"partialFingerprints":{"codehealthFindingId/v1":"feeb2aa8dd900a28eac18ee301655ebca30ec3253c7dac32ab397abcbc01952c"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.checkReorgPartitionDefs (cyclomatic 18): ddl.checkReorgPartitionDefs 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":"pkg/ddl/executor.go"},"region":{"startLine":2687}}}],"partialFingerprints":{"codehealthFindingId/v1":"44ff7923e4ab100bb086768d6715d163c2464c7eebdf8a5b251397ed581f1e55"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.checkTableForeignKey (cyclomatic 18): ddl.checkTableForeignKey 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":"pkg/ddl/foreign_key.go"},"region":{"startLine":260}}}],"partialFingerprints":{"codehealthFindingId/v1":"2455fbe706f31f30865acf5e5f2a7e71b121ac5d3cf42dcd06086fafb5157090"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.doReorgWorkForCreateIndex (cyclomatic 18): ddl.doReorgWorkForCreateIndex 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":"pkg/ddl/index.go"},"region":{"startLine":1862}}}],"partialFingerprints":{"codehealthFindingId/v1":"0a08685aad5dfba2e1b1a419e41f3c471a5f22595d26952cbad2e62baff5f96e"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.getNextPartitionInfo (cyclomatic 18): ddl.getNextPartitionInfo has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/index.go"},"region":{"startLine":3554}}}],"partialFingerprints":{"codehealthFindingId/v1":"1803d48ec9862a79639d580a05d33fe9fb069d6efe924534d58e775bec91b19b"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.checkAutoRandom (cyclomatic 18): ddl.checkAutoRandom 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":"pkg/ddl/modify_column.go"},"region":{"startLine":2375}}}],"partialFingerprints":{"codehealthFindingId/v1":"09e7d1a4f17164ba5b083bf436738b249642e3e417beff4961be830d823a358d"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.onUpdateTiFlashReplicaStatus (cyclomatic 18): ddl.onUpdateTiFlashReplicaStatus 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":"pkg/ddl/table.go"},"region":{"startLine":1233}}}],"partialFingerprints":{"codehealthFindingId/v1":"2ba4f32694b88715794853add3eb0193d748a60cf595d885790238565024314f"}},{"ruleId":"D1","level":"warning","message":{"text":"executor.AlterSchema (cyclomatic 18): executor.AlterSchema 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":"pkg/ddl/executor.go"},"region":{"startLine":703}}}],"partialFingerprints":{"codehealthFindingId/v1":"a814e9e4213f9886829a85fe52207705bbb6dbdeacd7886cf158112d813ede75"}},{"ruleId":"D1","level":"warning","message":{"text":"executor.RepairTable (cyclomatic 18): executor.RepairTable 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":"pkg/ddl/executor.go"},"region":{"startLine":5996}}}],"partialFingerprints":{"codehealthFindingId/v1":"e6abefeaeace11378262c33563bff3a94d03a1dd7e4315329fe2fed5380bfa6b"}},{"ruleId":"D1","level":"warning","message":{"text":"worker.onAddCheckConstraint (cyclomatic 18): worker.onAddCheckConstraint has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/constraint.go"},"region":{"startLine":35}}}],"partialFingerprints":{"codehealthFindingId/v1":"c683deb121f4e6adb196bd19a98ce35251155dbecdaccdca058e4b5d394a7eec"}},{"ruleId":"D1","level":"warning","message":{"text":"worker.onRecoverSchema (cyclomatic 18): worker.onRecoverSchema 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":"pkg/ddl/schema.go"},"region":{"startLine":264}}}],"partialFingerprints":{"codehealthFindingId/v1":"19f24817b87f922c79ed0e9f5f349bbaf370c76d738c50710fdaec49c35f381d"}},{"ruleId":"D1","level":"warning","message":{"text":"Rule.Reset (cyclomatic 18): Rule.Reset 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":"pkg/ddl/label/rule.go"},"region":{"startLine":137}}}],"partialFingerprints":{"codehealthFindingId/v1":"4861936a71d53a50dffb0c584a02fda805d46ba713e472172c9a50beaf86cfd2"}},{"ruleId":"D1","level":"warning","message":{"text":"InfoSyncer.ReportMinStartTS (cyclomatic 18): InfoSyncer.ReportMinStartTS has cyclomatic complexity 18 (threshold 15). Of this number, 16 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":"pkg/domain/infosync/info.go"},"region":{"startLine":629}}}],"partialFingerprints":{"codehealthFindingId/v1":"90836b0d689e8d4caced9997e035e700a97259d61688ecfbfa0e9ce0a7c46f9d"}},{"ruleId":"D1","level":"warning","message":{"text":"LogicalPlan.ToPhysicalPlan (cyclomatic 18): LogicalPlan.ToPhysicalPlan has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/dxf/importinto/planner.go"},"region":{"startLine":151}}}],"partialFingerprints":{"codehealthFindingId/v1":"b880a90cb6040cb7b9234cc26a30c3280a791266f0c7cbd97d06fe91a6cf89d1"}},{"ruleId":"D1","level":"warning","message":{"text":"executor.buildKvRangesForIndexJoin (cyclomatic 18): executor.buildKvRangesForIndexJoin 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":"pkg/executor/builder.go"},"region":{"startLine":5494}}}],"partialFingerprints":{"codehealthFindingId/v1":"65cb23644129ef0e9aba64878dcf80489f3785d19f2bfa10176adb55942ad75f"}},{"ruleId":"D1","level":"warning","message":{"text":"executor.ConvertConfigItem2JSON (cyclomatic 18): executor.ConvertConfigItem2JSON 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":"pkg/executor/set_config.go"},"region":{"startLine":187}}}],"partialFingerprints":{"codehealthFindingId/v1":"d773c09b2dbb4343071c2e9ceab68a584eaa90987e2ae7552bc5074761e5ed79"}},{"ruleId":"D1","level":"warning","message":{"text":"HashAggExec.Close (cyclomatic 18): HashAggExec.Close has cyclomatic complexity 18 (threshold 15). Of this number, 16 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":"pkg/executor/aggregate/agg_hash_executor.go"},"region":{"startLine":166}}}],"partialFingerprints":{"codehealthFindingId/v1":"aaf797abe5665b40c952dc56e512301086d9f4ee0d8e93c244d71b83ba0f1066"}},{"ruleId":"D1","level":"warning","message":{"text":"indexWorker.extractTaskHandles (cyclomatic 18): indexWorker.extractTaskHandles 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":"pkg/executor/distsql.go"},"region":{"startLine":1729}}}],"partialFingerprints":{"codehealthFindingId/v1":"522d1e1c397e1919df189198de2a6d90c529b75fb19becfd4f6402d74ae72d22"}},{"ruleId":"D1","level":"warning","message":{"text":"ImportIntoExec.Next (cyclomatic 18): ImportIntoExec.Next 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":"pkg/executor/import_into.go"},"region":{"startLine":83}}}],"partialFingerprints":{"codehealthFindingId/v1":"547f4a7e27278f9674e81d63684688adac3f99abaaeee0d1e658ea2f8cea5e4f"}},{"ruleId":"D1","level":"warning","message":{"text":"chunkEncoder.encodeLoop (cyclomatic 18): chunkEncoder.encodeLoop has cyclomatic complexity 18 (threshold 15). Of this number, 9 points are the body\u0027s own statements and 9 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":"pkg/executor/importer/chunk_process.go"},"region":{"startLine":262}}}],"partialFingerprints":{"codehealthFindingId/v1":"a0871f14133074c92dd8876c5f7691b9619d581fa9b0c8fb350cc01d1040db2d"}},{"ruleId":"D1","level":"warning","message":{"text":"baseJoinProbe.SetRestoredChunkForProbe (cyclomatic 18): baseJoinProbe.SetRestoredChunkForProbe has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/join/base_join_probe.go"},"region":{"startLine":395}}}],"partialFingerprints":{"codehealthFindingId/v1":"6cbccdbfcf8986363469bb413f899c71d0fb8aa2d8affe426c85db0326819c06"}},{"ruleId":"D1","level":"warning","message":{"text":"baseJoinProbe.appendProbeRowToChunkInternal (cyclomatic 18): baseJoinProbe.appendProbeRowToChunkInternal has cyclomatic complexity 18 (threshold 15). Of this number, 14 points are the body\u0027s own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/join/base_join_probe.go"},"region":{"startLine":677}}}],"partialFingerprints":{"codehealthFindingId/v1":"5b7b4b86a813bf9735be2a6cb6683b09418f341d914990e5ac9e57fea0e20c10"}},{"ruleId":"D1","level":"warning","message":{"text":"indexHashJoinInnerWorker.handleTask (cyclomatic 18): indexHashJoinInnerWorker.handleTask has cyclomatic complexity 18 (threshold 15). Of this number, 11 points are the body\u0027s own statements and 7 belong to 4 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":"pkg/executor/join/index_lookup_hash_join.go"},"region":{"startLine":685}}}],"partialFingerprints":{"codehealthFindingId/v1":"59c889dc230d6c2afe74a5db941d6db1b0705648eb6ce0429c65136646432192"}},{"ruleId":"D1","level":"warning","message":{"text":"IndexLookUpJoin.Next (cyclomatic 18): IndexLookUpJoin.Next 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":"pkg/executor/join/index_lookup_join.go"},"region":{"startLine":283}}}],"partialFingerprints":{"codehealthFindingId/v1":"06dcbde6a7d938bf9f4eb405e6af893f4cbbe150b242cbb8616e9a0af4159c69"}},{"ruleId":"D1","level":"warning","message":{"text":"ShowExec.fetchShowTableRegions (cyclomatic 18): ShowExec.fetchShowTableRegions 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":"pkg/executor/show.go"},"region":{"startLine":2247}}}],"partialFingerprints":{"codehealthFindingId/v1":"fabcc60203b4231f6147b3b688c117f2e4a1140a432cd914063de6cde6fac87a"}},{"ruleId":"D1","level":"warning","message":{"text":"SimpleExec.setDefaultRoleRegular (cyclomatic 18): SimpleExec.setDefaultRoleRegular 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":"pkg/executor/simple.go"},"region":{"startLine":256}}}],"partialFingerprints":{"codehealthFindingId/v1":"d763113027b28bdc7dc1f59fcec802832e7446beda4878e5585607ebb3742f9a"}},{"ruleId":"D1","level":"warning","message":{"text":"expression.vecJSONModify (cyclomatic 18): expression.vecJSONModify 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":"pkg/expression/builtin_json_vec.go"},"region":{"startLine":32}}}],"partialFingerprints":{"codehealthFindingId/v1":"0d91632a7fb65952019b315a79fa936e6b8a7dd95e558e9115aa9b520844b373"}},{"ruleId":"D1","level":"warning","message":{"text":"expression.tryToReplaceCond (cyclomatic 18): expression.tryToReplaceCond 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":"pkg/expression/constant_propagation.go"},"region":{"startLine":240}}}],"partialFingerprints":{"codehealthFindingId/v1":"c2b9539e8e583b3c7d7065075c45bc78f23450240ae6818480ba619b55555881"}},{"ruleId":"D1","level":"warning","message":{"text":"arithmeticModFunctionClass.getFunction (cyclomatic 18): arithmeticModFunctionClass.getFunction 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":"pkg/expression/builtin_arithmetic.go"},"region":{"startLine":1002}}}],"partialFingerprints":{"codehealthFindingId/v1":"1c730c612c74f56d00a3acaa397179b6a9dd38ae85466f243c13c15bcc745cd0"}},{"ruleId":"D1","level":"warning","message":{"text":"builtinCastStringAsIntSig.vecEvalInt (cyclomatic 18): builtinCastStringAsIntSig.vecEvalInt 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":"pkg/expression/builtin_cast_vec.go"},"region":{"startLine":944}}}],"partialFingerprints":{"codehealthFindingId/v1":"18a8b5b1da312ec8faf253dc83a82be5b00072a6d441c01b2017a841fed22b6e"}},{"ruleId":"D1","level":"warning","message":{"text":"builtinSHA2Sig.vecEvalString (cyclomatic 18): builtinSHA2Sig.vecEvalString 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":"pkg/expression/builtin_encryption_vec.go"},"region":{"startLine":457}}}],"partialFingerprints":{"codehealthFindingId/v1":"443b099600b048f33199065f76daefb42048c0d89541bf5b46666c0f1f68a285"}},{"ruleId":"D1","level":"warning","message":{"text":"builtinJSONArrayInsertSig.vecEvalJSON (cyclomatic 18): builtinJSONArrayInsertSig.vecEvalJSON 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":"pkg/expression/builtin_json_vec.go"},"region":{"startLine":696}}}],"partialFingerprints":{"codehealthFindingId/v1":"9b5a1ef634debbc7886ad9f9942253cb98e19ac5a5855fc0d2e6ad0b4b3b7c8f"}},{"ruleId":"D1","level":"warning","message":{"text":"builtinConvSig.evalString (cyclomatic 18): builtinConvSig.evalString 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":"pkg/expression/builtin_math.go"},"region":{"startLine":1269}}}],"partialFingerprints":{"codehealthFindingId/v1":"c4f468a78af6cca8e64ed317af7e274f7ea3d8504f0ed7e274310a0a157a0f17"}},{"ruleId":"D1","level":"warning","message":{"text":"builtinSubstringIndexSig.vecEvalString (cyclomatic 18): builtinSubstringIndexSig.vecEvalString 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":"pkg/expression/builtin_string_vec.go"},"region":{"startLine":774}}}],"partialFingerprints":{"codehealthFindingId/v1":"d64aa0d975b95807784780b75269b47804bc23b46fd911b450c6f192d5a64ef9"}},{"ruleId":"D1","level":"warning","message":{"text":"builtinExportSet5ArgSig.vecEvalString (cyclomatic 18): builtinExportSet5ArgSig.vecEvalString 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":"pkg/expression/builtin_string_vec.go"},"region":{"startLine":1965}}}],"partialFingerprints":{"codehealthFindingId/v1":"7210b749d787344665f5213e54d0aa48c4d5a85c1cc788491a7f7533c5162c58"}},{"ruleId":"D1","level":"warning","message":{"text":"builtinTimestampAddSig.vecEvalString (cyclomatic 18): builtinTimestampAddSig.vecEvalString 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":"pkg/expression/builtin_time_vec.go"},"region":{"startLine":1697}}}],"partialFingerprints":{"codehealthFindingId/v1":"0a8b9a643eebf06da637750c9bb6533133d3c430305df675ab053c791c4c5aac"}},{"ruleId":"D1","level":"warning","message":{"text":"perfschema.dataForRemoteProfile (cyclomatic 18): perfschema.dataForRemoteProfile has cyclomatic complexity 18 (threshold 15). Of this number, 10 points are the body\u0027s own statements and 8 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/infoschema/perfschema/tables.go"},"region":{"startLine":336}}}],"partialFingerprints":{"codehealthFindingId/v1":"4f6357bad10e03fb86f9d2da623718b89deac07cdac29d74b9643883bfddbc7a"}},{"ruleId":"D1","level":"warning","message":{"text":"ingestctrl.checkMultiIngestSupport (cyclomatic 18): ingestctrl.checkMultiIngestSupport 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":"pkg/ingestor/ingestctrl/local.go"},"region":{"startLine":713}}}],"partialFingerprints":{"codehealthFindingId/v1":"9faec6953b6ddf0c107615e3f95d0bedd3b959edfe2342fe9b2a8a7de2ef3c7c"}},{"ruleId":"D1","level":"warning","message":{"text":"Writer.flushKVs (cyclomatic 18): Writer.flushKVs has cyclomatic complexity 18 (threshold 15). Of this number, 16 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":"pkg/ingestor/simplesst/writer.go"},"region":{"startLine":573}}}],"partialFingerprints":{"codehealthFindingId/v1":"58f8e4b2128d990f6a892436beaad12b279cbfa32c34ed1ad0fd493d0735b063"}},{"ruleId":"D1","level":"warning","message":{"text":"tidbBackend.execStmts (cyclomatic 18): tidbBackend.execStmts 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":"pkg/lightning/backend/tidb/tidb.go"},"region":{"startLine":843}}}],"partialFingerprints":{"codehealthFindingId/v1":"c8d8d4ae03e8a7b103297c37fce16041521fa65ca050ac3fc0836a3ecce1a99a"}},{"ruleId":"D1","level":"warning","message":{"text":"mydump.buildViewImportPlan (cyclomatic 18): mydump.buildViewImportPlan 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":"pkg/lightning/mydump/view_import.go"},"region":{"startLine":294}}}],"partialFingerprints":{"codehealthFindingId/v1":"c8f9591a1bf477c202683edb60c84f230b25c856430bb75ed6404fb0f1325781"}},{"ruleId":"D1","level":"warning","message":{"text":"objstore.NewGCSStorage (cyclomatic 18): objstore.NewGCSStorage 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":"pkg/objstore/gcs.go"},"region":{"startLine":440}}}],"partialFingerprints":{"codehealthFindingId/v1":"b9ef3e2c4536d7449f203387698de9aae4780a477f9a30ddb82aa147a07058a7"}},{"ruleId":"D1","level":"warning","message":{"text":"PossiblePropertiesInfo.Equals (cyclomatic 18): PossiblePropertiesInfo.Equals 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":"pkg/planner/core/base/plan_base.go"},"region":{"startLine":409}}}],"partialFingerprints":{"codehealthFindingId/v1":"f5bb46ef5b02747dddf8a8ccaa8ecba03df25abe76608b4c60307bdde3ee754c"}},{"ruleId":"D1","level":"warning","message":{"text":"core.generateIndexMergePath (cyclomatic 18): core.generateIndexMergePath has cyclomatic complexity 18 (threshold 15). Of this number, 16 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":"pkg/planner/core/indexmerge_path.go"},"region":{"startLine":47}}}],"partialFingerprints":{"codehealthFindingId/v1":"eb95dcae96d5f91c51fcda416636381f91a355e798f18e6eb4e8461315568b04"}},{"ruleId":"D1","level":"warning","message":{"text":"core.buildRangeForTableScan (cyclomatic 18): core.buildRangeForTableScan 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":"pkg/planner/core/plan_cache_rebuild.go"},"region":{"startLine":183}}}],"partialFingerprints":{"codehealthFindingId/v1":"74c0fc71f93bfdc33dc86bf3fed8082b4515399c19176db4fe8e9a50c586e25d"}},{"ruleId":"D1","level":"warning","message":{"text":"core.checkTypesCompatibility4PC (cyclomatic 18): core.checkTypesCompatibility4PC has cyclomatic complexity 18 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/plan_cache_utils.go"},"region":{"startLine":861}}}],"partialFingerprints":{"codehealthFindingId/v1":"3e603c9d62c430344b59a6e37aef52ff375f461093c748604cb76ee0b6df0c0f"}},{"ruleId":"D1","level":"warning","message":{"text":"core.checkTableCacheable (cyclomatic 18): core.checkTableCacheable 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":"pkg/planner/core/plan_cacheable_checker.go"},"region":{"startLine":672}}}],"partialFingerprints":{"codehealthFindingId/v1":"0b4c6376525696a2e047e3fd27f51cb1942095e8c4a5e7c33b9d2179f352c93b"}},{"ruleId":"D1","level":"warning","message":{"text":"core.getCost4PhysicalHashJoin (cyclomatic 18): core.getCost4PhysicalHashJoin 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":"pkg/planner/core/plan_cost_ver1.go"},"region":{"startLine":814}}}],"partialFingerprints":{"codehealthFindingId/v1":"af6327b7e219f1a61f42cd5acdf3aedecad9b9c542f6da3307a8225b76203d00"}},{"ruleId":"D1","level":"warning","message":{"text":"core.collectVisitInfoFromRevokeStmt (cyclomatic 18): core.collectVisitInfoFromRevokeStmt 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":"pkg/planner/core/planbuilder.go"},"region":{"startLine":3878}}}],"partialFingerprints":{"codehealthFindingId/v1":"dc58e45704f028b00031fb2c99c0b8cd6e636181479c228b0945b4736acb6a12"}},{"ruleId":"D1","level":"warning","message":{"text":"core.getPushedDownTopN (cyclomatic 18): core.getPushedDownTopN has cyclomatic complexity 18 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/task.go"},"region":{"startLine":861}}}],"partialFingerprints":{"codehealthFindingId/v1":"89ee1f0976e6220679e18ee1cebf41cd6fa677567623598bff8669b75cfdbef1"}},{"ruleId":"D1","level":"warning","message":{"text":"ConflictDetector.CheckConnection (cyclomatic 18): ConflictDetector.CheckConnection 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":"pkg/planner/core/joinorder/conflict_detector.go"},"region":{"startLine":585}}}],"partialFingerprints":{"codehealthFindingId/v1":"609953db49c4e294a45a6b4ea551ba41e4d34b3b677bde3be7be8431bd0e120c"}},{"ruleId":"D1","level":"warning","message":{"text":"LogicalAggregation.PruneColumns (cyclomatic 18): LogicalAggregation.PruneColumns 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":"pkg/planner/core/operator/logicalop/logical_aggregation.go"},"region":{"startLine":113}}}],"partialFingerprints":{"codehealthFindingId/v1":"9a8b2916606fc858ef5f18b6e211f1c469b819705a814f661e744500cf4234d2"}},{"ruleId":"D1","level":"warning","message":{"text":"LogicalAggregation.ExtractFD (cyclomatic 18): LogicalAggregation.ExtractFD has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/operator/logicalop/logical_aggregation.go"},"region":{"startLine":346}}}],"partialFingerprints":{"codehealthFindingId/v1":"35534ca489bf99a2ebeb97eabdcd3997bcdc4d56405bd4da4948205a804d6240"}},{"ruleId":"D1","level":"warning","message":{"text":"LogicalJoin.pushDownTopNToChild (cyclomatic 18): LogicalJoin.pushDownTopNToChild 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":"pkg/planner/core/operator/logicalop/logical_join.go"},"region":{"startLine":1218}}}],"partialFingerprints":{"codehealthFindingId/v1":"7d5f00c5afaf3b1b72b97a48d54d1e3cd877234999cedf199b5cad7ae11347d8"}},{"ruleId":"D1","level":"warning","message":{"text":"LogicalWindow.EqualFrame (cyclomatic 18): LogicalWindow.EqualFrame has cyclomatic complexity 18 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/operator/logicalop/logical_window.go"},"region":{"startLine":537}}}],"partialFingerprints":{"codehealthFindingId/v1":"a7676cb5ba0007fedf5588a0b0684d57e22f463d956de4a381ac77a02cb84be6"}},{"ruleId":"D1","level":"warning","message":{"text":"PhysicalMergeJoin.ResolveIndices (cyclomatic 18): PhysicalMergeJoin.ResolveIndices 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":"pkg/planner/core/operator/physicalop/physical_merge_join.go"},"region":{"startLine":350}}}],"partialFingerprints":{"codehealthFindingId/v1":"7479b3f70b42091b62952b7e62fe8594771614933d7aea46844d09e58625a542"}},{"ruleId":"D1","level":"warning","message":{"text":"clientConn.handleStmt (cyclomatic 18): clientConn.handleStmt 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":"pkg/server/conn.go"},"region":{"startLine":2217}}}],"partialFingerprints":{"codehealthFindingId/v1":"fc6c85dd6e75aab45f29ca081bfa373c4c7d0685710b73ff56f64af938789174"}},{"ruleId":"D1","level":"warning","message":{"text":"clientConn.handleChangeUser (cyclomatic 18): clientConn.handleChangeUser has cyclomatic complexity 18 (threshold 15). Of this number, 15 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":"pkg/server/conn.go"},"region":{"startLine":2721}}}],"partialFingerprints":{"codehealthFindingId/v1":"75bdd1b8cb6c151a64baad1fc895012e8b669038321b6c424500354d2b400b1e"}},{"ruleId":"D1","level":"warning","message":{"text":"DXFTaskMaxRuntimeSlotsHandler.ServeHTTP (cyclomatic 18): DXFTaskMaxRuntimeSlotsHandler.ServeHTTP has cyclomatic complexity 18 (threshold 15). Of this number, 9 points are the body\u0027s own statements and 9 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":"pkg/server/handler/tikvhandler/dxf.go"},"region":{"startLine":440}}}],"partialFingerprints":{"codehealthFindingId/v1":"a43cdff2b67fa7c42d3c1100ec930c195162fdc7433d91d83245957a12945a00"}},{"ruleId":"D1","level":"warning","message":{"text":"DeleteKeyHandler.ServeHTTP (cyclomatic 18): DeleteKeyHandler.ServeHTTP has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, 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":"pkg/server/handler/tikvhandler/tikv_handler.go"},"region":{"startLine":2044}}}],"partialFingerprints":{"codehealthFindingId/v1":"e63c1e45ac6b1f887498555cc4694b09f108ecbaf4235cfc9872102d41524f09"}},{"ruleId":"D1","level":"warning","message":{"text":"session.runJobs (cyclomatic 18): session.runJobs 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":"pkg/session/nontransactional.go"},"region":{"startLine":268}}}],"partialFingerprints":{"codehealthFindingId/v1":"4b1d58717003cced92dbc804f94b8ba767e96d6795bd03cd4e6302bfc8b8de33"}},{"ruleId":"D1","level":"warning","message":{"text":"session.buildShardJobs (cyclomatic 18): session.buildShardJobs has cyclomatic complexity 18 (threshold 15). Of this number, 16 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":"pkg/session/nontransactional.go"},"region":{"startLine":446}}}],"partialFingerprints":{"codehealthFindingId/v1":"a1854f6badda8aeaf946a7c2dcbf2d72953ac66dabb8cc0299bd96a2cc0b01b4"}},{"ruleId":"D1","level":"warning","message":{"text":"session.selectShardColumn (cyclomatic 18): session.selectShardColumn 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":"pkg/session/nontransactional.go"},"region":{"startLine":605}}}],"partialFingerprints":{"codehealthFindingId/v1":"9349171ec700f95a85746b4ff56fb8d6e8886c4ddff29667e3226c7bbfe80269"}},{"ruleId":"D1","level":"warning","message":{"text":"session.approxCompilePlanTokenCnt (cyclomatic 18): session.approxCompilePlanTokenCnt 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":"pkg/session/session.go"},"region":{"startLine":1641}}}],"partialFingerprints":{"codehealthFindingId/v1":"f493ccd9d6c3131f461aa79528a1acb3d69efbb4a4ecfcd27e0a148a5a4e1c07"}},{"ruleId":"D1","level":"warning","message":{"text":"LoadKeyspaceController.OnServerCreated (cyclomatic 18): LoadKeyspaceController.OnServerCreated has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 2 of the 18 points are its own statements and the rest belongs to one function literal inside it that branches (line 53). 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":"pkg/standby/idle_watcher.go"},"region":{"startLine":46}}}],"partialFingerprints":{"codehealthFindingId/v1":"cc3b1c4d7449c50a58283d7c8c59c56e7e570559c320a182ffb6e21caccbf305"}},{"ruleId":"D1","level":"warning","message":{"text":"storage.TableStatsFromStorage (cyclomatic 18): storage.TableStatsFromStorage 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, 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":"pkg/statistics/handle/storage/read.go"},"region":{"startLine":455}}}],"partialFingerprints":{"codehealthFindingId/v1":"3859ebe55225a0044906a5917e37a0d6edc25326698d54635b4828e0d8ffb461"}},{"ruleId":"D1","level":"warning","message":{"text":"statsSyncLoad.handleOneItemTaskWithSCtx (cyclomatic 18): statsSyncLoad.handleOneItemTaskWithSCtx 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":"pkg/statistics/handle/syncload/stats_syncload.go"},"region":{"startLine":344}}}],"partialFingerprints":{"codehealthFindingId/v1":"3ad9ef36732695146c39680a669fd10e3b62804f6c7818cbd657022e8b00235f"}},{"ruleId":"D1","level":"warning","message":{"text":"statsUsageImpl.dumpStatsDeltaToKV (cyclomatic 18): statsUsageImpl.dumpStatsDeltaToKV 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":"pkg/statistics/handle/usage/session_stats_collect.go"},"region":{"startLine":256}}}],"partialFingerprints":{"codehealthFindingId/v1":"1cd73f5b9d644e4e90c12fd0bc1370463093f0c21dcae8e64cbd85ccddaeb9c4"}},{"ruleId":"D1","level":"warning","message":{"text":"SampleBuilder.CollectColumnStats (cyclomatic 18): SampleBuilder.CollectColumnStats 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":"pkg/statistics/sample.go"},"region":{"startLine":221}}}],"partialFingerprints":{"codehealthFindingId/v1":"a41a7fa3ca51628c4f3a9739975dad47ee5edb48660940d68d8bc0677bb2e8fa"}},{"ruleId":"D1","level":"warning","message":{"text":"coprHandler.handleAnalyzeColumnsReq (cyclomatic 18): coprHandler.handleAnalyzeColumnsReq has cyclomatic complexity 18 (threshold 15). Of this number, 16 points are the body\u0027s own statements and 2 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":"pkg/store/mockstore/mockcopr/analyze.go"},"region":{"startLine":137}}}],"partialFingerprints":{"codehealthFindingId/v1":"4f85a9074f1f5b1b9a8f8ad002cbf0490cc9ff6470034c310d750a9c1e5c434f"}},{"ruleId":"D1","level":"warning","message":{"text":"cophandler.buildClosureExecutorFromExecutorList (cyclomatic 18): cophandler.buildClosureExecutorFromExecutorList has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/store/mockstore/unistore/cophandler/closure_exec.go"},"region":{"startLine":103}}}],"partialFingerprints":{"codehealthFindingId/v1":"4a7205cde9e915d12b4d5e097dc8bf6f4993e3ef312f31f7fe5ee6c3a19cf877"}},{"ruleId":"D1","level":"warning","message":{"text":"cophandler.mppExecute (cyclomatic 18): cophandler.mppExecute has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/store/mockstore/unistore/cophandler/cop_handler.go"},"region":{"startLine":245}}}],"partialFingerprints":{"codehealthFindingId/v1":"52c994024ee082759be09efce15c1bf4a723ba48e9331fdd8b27ee27f0a3ce1e"}},{"ruleId":"D1","level":"warning","message":{"text":"MVCCStore.Scan (cyclomatic 18): MVCCStore.Scan has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/store/mockstore/unistore/tikv/mvcc.go"},"region":{"startLine":1985}}}],"partialFingerprints":{"codehealthFindingId/v1":"144e8634d422982fc13447195ecf40688eb46189af9762e10e49fd54ac87e9c2"}},{"ruleId":"D1","level":"warning","message":{"text":"table.FillVirtualColumnValue (cyclomatic 18): table.FillVirtualColumnValue 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":"pkg/table/column.go"},"region":{"startLine":770}}}],"partialFingerprints":{"codehealthFindingId/v1":"14eeabfebf86496f2c77acacfa567441b358793f7bd64106fd28c03bbfdd3e62"}},{"ruleId":"D1","level":"warning","message":{"text":"types.calcWeek (cyclomatic 18): types.calcWeek has cyclomatic complexity 18 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/types/core_time.go"},"region":{"startLine":427}}}],"partialFingerprints":{"codehealthFindingId/v1":"cbf98167f59dc6e6eb17f9aa0f38d4f7ffde30f621d0ff91e0a76aa9780e5431"}},{"ruleId":"D1","level":"warning","message":{"text":"types.jsonMarshalStringTo (cyclomatic 18): types.jsonMarshalStringTo 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":"pkg/types/json_binary.go"},"region":{"startLine":420}}}],"partialFingerprints":{"codehealthFindingId/v1":"a38cadc642b0779cad0d6a49bc963c12e7a1347aa9040f09092a08100345aad9"}},{"ruleId":"D1","level":"warning","message":{"text":"Datum.convertToUint (cyclomatic 18): Datum.convertToUint has cyclomatic complexity 18 (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/types/datum.go"},"region":{"startLine":1319}}}],"partialFingerprints":{"codehealthFindingId/v1":"dedea22572e5c2b46d547f25a20963cf9e98647de27f8445260875cbec2be924"}},{"ruleId":"D1","level":"warning","message":{"text":"MemArbitrator.tryToUpdateBuffer (cyclomatic 18): MemArbitrator.tryToUpdateBuffer 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":"pkg/util/memory/arbitrator.go"},"region":{"startLine":1132}}}],"partialFingerprints":{"codehealthFindingId/v1":"0d0f9cdd9dc42f5fa736921bd78ba85b6885aab70b6047d6f43a1b9aa3ff6eaa"}},{"ruleId":"D1","level":"warning","message":{"text":"plancodec.printAccessObject (cyclomatic 18): plancodec.printAccessObject 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":"pkg/util/plancodec/binary_plan_decode.go"},"region":{"startLine":317}}}],"partialFingerprints":{"codehealthFindingId/v1":"28b4b2ce668a114ba88b22be581f9313257f84addfcacc5f3e5a5f527163229a"}},{"ruleId":"D1","level":"warning","message":{"text":"ranger.handleEnumFromBinOp (cyclomatic 18): ranger.handleEnumFromBinOp 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":"pkg/util/ranger/points.go"},"region":{"startLine":519}}}],"partialFingerprints":{"codehealthFindingId/v1":"7ab16313e70c07e70713240e1a6792feeebd13801aa0932a8b11588ff3171a2c"}},{"ruleId":"D1","level":"warning","message":{"text":"GrantStmt.Restore (cyclomatic 18): GrantStmt.Restore 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":"pkg/parser/ast/misc.go"},"region":{"startLine":3297}}}],"partialFingerprints":{"codehealthFindingId/v1":"668fde7f72740380e128c9711e8196f68ed91a4bbd2523c2cabcdffa7eff0770"}},{"ruleId":"D1","level":"warning","message":{"text":"FieldType.Restore (cyclomatic 18): FieldType.Restore 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":"pkg/parser/types/field_type.go"},"region":{"startLine":566}}}],"partialFingerprints":{"codehealthFindingId/v1":"74073eac843500b52f6b55a3190c7519a56496af7a89e7dba8f9be665afac5f4"}},{"ruleId":"D1","level":"warning","message":{"text":"main.streamCommand (cyclomatic 17): main.streamCommand has cyclomatic complexity 17 (threshold 15). Of this number, 16 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":"br/cmd/br/stream.go"},"region":{"startLine":178}}}],"partialFingerprints":{"codehealthFindingId/v1":"c81a011eccb314d110e5ad65b990fb006dea1e1aeb9eb5e19bad353773eac939"}},{"ruleId":"D1","level":"warning","message":{"text":"backup.BuildBackupRangeAndInitSchema (cyclomatic 17): backup.BuildBackupRangeAndInitSchema has cyclomatic complexity 17 (threshold 15). Of this number, 13 points are the body\u0027s own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"br/pkg/backup/client.go"},"region":{"startLine":754}}}],"partialFingerprints":{"codehealthFindingId/v1":"af2d24e6e231910125d356a134d03ea4c8c4fbeec6a9cb0a50b87e9b59bc479c"}},{"ruleId":"D1","level":"warning","message":{"text":"schemaInfo.checkMergeOptionAllowed (cyclomatic 17): schemaInfo.checkMergeOptionAllowed 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":"br/pkg/backup/schema.go"},"region":{"startLine":328}}}],"partialFingerprints":{"codehealthFindingId/v1":"a9c4eab500ebb4e59d04ea1ab4788ba602522d3051429fcb48e370d43157af7b"}},{"ruleId":"D1","level":"warning","message":{"text":"conn.NewMgr (cyclomatic 17): conn.NewMgr has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"br/pkg/conn/conn.go"},"region":{"startLine":150}}}],"partialFingerprints":{"codehealthFindingId/v1":"f61f737c5ed8af9f0a225b2561743c653fc6cf1cc950f7ad2cfe7df6ca4460e8"}},{"ruleId":"D1","level":"warning","message":{"text":"SnapClient.AllocTableIDs (cyclomatic 17): SnapClient.AllocTableIDs 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":"br/pkg/restore/snap_client/client.go"},"region":{"startLine":407}}}],"partialFingerprints":{"codehealthFindingId/v1":"46b2a46a8ffdca4af2a82393352d067f9e180149159b92e51b190895127ca547"}},{"ruleId":"D1","level":"warning","message":{"text":"SnapClient.checkPrivilegeTableRowsCollateCompatibility (cyclomatic 17): SnapClient.checkPrivilegeTableRowsCollateCompatibility 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":"br/pkg/restore/snap_client/systable_restore.go"},"region":{"startLine":717}}}],"partialFingerprints":{"codehealthFindingId/v1":"786a13eeb038d27c3ac2e1ccbcb84891e06ff51f262291cce49f0e4d4fa47f04"}},{"ruleId":"D1","level":"warning","message":{"text":"split.sendSplitRegionRequest (cyclomatic 17): split.sendSplitRegionRequest 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":"br/pkg/restore/split/client.go"},"region":{"startLine":415}}}],"partialFingerprints":{"codehealthFindingId/v1":"da086c5741717765f44d3c12ab9728c710edd789fcd4cf77e39d3380ee2a80d1"}},{"ruleId":"D1","level":"warning","message":{"text":"pdClient.splitKeys (cyclomatic 17): pdClient.splitKeys 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 664). 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":"br/pkg/restore/split/client.go"},"region":{"startLine":640}}}],"partialFingerprints":{"codehealthFindingId/v1":"8adab48b3c86eb4f3090e2064ffa99e06261b7e64354a5a7ec43f27d96eb7043"}},{"ruleId":"D1","level":"warning","message":{"text":"logCollector.Summary (cyclomatic 17): logCollector.Summary 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":"br/pkg/summary/collector.go"},"region":{"startLine":186}}}],"partialFingerprints":{"codehealthFindingId/v1":"a05988ddb0e2a3d697ce0e1dc8ea58d9faee371b133f4569d4aa0706a48938b8"}},{"ruleId":"D1","level":"warning","message":{"text":"task.RunBackupTxn (cyclomatic 17): task.RunBackupTxn has cyclomatic complexity 17 (threshold 15). Of this number, 14 points are the body\u0027s own statements and 3 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":"br/pkg/task/backup_txn.go"},"region":{"startLine":108}}}],"partialFingerprints":{"codehealthFindingId/v1":"0b7ac7e2cbc4d1b8ed08127fc9a791acacd9096ea8523dfa99843c2fce814059"}},{"ruleId":"D1","level":"warning","message":{"text":"task.RunResolveKvData (cyclomatic 17): task.RunResolveKvData has cyclomatic complexity 17 (threshold 15). Of this number, 14 points are the body\u0027s own statements and 3 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":"br/pkg/task/restore_data.go"},"region":{"startLine":45}}}],"partialFingerprints":{"codehealthFindingId/v1":"5a025b0c573a98025e17b12c53c8f385a844afe3e6946149503489a91fe9d6dc"}},{"ruleId":"D1","level":"warning","message":{"text":"version.CheckVersionForBR (cyclomatic 17): version.CheckVersionForBR has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"br/pkg/version/version.go"},"region":{"startLine":193}}}],"partialFingerprints":{"codehealthFindingId/v1":"961055fcf904a1d8498b8ae10d15f41f6db2d0209e0697eb98c0b40f1e0c7476"}},{"ruleId":"D1","level":"warning","message":{"text":"main.main (cyclomatic 17): main.main 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":"cmd/importer/main.go"},"region":{"startLine":26}}}],"partialFingerprints":{"codehealthFindingId/v1":"1f089ab04fe55671f0a9f92372331ad64a85b5971a916a9f2c6a8feb4e93fd98"}},{"ruleId":"D1","level":"warning","message":{"text":"main.main (cyclomatic 17): main.main has cyclomatic complexity 17 (threshold 15). Of this number, 16 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":"cmd/pluginpkg/pluginpkg.go"},"region":{"startLine":91}}}],"partialFingerprints":{"codehealthFindingId/v1":"e155c6452d4e0b235b49caebda6dca7afc36005a1bbb2cc5cd7637b2b40841fc"}},{"ruleId":"D1","level":"warning","message":{"text":"PreImportInfoGetterImpl.EstimateSourceDataSize (cyclomatic 17): PreImportInfoGetterImpl.EstimateSourceDataSize 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":"lightning/pkg/importer/get_pre_info.go"},"region":{"startLine":530}}}],"partialFingerprints":{"codehealthFindingId/v1":"548f0422f451eb14db6049b49ffdf9b85ffc524f50edb8aa24fd6aa44c7f849e"}},{"ruleId":"D1","level":"warning","message":{"text":"dbTaskMetaMgr.CheckAndFinishRestore (cyclomatic 17): dbTaskMetaMgr.CheckAndFinishRestore has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 3 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 908). 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":"lightning/pkg/importer/meta_manager.go"},"region":{"startLine":890}}}],"partialFingerprints":{"codehealthFindingId/v1":"c26bc3b43fd8975b2d774d791e5afb7fda4bb3ce86fc3b507412f5690d689e61"}},{"ruleId":"D1","level":"warning","message":{"text":"checkpointCheckItem.checkpointIsValid (cyclomatic 17): checkpointCheckItem.checkpointIsValid 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":"lightning/pkg/importer/precheck_impl.go"},"region":{"startLine":683}}}],"partialFingerprints":{"codehealthFindingId/v1":"97a3341363e5c0e619acc1d78a3f99faec563bb18cdc56e110a74605382ef8a0"}},{"ruleId":"D1","level":"warning","message":{"text":"tableEmptyCheckItem.Check (cyclomatic 17): tableEmptyCheckItem.Check has cyclomatic complexity 17 (threshold 15). Of this number, 10 points are the body\u0027s own statements and 7 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":"lightning/pkg/importer/precheck_impl.go"},"region":{"startLine":1384}}}],"partialFingerprints":{"codehealthFindingId/v1":"453c3e5b8d62f39ffb7695433c0088287f59db0b9df553014aae4454a590f9c6"}},{"ruleId":"D1","level":"warning","message":{"text":"DefaultJobMonitor.processJobStatuses (cyclomatic 17): DefaultJobMonitor.processJobStatuses 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":"lightning/pkg/importinto/job_monitor.go"},"region":{"startLine":158}}}],"partialFingerprints":{"codehealthFindingId/v1":"e48960a1c4945a68034ec1072f286bfad22422a4b1f078ec6a43184c7c805d9b"}},{"ruleId":"D1","level":"warning","message":{"text":"bindingOperator.CreateBinding (cyclomatic 17): bindingOperator.CreateBinding has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 5 of the 17 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 81, 70). 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":"pkg/bindinfo/binding_operator.go"},"region":{"startLine":64}}}],"partialFingerprints":{"codehealthFindingId/v1":"f74df5b35112fb8aaa048f8509025e3e531eee83c457445640aa4f4baf7c8b89"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.generateGlobalSortIngestPlan (cyclomatic 17): ddl.generateGlobalSortIngestPlan has cyclomatic complexity 17 (threshold 15). Of this number, 14 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":"pkg/ddl/backfilling_dist_scheduler.go"},"region":{"startLine":457}}}],"partialFingerprints":{"codehealthFindingId/v1":"70ea3b870a06fb2d65c61ffcb5fa1f8f5fcb9082a3bc45eaf2405f1cab054e0d"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.BuildTableInfoWithStmt (cyclomatic 17): ddl.BuildTableInfoWithStmt has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/create_table.go"},"region":{"startLine":793}}}],"partialFingerprints":{"codehealthFindingId/v1":"362643fc3709d057b512407b790ec21339dcd4239b679e6c7bb14d4dca7db6db"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.BuildHiddenColumnInfo (cyclomatic 17): ddl.BuildHiddenColumnInfo 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":"pkg/ddl/create_table.go"},"region":{"startLine":1591}}}],"partialFingerprints":{"codehealthFindingId/v1":"871a94b54ea41e0f5b93a33c7d6cae2a83a52f70d32916eeb81d65d0f57b2eb1"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.checkIndexNeededInForeignKey (cyclomatic 17): ddl.checkIndexNeededInForeignKey has cyclomatic complexity 17 (threshold 15). Of this number, 10 points are the body\u0027s own statements and 7 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":"pkg/ddl/foreign_key.go"},"region":{"startLine":443}}}],"partialFingerprints":{"codehealthFindingId/v1":"3d45e3d51d799b1c5c8ed80305f12bfeb2154f557eff36a18a193cbc130c2cbe"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.checkModifyGeneratedColumn (cyclomatic 17): ddl.checkModifyGeneratedColumn 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":"pkg/ddl/generated_column.go"},"region":{"startLine":202}}}],"partialFingerprints":{"codehealthFindingId/v1":"0ac38b3f8c4237b1b3365314152fe96e3a96edecc4d12eabe6a680a6db254a43"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.getModifyColumnType (cyclomatic 17): ddl.getModifyColumnType has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body\u0027s own statements and 2 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":"pkg/ddl/modify_column.go"},"region":{"startLine":83}}}],"partialFingerprints":{"codehealthFindingId/v1":"6e650016c308391deb4e44e6f8b0a996c7ad85fd71586ef90e2365b9665d57ee"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.comparePartitionAstAndModel (cyclomatic 17): ddl.comparePartitionAstAndModel has cyclomatic complexity 17 (threshold 15). Of this number, 15 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":"pkg/ddl/partition.go"},"region":{"startLine":967}}}],"partialFingerprints":{"codehealthFindingId/v1":"3fd9ca0e20ba6093810ad01084e41a65834ea280d8a566b41d29f00116915af0"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.buildRangePartitionDefinitions (cyclomatic 17): ddl.buildRangePartitionDefinitions 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":"pkg/ddl/partition.go"},"region":{"startLine":1638}}}],"partialFingerprints":{"codehealthFindingId/v1":"398690cf6f2ff62aac5694070dcd072ff59adcb218e3030f9d42d74cbff096ba"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.AppendPartitionDefs (cyclomatic 17): ddl.AppendPartitionDefs 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":"pkg/ddl/partition.go"},"region":{"startLine":5196}}}],"partialFingerprints":{"codehealthFindingId/v1":"f75d6e329e6a668254cc50bac12a4e2c3366cbf525d20603cacee61ff13cdfa1"}},{"ruleId":"D1","level":"warning","message":{"text":"bdr.IsAddColumnDenied (cyclomatic 17): bdr.IsAddColumnDenied has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/bdr/bdr.go"},"region":{"startLine":27}}}],"partialFingerprints":{"codehealthFindingId/v1":"b88e56d5b6a1d4fb67f5b1e4e935c1dc7dff0dee828aa13a68434a1bc56e2273"}},{"ruleId":"D1","level":"warning","message":{"text":"updateColumnWorker.getRowRecord (cyclomatic 17): updateColumnWorker.getRowRecord has cyclomatic complexity 17 (threshold 15). Of this number, 14 points are the body\u0027s own statements and 3 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":"pkg/ddl/column.go"},"region":{"startLine":749}}}],"partialFingerprints":{"codehealthFindingId/v1":"4e857e6507118c3f258b9d03b31a1a1a8b0c5d14706be5d6adfc41c3a2a8a1a2"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.refreshTiFlashPlacementRules (cyclomatic 17): ddl.refreshTiFlashPlacementRules has cyclomatic complexity 17 (threshold 15). Of this number, 16 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":"pkg/ddl/ddl_tiflash_api.go"},"region":{"startLine":549}}}],"partialFingerprints":{"codehealthFindingId/v1":"c2b2aef088dbbe107237cec58a877d5efdba93209fdd419c96537895fb15305c"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.PollTiFlashRoutine (cyclomatic 17): ddl.PollTiFlashRoutine 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":"pkg/ddl/ddl_tiflash_api.go"},"region":{"startLine":638}}}],"partialFingerprints":{"codehealthFindingId/v1":"7dd5c4fc2e7ca4354e62a7aae2e909c1528cd8e23568bcf61b7368fa99f1cd38"}},{"ruleId":"D1","level":"warning","message":{"text":"executor.CreatePrimaryKey (cyclomatic 17): executor.CreatePrimaryKey has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/executor.go"},"region":{"startLine":4781}}}],"partialFingerprints":{"codehealthFindingId/v1":"49c63db1cd6fca85ad234ee69333311a5dfe8c06fe3c2db6c668e646cd862bab"}},{"ruleId":"D1","level":"warning","message":{"text":"cleanUpIndexWorker.BackfillData (cyclomatic 17): cleanUpIndexWorker.BackfillData has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 3785, 3858, 3776). 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":"pkg/ddl/index.go"},"region":{"startLine":3775}}}],"partialFingerprints":{"codehealthFindingId/v1":"c0cb080572475168a6a7f4d8400f22c0852cbeebb547211453e7d615e5d56445"}},{"ruleId":"D1","level":"warning","message":{"text":"mergeIndexWorker.BackfillData (cyclomatic 17): mergeIndexWorker.BackfillData has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 7 of the 17 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 186, 265). 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":"pkg/ddl/index_merge_tmp.go"},"region":{"startLine":166}}}],"partialFingerprints":{"codehealthFindingId/v1":"7eccd03a45d7b2ba5722f3374a0d55f8f3b2e4b67f156225983ab2f97f707f58"}},{"ruleId":"D1","level":"warning","message":{"text":"jobScheduler.loadAndDeliverJobs (cyclomatic 17): jobScheduler.loadAndDeliverJobs 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":"pkg/ddl/job_scheduler.go"},"region":{"startLine":379}}}],"partialFingerprints":{"codehealthFindingId/v1":"b64cbc58f10330c339e5675e533647b6f3c75cbee17f849781481ae4cbe039ec"}},{"ruleId":"D1","level":"warning","message":{"text":"selectResultRuntimeStats.String (cyclomatic 17): selectResultRuntimeStats.String 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":"pkg/distsql/select_result.go"},"region":{"startLine":1112}}}],"partialFingerprints":{"codehealthFindingId/v1":"1b3e6144fe35f402d8dd65505fe32ccf40d240252b42a974fb287884d02140ac"}},{"ruleId":"D1","level":"warning","message":{"text":"Domain.Init (cyclomatic 17): Domain.Init has cyclomatic complexity 17 (threshold 15). Of this number, 15 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":"pkg/domain/domain.go"},"region":{"startLine":652}}}],"partialFingerprints":{"codehealthFindingId/v1":"b45af684e18c54223daeaf0cab20fdd0e8591d2a0e81186daecdc0cf3905234b"}},{"ruleId":"D1","level":"warning","message":{"text":"importinto.doSubmitTask (cyclomatic 17): importinto.doSubmitTask has cyclomatic complexity 17 (threshold 15). Of this number, 10 points are the body\u0027s own statements and 7 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/dxf/importinto/job.go"},"region":{"startLine":78}}}],"partialFingerprints":{"codehealthFindingId/v1":"d1b5c3d2111c632393ebf4d0b3402d841cda957d8574794cf161a4bd6d343b49"}},{"ruleId":"D1","level":"warning","message":{"text":"importinto.collectConflictInfos (cyclomatic 17): importinto.collectConflictInfos 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":"pkg/dxf/importinto/planner.go"},"region":{"startLine":819}}}],"partialFingerprints":{"codehealthFindingId/v1":"8edcb85b39cfed043e369bfc424bf62c18c03c939db3f2fcf875d0fed7d2087e"}},{"ruleId":"D1","level":"warning","message":{"text":"executor.SetSlowLogItems (cyclomatic 17): executor.SetSlowLogItems 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":"pkg/executor/adapter_slow_log.go"},"region":{"startLine":191}}}],"partialFingerprints":{"codehealthFindingId/v1":"7cc91c8f1cf082cbef2afa415aa054cb751975f99d0775a72f49de20fd8390cc"}},{"ruleId":"D1","level":"warning","message":{"text":"executor.dataForAnalyzeStatusHelper (cyclomatic 17): executor.dataForAnalyzeStatusHelper 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":"pkg/executor/infoschema_reader.go"},"region":{"startLine":2550}}}],"partialFingerprints":{"codehealthFindingId/v1":"8b42a0fd8425bcc0fc92e7bab501183b651166dcecac449a495d4d6509e9f327"}},{"ruleId":"D1","level":"warning","message":{"text":"ExecStmt.SummaryStmt (cyclomatic 17): ExecStmt.SummaryStmt has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/adapter.go"},"region":{"startLine":2193}}}],"partialFingerprints":{"codehealthFindingId/v1":"86586770d76580d3a308dcd1bfe2309428a0cfd93d94c269456a51078520dd87"}},{"ruleId":"D1","level":"warning","message":{"text":"HashAggExec.execute (cyclomatic 17): HashAggExec.execute has cyclomatic complexity 17 (threshold 15). Of this number, 14 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":"pkg/executor/aggregate/agg_hash_executor.go"},"region":{"startLine":732}}}],"partialFingerprints":{"codehealthFindingId/v1":"b41230d979bdd02893bcbb95ef0989331f25201d8332951d3ed36f172d4d5142"}},{"ruleId":"D1","level":"warning","message":{"text":"indexWorker.fetchHandlesRolling (cyclomatic 17): indexWorker.fetchHandlesRolling has cyclomatic complexity 17 (threshold 15). Of this number, 12 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":"pkg/executor/distsql.go"},"region":{"startLine":1476}}}],"partialFingerprints":{"codehealthFindingId/v1":"5ebc3189ea3f61c705704a0c19361204c2189e464d6e04935835395adc6bbc90"}},{"ruleId":"D1","level":"warning","message":{"text":"TableKVEncoder.parserData2TableData (cyclomatic 17): TableKVEncoder.parserData2TableData has cyclomatic complexity 17 (threshold 15). Of this number, 15 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":"pkg/executor/importer/kv_encode.go"},"region":{"startLine":109}}}],"partialFingerprints":{"codehealthFindingId/v1":"8f047b51b868ace426c3fce18bb4d53a9a6380359680f5b6008eff8c1e8e199e"}},{"ruleId":"D1","level":"warning","message":{"text":"IndexMergeReaderExecutor.buildPartialWorkerKVRanges (cyclomatic 17): IndexMergeReaderExecutor.buildPartialWorkerKVRanges 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":"pkg/executor/index_merge_reader.go"},"region":{"startLine":245}}}],"partialFingerprints":{"codehealthFindingId/v1":"85d7cdc094602c362374518e7110e8fe2981e101f32aa81ab771a9f134d17f17"}},{"ruleId":"D1","level":"warning","message":{"text":"partialTableWorker.extractTaskHandles (cyclomatic 17): partialTableWorker.extractTaskHandles 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":"pkg/executor/index_merge_reader.go"},"region":{"startLine":733}}}],"partialFingerprints":{"codehealthFindingId/v1":"a6d241682128d74bf70876fe7a21ea848d72ef4fd980c9a67b63a67b74759b90"}},{"ruleId":"D1","level":"warning","message":{"text":"partialIndexWorker.extractTaskHandles (cyclomatic 17): partialIndexWorker.extractTaskHandles 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":"pkg/executor/index_merge_reader.go"},"region":{"startLine":1830}}}],"partialFingerprints":{"codehealthFindingId/v1":"2cd7c6adec24ea9305ed5f77393168ff968100354f16d3e737ee0b870c03a9f1"}},{"ruleId":"D1","level":"warning","message":{"text":"indexMergeTableScanWorker.executeTask (cyclomatic 17): indexMergeTableScanWorker.executeTask 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":"pkg/executor/index_merge_reader.go"},"region":{"startLine":1988}}}],"partialFingerprints":{"codehealthFindingId/v1":"80dc5c76731e0303b683f7d407b83727733095da3a38ff2bd496fb47844df8d0"}},{"ruleId":"D1","level":"warning","message":{"text":"memtableRetriever.setDataFromTables (cyclomatic 17): memtableRetriever.setDataFromTables has cyclomatic complexity 17 (threshold 15). Of this number, 13 points are the body\u0027s own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/infoschema_reader.go"},"region":{"startLine":831}}}],"partialFingerprints":{"codehealthFindingId/v1":"96406a28845c116d29e3b12c8c82901cc509efda282db98f465f2cf5c4ca855a"}},{"ruleId":"D1","level":"warning","message":{"text":"metricNode.initializeMetricValue (cyclomatic 17): metricNode.initializeMetricValue has cyclomatic complexity 17 (threshold 15). Of this number, 12 points are the body\u0027s own statements and 5 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":"pkg/executor/inspection_profile.go"},"region":{"startLine":199}}}],"partialFingerprints":{"codehealthFindingId/v1":"e40c94efcdeb25d3e6888a7e978c98989adcf14e129d91e647d1c260d24be90e"}},{"ruleId":"D1","level":"warning","message":{"text":"testutil.BuildMockDataSource (cyclomatic 17): testutil.BuildMockDataSource has cyclomatic complexity 17 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/internal/testutil/testutil.go"},"region":{"startLine":269}}}],"partialFingerprints":{"codehealthFindingId/v1":"100e9250864ecce790ed3d4156c76e6b688fc63b4cc2ea82cc88fc302463d1fd"}},{"ruleId":"D1","level":"warning","message":{"text":"hashRowContainer.PutChunkSelected (cyclomatic 17): hashRowContainer.PutChunkSelected 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":"pkg/executor/join/hash_table_v1.go"},"region":{"startLine":437}}}],"partialFingerprints":{"codehealthFindingId/v1":"65145413f9dcda1455f01bc437d69dc4d8c0d57258e30c82f59cb7b0f84ae821"}},{"ruleId":"D1","level":"warning","message":{"text":"clusterLogRetriever.startRetrieving (cyclomatic 17): clusterLogRetriever.startRetrieving has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 5 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 502). 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":"pkg/executor/memtable_reader.go"},"region":{"startLine":470}}}],"partialFingerprints":{"codehealthFindingId/v1":"a5b909610e97cb3145b315a5adeb0efbed004b2439d43fe503464a41e725ac47"}},{"ruleId":"D1","level":"warning","message":{"text":"tikvRegionPeersRetriever.retrieve (cyclomatic 17): tikvRegionPeersRetriever.retrieve 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":"pkg/executor/memtable_reader.go"},"region":{"startLine":911}}}],"partialFingerprints":{"codehealthFindingId/v1":"4b55bb9e626f3e23c347cf99ee4ae7fe23a6fcfa12848e5290dee19f7e921578"}},{"ruleId":"D1","level":"warning","message":{"text":"PlanReplayerLoadInfo.Update (cyclomatic 17): PlanReplayerLoadInfo.Update 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":"pkg/executor/plan_replayer.go"},"region":{"startLine":651}}}],"partialFingerprints":{"codehealthFindingId/v1":"b79afc31c501ef911ae93ee4fb9c4b96e875f1ba87bfd749dca65a4a87a491e7"}},{"ruleId":"D1","level":"warning","message":{"text":"PrepareExec.Next (cyclomatic 17): PrepareExec.Next has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/prepared.go"},"region":{"startLine":82}}}],"partialFingerprints":{"codehealthFindingId/v1":"015dbd43d2270d3dd5944db4828d35058f4f83d9d975b2c396f967f8ba86d50e"}},{"ruleId":"D1","level":"warning","message":{"text":"ShowExec.fetchShowTableStatus (cyclomatic 17): ShowExec.fetchShowTableStatus has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/show.go"},"region":{"startLine":636}}}],"partialFingerprints":{"codehealthFindingId/v1":"482b7c3d908dc0c2c9e627ab0cfa4bb71e3f41ecbe075686d252534fbae6600c"}},{"ruleId":"D1","level":"warning","message":{"text":"SimpleExec.executeRefreshStatsOnCurrentInstance (cyclomatic 17): SimpleExec.executeRefreshStatsOnCurrentInstance 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":"pkg/executor/simple.go"},"region":{"startLine":3234}}}],"partialFingerprints":{"codehealthFindingId/v1":"df24160bb3a9deaaafcaac96154cf81d0d165d2cc138ccbb421e4809532c3e84"}},{"ruleId":"D1","level":"warning","message":{"text":"PipelinedWindowExec.Next (cyclomatic 17): PipelinedWindowExec.Next 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":"pkg/executor/windows/pipelined_window.go"},"region":{"startLine":117}}}],"partialFingerprints":{"codehealthFindingId/v1":"5a65e3c5e88bd1e4af332d5da55a14a3ef216fbb055baf66efe614fcf9f04934"}},{"ruleId":"D1","level":"warning","message":{"text":"baseFuncDesc.WrapCastForAggArgs (cyclomatic 17): baseFuncDesc.WrapCastForAggArgs has cyclomatic complexity 17 (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/expression/aggregation/base_func.go"},"region":{"startLine":500}}}],"partialFingerprints":{"codehealthFindingId/v1":"d3bafeedbc84fe16aa1b8090607cceaa96c0768a54628b42fcf9ecf276817f8c"}},{"ruleId":"D1","level":"warning","message":{"text":"expression.rowBasedFilter (cyclomatic 17): expression.rowBasedFilter 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":"pkg/expression/chunk_executor.go"},"region":{"startLine":465}}}],"partialFingerprints":{"codehealthFindingId/v1":"2c4060e6e8bc20fb316ce26bb6b5c41962ca42102f535077ec9f6f3285f7d12c"}},{"ruleId":"D1","level":"warning","message":{"text":"expression.VecEvalBool (cyclomatic 17): expression.VecEvalBool 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":"pkg/expression/expression.go"},"region":{"startLine":420}}}],"partialFingerprints":{"codehealthFindingId/v1":"1b4b669fe2b49b575697d7faf3a437066f7283a868f3483ee4963e307ddba89f"}},{"ruleId":"D1","level":"warning","message":{"text":"builtinArithmeticIntDivideDecimalSig.vecEvalInt (cyclomatic 17): builtinArithmeticIntDivideDecimalSig.vecEvalInt 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":"pkg/expression/builtin_arithmetic_vec.go"},"region":{"startLine":567}}}],"partialFingerprints":{"codehealthFindingId/v1":"f600370ea423e81a4ccbec1f68aee31d9459c39f5c1b8fbf0811342b74022856"}},{"ruleId":"D1","level":"warning","message":{"text":"caseWhenFunctionClass.getFunction (cyclomatic 17): caseWhenFunctionClass.getFunction has cyclomatic complexity 17 (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/expression/builtin_control.go"},"region":{"startLine":317}}}],"partialFingerprints":{"codehealthFindingId/v1":"520424ac327780f21ed092c789d5993b824f4a26a72f7e7d1f0a108e97b57da3"}},{"ruleId":"D1","level":"warning","message":{"text":"builtinTiDBMVCCInfoSig.evalString (cyclomatic 17): builtinTiDBMVCCInfoSig.evalString has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/builtin_info.go"},"region":{"startLine":959}}}],"partialFingerprints":{"codehealthFindingId/v1":"0dc276039d88204714d70cbab9b81151fdf6e91c85f1d5d799de802fdd634e9d"}},{"ruleId":"D1","level":"warning","message":{"text":"builtinJSONContainsPathSig.evalInt (cyclomatic 17): builtinJSONContainsPathSig.evalInt has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/builtin_json.go"},"region":{"startLine":850}}}],"partialFingerprints":{"codehealthFindingId/v1":"3c3bcae8916d54cb219ee4dca10b201e751e021ed53ab5f623e93b90615aa182"}},{"ruleId":"D1","level":"warning","message":{"text":"builtinJSONContainsSig.vecEvalInt (cyclomatic 17): builtinJSONContainsSig.vecEvalInt 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":"pkg/expression/builtin_json_vec.go"},"region":{"startLine":334}}}],"partialFingerprints":{"codehealthFindingId/v1":"a3c1bd35f709a191dd5d7b0bf9fce2c390d43e5d153a6e81df2681a9762a7dfa"}},{"ruleId":"D1","level":"warning","message":{"text":"builtinJSONLengthSig.vecEvalInt (cyclomatic 17): builtinJSONLengthSig.vecEvalInt 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":"pkg/expression/builtin_json_vec.go"},"region":{"startLine":824}}}],"partialFingerprints":{"codehealthFindingId/v1":"348818d2450e235c966e64ecfabf2136aff31b40c5d98dd42afa7963337fc08a"}},{"ruleId":"D1","level":"warning","message":{"text":"roundFunctionClass.getFunction (cyclomatic 17): roundFunctionClass.getFunction has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/builtin_math.go"},"region":{"startLine":268}}}],"partialFingerprints":{"codehealthFindingId/v1":"43364f5f44677170ede8a302089ddaf2eb40a5b5ad6acd0ecbd89601362db52b"}},{"ruleId":"D1","level":"warning","message":{"text":"builtinLpadSig.vecEvalString (cyclomatic 17): builtinLpadSig.vecEvalString 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":"pkg/expression/builtin_string_vec.go"},"region":{"startLine":972}}}],"partialFingerprints":{"codehealthFindingId/v1":"c8618f3c07e73bdd65442f5d346c344de4948f12690a9b93b185cb6db89055ad"}},{"ruleId":"D1","level":"warning","message":{"text":"builtinRpadSig.vecEvalString (cyclomatic 17): builtinRpadSig.vecEvalString 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":"pkg/expression/builtin_string_vec.go"},"region":{"startLine":1459}}}],"partialFingerprints":{"codehealthFindingId/v1":"d09dec026ac22f9c56ce5b318594b236794b05ca4320d9c28d396dfeff2d7aa9"}},{"ruleId":"D1","level":"warning","message":{"text":"builtinTiDBBoundedStalenessSig.vecEvalTime (cyclomatic 17): builtinTiDBBoundedStalenessSig.vecEvalTime 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":"pkg/expression/builtin_time_vec.go"},"region":{"startLine":833}}}],"partialFingerprints":{"codehealthFindingId/v1":"b65c0df644dc422e4d1d820776d8167e4955c0c19811a77d2a423e29306d3101"}},{"ruleId":"D1","level":"warning","message":{"text":"extension.newManifestWithSetup (cyclomatic 17): extension.newManifestWithSetup has cyclomatic complexity 17 (threshold 15). Of this number, 9 points are the body\u0027s own statements and 8 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":"pkg/extension/manifest.go"},"region":{"startLine":138}}}],"partialFingerprints":{"codehealthFindingId/v1":"18824c6322dba62ed796772cc88795a6ce3c3f537798206de16ae044067de30f"}},{"ruleId":"D1","level":"warning","message":{"text":"sqlGenerator.buildOptions (cyclomatic 17): sqlGenerator.buildOptions has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/importsdk/sql_generator.go"},"region":{"startLine":80}}}],"partialFingerprints":{"codehealthFindingId/v1":"7792d6eeab5b08b66df467657d1a0d000d09ea58518f99f9f3978a9713691a81"}},{"ruleId":"D1","level":"warning","message":{"text":"Loader.tryLoadSchemaDiffs (cyclomatic 17): Loader.tryLoadSchemaDiffs has cyclomatic complexity 17 (threshold 15). Of this number, 11 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":"pkg/infoschema/issyncer/loader.go"},"region":{"startLine":325}}}],"partialFingerprints":{"codehealthFindingId/v1":"c62bbda35d50d356605df57cb3f2ed77c78cb2a32deb25ab0ad2c2e9cdb49a97"}},{"ruleId":"D1","level":"warning","message":{"text":"Loader.fetchSchemasWithTables (cyclomatic 17): Loader.fetchSchemasWithTables 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":"pkg/infoschema/issyncer/loader.go"},"region":{"startLine":492}}}],"partialFingerprints":{"codehealthFindingId/v1":"7735f605427a4cf22ad48ed8931f2a72de99730c1a1eb975e997b09dbff9b5b3"}},{"ruleId":"D1","level":"warning","message":{"text":"globalsort.MergeOverlappingFilesV2 (cyclomatic 17): globalsort.MergeOverlappingFilesV2 has cyclomatic complexity 17 (threshold 15). Of this number, 11 points are the body\u0027s own statements and 6 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ingestor/globalsort/merge_v2.go"},"region":{"startLine":38}}}],"partialFingerprints":{"codehealthFindingId/v1":"48afb35ae5196d3bde03293fba7e42f0efeca4d88072ec6f0f5f2b07eafe9906"}},{"ruleId":"D1","level":"warning","message":{"text":"RangeSplitter.SplitOneRangesGroup (cyclomatic 17): RangeSplitter.SplitOneRangesGroup 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":"pkg/ingestor/globalsort/split.go"},"region":{"startLine":184}}}],"partialFingerprints":{"codehealthFindingId/v1":"017692c2f466bf6bb50e1b345a4ffa39ccb4390fffd9ec6728ceacc9821727a7"}},{"ruleId":"D1","level":"warning","message":{"text":"engineManager.close (cyclomatic 17): engineManager.close 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":"pkg/ingestor/ingestctrl/engine_mgr.go"},"region":{"startLine":529}}}],"partialFingerprints":{"codehealthFindingId/v1":"6562b3ea9cb8c2905b50ea77dafd34c106d80fcce3af5fb12c8e894aca74d6a1"}},{"ruleId":"D1","level":"warning","message":{"text":"mergeIter.next (cyclomatic 17): mergeIter.next 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":"pkg/ingestor/simplesst/iter.go"},"region":{"startLine":257}}}],"partialFingerprints":{"codehealthFindingId/v1":"de7d40cd6278d923f746f55e7bb4bec3daf2e1893486e89e62ad52abf16afe20"}},{"ruleId":"D1","level":"warning","message":{"text":"common.NormalizeError (cyclomatic 17): common.NormalizeError has cyclomatic complexity 17 (threshold 15). Of this number, 16 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":"pkg/lightning/common/errors.go"},"region":{"startLine":147}}}],"partialFingerprints":{"codehealthFindingId/v1":"a392417c35d4d7b5c880406ff589e6f45aa0e0ed947c43428ff175062204d581"}},{"ruleId":"D1","level":"warning","message":{"text":"mydump.ExportStatement (cyclomatic 17): mydump.ExportStatement 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":"pkg/lightning/mydump/reader.go"},"region":{"startLine":89}}}],"partialFingerprints":{"codehealthFindingId/v1":"4dacb56c92c9601df834ce8ae843c84e258c71187d9d75200c00aecc7f25ff08"}},{"ruleId":"D1","level":"warning","message":{"text":"allocator.alloc4Signed (cyclomatic 17): allocator.alloc4Signed has cyclomatic complexity 17 (threshold 15). Of this number, 12 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":"pkg/meta/autoid/autoid.go"},"region":{"startLine":889}}}],"partialFingerprints":{"codehealthFindingId/v1":"1539c7f0b2ff9c9965781bf560cae8c575c5434011db9db7c56da900789623d0"}},{"ruleId":"D1","level":"warning","message":{"text":"s3store.NewKS3Storage (cyclomatic 17): s3store.NewKS3Storage 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":"pkg/objstore/s3store/ks3.go"},"region":{"startLine":67}}}],"partialFingerprints":{"codehealthFindingId/v1":"6aaaa07a51bd974334181dc1a62852d3cd94233948af8892c0ec287cce6872a2"}},{"ruleId":"D1","level":"warning","message":{"text":"core.compareRiskRatio (cyclomatic 17): core.compareRiskRatio 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":"pkg/planner/core/find_best_task.go"},"region":{"startLine":815}}}],"partialFingerprints":{"codehealthFindingId/v1":"d4eabb5ce05d963eceae77af095f2050c43f45adbecaa7d244ac31cce74ff702"}},{"ruleId":"D1","level":"warning","message":{"text":"core.generateOtherIndexMerge (cyclomatic 17): core.generateOtherIndexMerge 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":"pkg/planner/core/indexmerge_path.go"},"region":{"startLine":516}}}],"partialFingerprints":{"codehealthFindingId/v1":"c85e0d448744749859ab1331b73ee17a67329bf685c8cf432e6fe80ecf476d63"}},{"ruleId":"D1","level":"warning","message":{"text":"core.CheckUpdateList (cyclomatic 17): core.CheckUpdateList 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":"pkg/planner/core/logical_plan_builder.go"},"region":{"startLine":6243}}}],"partialFingerprints":{"codehealthFindingId/v1":"81ba9cbae94dc3424208b421fcbd13669d1e4b644d92335449dd9815ba0f4869"}},{"ruleId":"D1","level":"warning","message":{"text":"core.collectVisitInfoFromGrantStmt (cyclomatic 17): core.collectVisitInfoFromGrantStmt 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":"pkg/planner/core/planbuilder.go"},"region":{"startLine":3952}}}],"partialFingerprints":{"codehealthFindingId/v1":"00d080f316e55adbfa81487c5d9b020e850756db397bde56214e312e8a944bac"}},{"ruleId":"D1","level":"warning","message":{"text":"core.canProjectionBeEliminatedStrict (cyclomatic 17): core.canProjectionBeEliminatedStrict 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":"pkg/planner/core/rule_eliminate_projection.go"},"region":{"startLine":52}}}],"partialFingerprints":{"codehealthFindingId/v1":"c5876523ba0a02b6167f3e8311e5be4acec375503201591cebd68520bdd17034"}},{"ruleId":"D1","level":"warning","message":{"text":"core.substituteExpression (cyclomatic 17): core.substituteExpression has cyclomatic complexity 17 (threshold 15). Of this number, 14 points are the body\u0027s own statements and 3 belong to 2 function literals inside it that branch. 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":"pkg/planner/core/rule_generate_column_substitute.go"},"region":{"startLine":116}}}],"partialFingerprints":{"codehealthFindingId/v1":"f46400d6dafe13a0be396e5211cce66bd79804d33e4b49cb9167d48ff98081e6"}},{"ruleId":"D1","level":"warning","message":{"text":"core.tryReturnDistanceFromIndex (cyclomatic 17): core.tryReturnDistanceFromIndex 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":"pkg/planner/core/task.go"},"region":{"startLine":988}}}],"partialFingerprints":{"codehealthFindingId/v1":"e69c379b70c044f9e16bed367d026db2e6350f237e9709131ef3c49336e64a8f"}},{"ruleId":"D1","level":"warning","message":{"text":"FullTextIndexResolverTopN.onEnterDataSource (cyclomatic 17): FullTextIndexResolverTopN.onEnterDataSource has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/fts_resolve_index.go"},"region":{"startLine":213}}}],"partialFingerprints":{"codehealthFindingId/v1":"b33535c06a3a4ef9f23f5649993096b27b1172ac1a268d979ed86d71acc45a54"}},{"ruleId":"D1","level":"warning","message":{"text":"joinorder.extractEqualityColumns (cyclomatic 17): joinorder.extractEqualityColumns 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":"pkg/planner/core/joinorder/ordered_leading.go"},"region":{"startLine":332}}}],"partialFingerprints":{"codehealthFindingId/v1":"157c21d6792455edcbe7f299ee6fad3453b6dee659cb8e14809f9f9d1d1f26e9"}},{"ruleId":"D1","level":"warning","message":{"text":"physicalop.CheckAggCanPushCop (cyclomatic 17): physicalop.CheckAggCanPushCop 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":"pkg/planner/core/operator/physicalop/base_physical_agg.go"},"region":{"startLine":536}}}],"partialFingerprints":{"codehealthFindingId/v1":"639ff89725b27e932b8108948ddfcfae3e328dac40c5b1f252be0413c8351c9b"}},{"ruleId":"D1","level":"warning","message":{"text":"physicalop.EncodeUniqueIndexValuesForKey (cyclomatic 17): physicalop.EncodeUniqueIndexValuesForKey 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":"pkg/planner/core/operator/physicalop/physical_utils.go"},"region":{"startLine":221}}}],"partialFingerprints":{"codehealthFindingId/v1":"dd20b5edd694e99b47272f34d0bcc97960aa957c0638f748c22e8c2d75ada3ad"}},{"ruleId":"D1","level":"warning","message":{"text":"mppTaskGenerator.generateMPPTasksForFragment (cyclomatic 17): mppTaskGenerator.generateMPPTasksForFragment 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":"pkg/planner/core/operator/physicalop/fragment.go"},"region":{"startLine":546}}}],"partialFingerprints":{"codehealthFindingId/v1":"0ab4e45f45859f3e0ddb41c2cfdcea2d369060f67eddeb03fe73f606789a5ad2"}},{"ruleId":"D1","level":"warning","message":{"text":"PhysicalIndexScan.AddSelectionConditionForGlobalIndex (cyclomatic 17): PhysicalIndexScan.AddSelectionConditionForGlobalIndex 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":"pkg/planner/core/operator/physicalop/physical_index_scan.go"},"region":{"startLine":451}}}],"partialFingerprints":{"codehealthFindingId/v1":"10d23af6984f283589d2b12d8666ef4a7bc0c7e9fe9b16675ee2368d147efae5"}},{"ruleId":"D1","level":"warning","message":{"text":"PhysicalTableReader.AccessObject (cyclomatic 17): PhysicalTableReader.AccessObject 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":"pkg/planner/core/operator/physicalop/physical_table_reader.go"},"region":{"startLine":168}}}],"partialFingerprints":{"codehealthFindingId/v1":"1c5554387c7a6de738439e79ee652213c9ab3502c4f812362aee7f58f6f21f97"}},{"ruleId":"D1","level":"warning","message":{"text":"partidx.checkIsNullRejected (cyclomatic 17): partidx.checkIsNullRejected 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":"pkg/planner/core/partidx/check_constraint.go"},"region":{"startLine":182}}}],"partialFingerprints":{"codehealthFindingId/v1":"94bb40b9ff6fa3f910dede898923d5aa00aa117d818be10be6573c874e4f418d"}},{"ruleId":"D1","level":"warning","message":{"text":"PlanBuilder.buildSelection (cyclomatic 17): PlanBuilder.buildSelection 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":"pkg/planner/core/logical_plan_builder.go"},"region":{"startLine":1349}}}],"partialFingerprints":{"codehealthFindingId/v1":"de4912d6de97c91c88002fc7c9c61c8621809e5505fe8fc97998fb172676c9e8"}},{"ruleId":"D1","level":"warning","message":{"text":"PlanBuilder.buildProjectionField (cyclomatic 17): PlanBuilder.buildProjectionField 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":"pkg/planner/core/logical_plan_builder.go"},"region":{"startLine":1541}}}],"partialFingerprints":{"codehealthFindingId/v1":"b3fc0c8b56c4ea8ff80e6a2545b8b088569f470d939989e021643f3f0788ada2"}},{"ruleId":"D1","level":"warning","message":{"text":"PlanBuilder.getFullAnalyzeColumnsInfo (cyclomatic 17): PlanBuilder.getFullAnalyzeColumnsInfo 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":"pkg/planner/core/planbuilder.go"},"region":{"startLine":2372}}}],"partialFingerprints":{"codehealthFindingId/v1":"b8aa789ad724b9204f3b09992985f2751ce4bff1fdf0722f5f4c0afa39f9173e"}},{"ruleId":"D1","level":"warning","message":{"text":"importIntoCollAssignmentChecker.Leave (cyclomatic 17): importIntoCollAssignmentChecker.Leave 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":"pkg/planner/core/planbuilder.go"},"region":{"startLine":4668}}}],"partialFingerprints":{"codehealthFindingId/v1":"939f430e2b94570b89554748b3239e71bea0a0d64b8ea57b0327b9dc7b461ecd"}},{"ruleId":"D1","level":"warning","message":{"text":"rule.updateOrPredicate (cyclomatic 17): rule.updateOrPredicate has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/rule/rule_predicate_simplification.go"},"region":{"startLine":390}}}],"partialFingerprints":{"codehealthFindingId/v1":"7fb1957a4e1706457661d3309e916e6f5207a349f311c91fc79df6968257f83b"}},{"ruleId":"D1","level":"warning","message":{"text":"rule.scoreAndSort (cyclomatic 17): rule.scoreAndSort has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 6 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 586). 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":"pkg/planner/core/rule/rule_prune_indexes.go"},"region":{"startLine":557}}}],"partialFingerprints":{"codehealthFindingId/v1":"8a464b12a460cd756c61feaa51d5f550452da1443943c6d14262669f55d12847"}},{"ruleId":"D1","level":"warning","message":{"text":"RangeColumnsPruner.partitionRangeForExpr (cyclomatic 17): RangeColumnsPruner.partitionRangeForExpr has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/rule/rule_partition_processor.go"},"region":{"startLine":2011}}}],"partialFingerprints":{"codehealthFindingId/v1":"8c992770f21f67e23e7f4051710cd78ae468f18c4bab6a81c2e55a3afdfcaa7f"}},{"ruleId":"D1","level":"warning","message":{"text":"ProjectionEliminator.eliminate (cyclomatic 17): ProjectionEliminator.eliminate has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/rule_eliminate_projection.go"},"region":{"startLine":158}}}],"partialFingerprints":{"codehealthFindingId/v1":"fdf7859e736682861b5ce37e561025dee41d5f657b6d4bffaa8ad4775c7f1d5d"}},{"ruleId":"D1","level":"warning","message":{"text":"AccessPath.SplitCorColAccessCondFromFilters (cyclomatic 17): AccessPath.SplitCorColAccessCondFromFilters 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":"pkg/planner/util/path.go"},"region":{"startLine":250}}}],"partialFingerprints":{"codehealthFindingId/v1":"f8615756afa77dea4a421a45d5e90ee042b965d789812e065b9622f1f49a284f"}},{"ruleId":"D1","level":"warning","message":{"text":"RegionHandler.ServeHTTP (cyclomatic 17): RegionHandler.ServeHTTP 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":"pkg/server/handler/tikvhandler/tikv_handler.go"},"region":{"startLine":1514}}}],"partialFingerprints":{"codehealthFindingId/v1":"43739ee96c95410c4a169952fbd39aa7ef1260f8002915fbb4de9ebe9a33a4e3"}},{"ruleId":"D1","level":"warning","message":{"text":"session.finishStmt (cyclomatic 17): session.finishStmt has cyclomatic complexity 17 (threshold 15). 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, 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":"pkg/session/tidb.go"},"region":{"startLine":205}}}],"partialFingerprints":{"codehealthFindingId/v1":"01273f5883310ce163560e36b6736fc8ff59d8d0f1af5ec89d8d95fe53f50d87"}},{"ruleId":"D1","level":"warning","message":{"text":"session.commitTxnWithTemporaryData (cyclomatic 17): session.commitTxnWithTemporaryData has cyclomatic complexity 17 (threshold 15). Of this number, 16 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":"pkg/session/session.go"},"region":{"startLine":700}}}],"partialFingerprints":{"codehealthFindingId/v1":"0bd14e3a436690c6f5b12237cde97021ccaefe4a43b4589d9a80476b74771180"}},{"ruleId":"D1","level":"warning","message":{"text":"statistics.MergeHistograms (cyclomatic 17): statistics.MergeHistograms has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/statistics/histogram.go"},"region":{"startLine":960}}}],"partialFingerprints":{"codehealthFindingId/v1":"7d48f85be578b3c4b6328be741cb0d3f75f28ae4e1ef383f55588de06a199448"}},{"ruleId":"D1","level":"warning","message":{"text":"autoanalyze.RandomPickOneTableAndTryAutoAnalyze (cyclomatic 17): autoanalyze.RandomPickOneTableAndTryAutoAnalyze 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":"pkg/statistics/handle/autoanalyze/autoanalyze.go"},"region":{"startLine":411}}}],"partialFingerprints":{"codehealthFindingId/v1":"f3236891e0d1bab55edb67dc73ae8a15b80492caaf967ee799b9b2a66e462139"}},{"ruleId":"D1","level":"warning","message":{"text":"util.UpdateSCtxVarsForStats (cyclomatic 17): util.UpdateSCtxVarsForStats has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/statistics/handle/util/util.go"},"region":{"startLine":103}}}],"partialFingerprints":{"codehealthFindingId/v1":"7d3a403ece35b54a2a3c917af969ee9f55fed4b783fc8ffb7c1454d7fa119dec"}},{"ruleId":"D1","level":"warning","message":{"text":"txn.ExtractKeyExistsErrFromHandle (cyclomatic 17): txn.ExtractKeyExistsErrFromHandle 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":"pkg/store/driver/txn/error.go"},"region":{"startLine":52}}}],"partialFingerprints":{"codehealthFindingId/v1":"4e47555e3f4c9614c8a1f29644a887fa2f5a475f4fc192e2215ded394e7d446c"}},{"ruleId":"D1","level":"warning","message":{"text":"aggExec.processAllRows (cyclomatic 17): aggExec.processAllRows 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":"pkg/store/mockstore/unistore/cophandler/mpp_exec.go"},"region":{"startLine":1380}}}],"partialFingerprints":{"codehealthFindingId/v1":"be20dea04bc816f71c0533f8a84315ced7a378b05607e7c63534c11ef922c508"}},{"ruleId":"D1","level":"warning","message":{"text":"MVCCStore.buildPessimisticLock (cyclomatic 17): MVCCStore.buildPessimisticLock 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":"pkg/store/mockstore/unistore/tikv/mvcc.go"},"region":{"startLine":663}}}],"partialFingerprints":{"codehealthFindingId/v1":"e5294b7196b24e999c144487c4fce0e6f4cd8496c0a09ee7c1e0a40593d54664"}},{"ruleId":"D1","level":"warning","message":{"text":"table.NewColDesc (cyclomatic 17): table.NewColDesc has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/table/column.go"},"region":{"startLine":410}}}],"partialFingerprints":{"codehealthFindingId/v1":"c41a4a8d90769f6e49d32e2e0b0ebb199527a2f29083d6816222e796bf342132"}},{"ruleId":"D1","level":"warning","message":{"text":"tables.corruptMutations (cyclomatic 17): tables.corruptMutations 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":"pkg/table/tables/mutation_checker.go"},"region":{"startLine":490}}}],"partialFingerprints":{"codehealthFindingId/v1":"708af867a5ede718ff0ce600163f0c7b9de8cbc4216ab8de13c7f6adaf351e9d"}},{"ruleId":"D1","level":"warning","message":{"text":"tablecodec.genIndexValueVersion0 (cyclomatic 17): tablecodec.genIndexValueVersion0 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":"pkg/tablecodec/tablecodec.go"},"region":{"startLine":1738}}}],"partialFingerprints":{"codehealthFindingId/v1":"b73664364eb24e94bf872e4de9836bae82c2714925660c1c7449d0a4d0c9ac63"}},{"ruleId":"D1","level":"warning","message":{"text":"TestKit.ExecWithContext (cyclomatic 17): TestKit.ExecWithContext 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":"pkg/testkit/testkit.go"},"region":{"startLine":390}}}],"partialFingerprints":{"codehealthFindingId/v1":"a6458426d9f71edef3935c298a3bd5ff811bebac11e0c1182e5afa34d403b499"}},{"ruleId":"D1","level":"warning","message":{"text":"BinaryJSON.Walk (cyclomatic 17): BinaryJSON.Walk has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 6 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 1367). 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":"pkg/types/json_binary_functions.go"},"region":{"startLine":1363}}}],"partialFingerprints":{"codehealthFindingId/v1":"6d906b31bd01493b95cba2bcf4a9d516e4605acf03f3d65f88de70fb12109cb6"}},{"ruleId":"D1","level":"warning","message":{"text":"Duration.convertDateFormat (cyclomatic 17): Duration.convertDateFormat has cyclomatic complexity 17 (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/types/time.go"},"region":{"startLine":1380}}}],"partialFingerprints":{"codehealthFindingId/v1":"a2e5f6bbb990a2a12e637b6e58560034b99ad9ccd50165a6e2f24d7ca93a8f5d"}},{"ruleId":"D1","level":"warning","message":{"text":"MutRow.SetDatum (cyclomatic 17): MutRow.SetDatum 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":"pkg/util/chunk/mutrow.go"},"region":{"startLine":299}}}],"partialFingerprints":{"codehealthFindingId/v1":"806621b6b3042b69e191913291e53531772a54baeb0cea0e2878019c6606c771"}},{"ruleId":"D1","level":"warning","message":{"text":"RuntimeStatsWithCommit.String (cyclomatic 17): RuntimeStatsWithCommit.String 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":"pkg/util/execdetails/runtime_stats.go"},"region":{"startLine":825}}}],"partialFingerprints":{"codehealthFindingId/v1":"3530f95e4667a869992eb8c7e5ef34c127587fe6e00dc6cadfdfa36c17f8fc7d"}},{"ruleId":"D1","level":"warning","message":{"text":"mergingIter.Seek (cyclomatic 17): mergingIter.Seek 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":"pkg/util/extsort/disk_sorter.go"},"region":{"startLine":458}}}],"partialFingerprints":{"codehealthFindingId/v1":"ec2d70d67b5323333e3cb5013b38c1883f82c26fb608cca1e365b40f60a6396a"}},{"ruleId":"D1","level":"warning","message":{"text":"MemArbitrator.shrinkDigestProfile (cyclomatic 17): MemArbitrator.shrinkDigestProfile has cyclomatic complexity 17 (threshold 15). Of this number, 10 points are the body\u0027s own statements and 7 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/util/memory/arbitrator.go"},"region":{"startLine":760}}}],"partialFingerprints":{"codehealthFindingId/v1":"068571652a37d65e2fa6150d35d03d6076d6e8692ec2e8180dead6ad3da60fa8"}},{"ruleId":"D1","level":"warning","message":{"text":"MemArbitrator.handleMemRisk (cyclomatic 17): MemArbitrator.handleMemRisk 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":"pkg/util/memory/arbitrator.go"},"region":{"startLine":2790}}}],"partialFingerprints":{"codehealthFindingId/v1":"d3b3bf456a6a4a5ed1e8677d6a8236bbef1df7e58f2253f628a5a2cd3dd6ed81"}},{"ruleId":"D1","level":"warning","message":{"text":"ranger.handleUnsignedCol (cyclomatic 17): ranger.handleUnsignedCol has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/util/ranger/points.go"},"region":{"startLine":444}}}],"partialFingerprints":{"codehealthFindingId/v1":"058d65d18f1ce6ee3420f1dd714be7ae06d37f3e02b65cedc460ee79285f6c6b"}},{"ruleId":"D1","level":"warning","message":{"text":"ranger.RangesToString (cyclomatic 17): ranger.RangesToString 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":"pkg/util/ranger/ranger.go"},"region":{"startLine":841}}}],"partialFingerprints":{"codehealthFindingId/v1":"53e6eca9dcb7a5952aec50d66b1063a6a0f2d75282dbfd3048b94e56af9081f1"}},{"ruleId":"D1","level":"warning","message":{"text":"rangeDetacher.buildRangeOnColsByCNFCond (cyclomatic 17): rangeDetacher.buildRangeOnColsByCNFCond 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":"pkg/util/ranger/ranger.go"},"region":{"startLine":553}}}],"partialFingerprints":{"codehealthFindingId/v1":"84013fcb0deff6fb43c2943e73c09214482b2b8cea685e818b5cb35600659b8f"}},{"ruleId":"D1","level":"warning","message":{"text":"builder.buildFromNot (cyclomatic 17): builder.buildFromNot 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":"pkg/util/ranger/points.go"},"region":{"startLine":863}}}],"partialFingerprints":{"codehealthFindingId/v1":"a0c81e990bdb642496d42cc149efee37553b1babdd82a2169685fa395855e015"}},{"ruleId":"D1","level":"warning","message":{"text":"servermemorylimit.killSessIfNeeded (cyclomatic 17): servermemorylimit.killSessIfNeeded has cyclomatic complexity 17 (threshold 15). Of this number, 16 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":"pkg/util/servermemorylimit/servermemorylimit.go"},"region":{"startLine":103}}}],"partialFingerprints":{"codehealthFindingId/v1":"d9c06d972aede06e802ac32fcc7fe0143348a7d7264b44c90b242103f2167712"}},{"ruleId":"D1","level":"warning","message":{"text":"ruCollecting.toTopRURecords (cyclomatic 17): ruCollecting.toTopRURecords 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":"pkg/util/topsql/reporter/ru_datamodel.go"},"region":{"startLine":473}}}],"partialFingerprints":{"codehealthFindingId/v1":"8dc5490c845fd695d4390c4cc91c78678d66a7e7f787d783cf155abd6e8d415d"}},{"ruleId":"D1","level":"warning","message":{"text":"DumpTriggerConfig.Compile (cyclomatic 17): DumpTriggerConfig.Compile 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":"pkg/util/traceevent/flightrecorder.go"},"region":{"startLine":195}}}],"partialFingerprints":{"codehealthFindingId/v1":"cf18f1531fddf8ed7d3fdc09ed2e836f9bd3fe817eefa0bb5414bc3e79570877"}},{"ruleId":"D1","level":"warning","message":{"text":"Handle.analyzeBasedOnStatementStats (cyclomatic 17): Handle.analyzeBasedOnStatementStats has cyclomatic complexity 17 (threshold 15). Of this number, 16 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":"pkg/workloadlearning/handle.go"},"region":{"startLine":115}}}],"partialFingerprints":{"codehealthFindingId/v1":"40465ddf3c7c9a755bdac75f184a9aa46804b8b20b33de9901e370635ce6d401"}},{"ruleId":"D1","level":"warning","message":{"text":"ast.IsReadOnly (cyclomatic 17): ast.IsReadOnly has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/parser/ast/util.go"},"region":{"startLine":26}}}],"partialFingerprints":{"codehealthFindingId/v1":"45c1f250cb2c4246dbb9e6b6ab7e5640573421611db6a67ef6be5b5598063cc7"}},{"ruleId":"D1","level":"warning","message":{"text":"CreateTableStmt.Accept (cyclomatic 17): CreateTableStmt.Accept 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":"pkg/parser/ast/ddl.go"},"region":{"startLine":1306}}}],"partialFingerprints":{"codehealthFindingId/v1":"012ee653c1fdd061078b429a47372c23983950b51703c559c0b5eb29cc73c499"}},{"ruleId":"D1","level":"warning","message":{"text":"PartitionDefinitionClauseIn.Validate (cyclomatic 17): PartitionDefinitionClauseIn.Validate 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":"pkg/parser/ast/ddl.go"},"region":{"startLine":4591}}}],"partialFingerprints":{"codehealthFindingId/v1":"00daac272dcee8cf1b4b1c17e5e812948d0a4e9b25519d9c0baba49a909492e5"}},{"ruleId":"D1","level":"warning","message":{"text":"ImportIntoStmt.Restore (cyclomatic 17): ImportIntoStmt.Restore 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":"pkg/parser/ast/dml.go"},"region":{"startLine":2245}}}],"partialFingerprints":{"codehealthFindingId/v1":"18b6316a590d30682c5a930a413398b149963fc488027035cb61de7061a9c537"}},{"ruleId":"D1","level":"warning","message":{"text":"hintScanner.updateSetVarValueState (cyclomatic 17): hintScanner.updateSetVarValueState 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":"pkg/parser/hintparserimpl.go"},"region":{"startLine":66}}}],"partialFingerprints":{"codehealthFindingId/v1":"99b7058e7ff35d57079eb6a3fb6a1ca85ef24c530a99dbab30aec384d2a956b3"}},{"ruleId":"D1","level":"warning","message":{"text":"FieldType.Equals (cyclomatic 17): FieldType.Equals has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/parser/types/field_type.go"},"region":{"startLine":109}}}],"partialFingerprints":{"codehealthFindingId/v1":"4d3d4bcbc2d0918067ac8bc23b714861ea7e48b9b71152bfe2a9a1bdc4ac3c4f"}},{"ruleId":"D1","level":"warning","message":{"text":"EC2Session.waitDataFSREnabled (cyclomatic 16): EC2Session.waitDataFSREnabled 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":"br/pkg/aws/ebs.go"},"region":{"startLine":369}}}],"partialFingerprints":{"codehealthFindingId/v1":"39f6aefdda85ffc2b6aa62fa96740eae0edfd15e323e6a484d80436be85b396c"}},{"ruleId":"D1","level":"warning","message":{"text":"Registry.ResumeOrCreateRegistration (cyclomatic 16): Registry.ResumeOrCreateRegistration has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 5 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 319). 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":"br/pkg/registry/registration.go"},"region":{"startLine":290}}}],"partialFingerprints":{"codehealthFindingId/v1":"e6394c55a57b7f7a6d633c4f8eaa9f69e40fdb77131b581feae5177b8cfa3540"}},{"ruleId":"D1","level":"warning","message":{"text":"Registry.FindAndDeleteMatchingTask (cyclomatic 16): Registry.FindAndDeleteMatchingTask has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 5 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 1001). 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":"br/pkg/registry/registration.go"},"region":{"startLine":973}}}],"partialFingerprints":{"codehealthFindingId/v1":"c897dd15031d3b6d267997aaae0d2a44863cba36ebab514a0c045f86b8b36dfc"}},{"ruleId":"D1","level":"warning","message":{"text":"SnapClient.GetFilesInRawRange (cyclomatic 16): SnapClient.GetFilesInRawRange 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":"br/pkg/restore/snap_client/client.go"},"region":{"startLine":921}}}],"partialFingerprints":{"codehealthFindingId/v1":"d6bf7dc3e8410f1871dc8ec5d2918e2e4ba10a6cfdf101eb403ef23bebd5f2f6"}},{"ruleId":"D1","level":"warning","message":{"text":"SnapFileImporter.Import (cyclomatic 16): SnapFileImporter.Import has cyclomatic complexity 16 (threshold 15). Of this number, 10 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":"br/pkg/restore/snap_client/import.go"},"region":{"startLine":475}}}],"partialFingerprints":{"codehealthFindingId/v1":"aec85e5f7fbc7f201b98be1daa2592964badea7534c5a52dbd50924299510172"}},{"ruleId":"D1","level":"warning","message":{"text":"SnapFileImporter.ingest (cyclomatic 16): SnapFileImporter.ingest 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":"br/pkg/restore/snap_client/import.go"},"region":{"startLine":1214}}}],"partialFingerprints":{"codehealthFindingId/v1":"732df8a925d79d93f7140dc1c300100797013d97bd86bcf7393e8877e1d42800"}},{"ruleId":"D1","level":"warning","message":{"text":"backupmetas.parseTaggedBackupMetaFileName (cyclomatic 16): backupmetas.parseTaggedBackupMetaFileName 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":"br/pkg/stream/backupmetas/parser.go"},"region":{"startLine":139}}}],"partialFingerprints":{"codehealthFindingId/v1":"12ae149ce170217fb209bca6bcaef0c9137db650b7f74fbb02d2c4cc664067ed"}},{"ruleId":"D1","level":"warning","message":{"text":"RawWriteCFValue.ParseFrom (cyclomatic 16): RawWriteCFValue.ParseFrom 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":"br/pkg/stream/meta_kv.go"},"region":{"startLine":154}}}],"partialFingerprints":{"codehealthFindingId/v1":"cc5b2b7a939d4df0f1069b3ecbbf047403939aff3a2348cc0b07344dc0baa824"}},{"ruleId":"D1","level":"warning","message":{"text":"SchemasReplace.rewriteTableInfo (cyclomatic 16): SchemasReplace.rewriteTableInfo 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":"br/pkg/stream/rewrite_meta_rawkv.go"},"region":{"startLine":290}}}],"partialFingerprints":{"codehealthFindingId/v1":"f3827f8dfa4c0e2cc4f4cde41352be13ccf2cb49f4a6367c1d1262dd877681c8"}},{"ruleId":"D1","level":"warning","message":{"text":"task.RunBackupRaw (cyclomatic 16): task.RunBackupRaw has cyclomatic complexity 16 (threshold 15). Of this number, 13 points are the body\u0027s own statements and 3 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":"br/pkg/task/backup_raw.go"},"region":{"startLine":128}}}],"partialFingerprints":{"codehealthFindingId/v1":"d3b460d7e6dc84102684014bb114d4fd817001ca21eaf7daa77ab68c8be9d79e"}},{"ruleId":"D1","level":"warning","message":{"text":"export.getNumericIndex (cyclomatic 16): export.getNumericIndex 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":"dumpling/export/sql.go"},"region":{"startLine":658}}}],"partialFingerprints":{"codehealthFindingId/v1":"49868c93dbe9d0e91fb10d8be40d76df287a989c94f2f37a869d4c8a2e7e0893"}},{"ruleId":"D1","level":"warning","message":{"text":"ErrorManager.Init (cyclomatic 16): ErrorManager.Init 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":"lightning/pkg/errormanager/errormanager.go"},"region":{"startLine":268}}}],"partialFingerprints":{"codehealthFindingId/v1":"539a19f0078621bd3612c9de7970820be5c2abfc3d0e5b544c5f6df97d1c7a2f"}},{"ruleId":"D1","level":"warning","message":{"text":"ruleBasedPlanPerfPredictor.PerfPredicate (cyclomatic 16): ruleBasedPlanPerfPredictor.PerfPredicate has cyclomatic complexity 16 (threshold 15). Of this number, 13 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":"pkg/bindinfo/binding_plan_evolution.go"},"region":{"startLine":36}}}],"partialFingerprints":{"codehealthFindingId/v1":"4c6a69f31b74269b9a96262a18374c0a383ae44bb2e22c120dc6169321c66710"}},{"ruleId":"D1","level":"warning","message":{"text":"config.InitializeConfig (cyclomatic 16): config.InitializeConfig 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":"pkg/config/config.go"},"region":{"startLine":1452}}}],"partialFingerprints":{"codehealthFindingId/v1":"193392939fb83e376abed59f914db0541ca4d178d81278253eef894013d2efcb"}},{"ruleId":"D1","level":"warning","message":{"text":"KeyspaceObservability.Valid (cyclomatic 16): KeyspaceObservability.Valid 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":"pkg/config/keyspace_observability.go"},"region":{"startLine":59}}}],"partialFingerprints":{"codehealthFindingId/v1":"7b43faef874675f85f155158f0ab05b722a5ec720c00934bf6b75d9d40412a89"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.generatePlanForPhysicalTable (cyclomatic 16): ddl.generatePlanForPhysicalTable has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 357). 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":"pkg/ddl/backfilling_dist_scheduler.go"},"region":{"startLine":331}}}],"partialFingerprints":{"codehealthFindingId/v1":"e437d86de1aa69d2f19270ac88338c75d51e1738051ef1cb0268ebe5c2d38893"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.onCreateView (cyclomatic 16): ddl.onCreateView 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":"pkg/ddl/create_table.go"},"region":{"startLine":371}}}],"partialFingerprints":{"codehealthFindingId/v1":"0af836f7334ded458121befce5f854be0036bc5b9a1e65ef9d088153bcde6ad7"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.setColumnFlagWithConstraint (cyclomatic 16): ddl.setColumnFlagWithConstraint 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":"pkg/ddl/create_table.go"},"region":{"startLine":1201}}}],"partialFingerprints":{"codehealthFindingId/v1":"888a0bb3d29ec112c8e9df970857335b3756735b0c4698f1c1c282f90be78448"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.BuildAddedPartitionInfo (cyclomatic 16): ddl.BuildAddedPartitionInfo 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":"pkg/ddl/executor.go"},"region":{"startLine":5695}}}],"partialFingerprints":{"codehealthFindingId/v1":"e8a82d9401fe861c0b2556dd6e76d864099790087ddeabead44bbc671bc878b4"}},{"ruleId":"D1","level":"warning","message":{"text":"ddl.checkIllegalFn4Generated (cyclomatic 16): ddl.checkIllegalFn4Generated 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":"pkg/ddl/generated_column.go"},"region":{"startLine":351}}}],"partialFingerprints":{"codehealthFindingId/v1":"9aa2e9b8d5e33f561c03d975a47639005e8f5f4507bc834addc89e3b18e08139"}},{"ruleId":"D1","level":"warning","message":{"text":"illegalFunctionChecker.Enter (cyclomatic 16): illegalFunctionChecker.Enter 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":"pkg/ddl/generated_column.go"},"region":{"startLine":292}}}],"partialFingerprints":{"codehealthFindingId/v1":"87134864f2bb7d8b72c88e0dfcb98d1788848c0ec2fb8e91df8e07d0626f1b84"}},{"ruleId":"D1","level":"warning","message":{"text":"addIndexTxnWorker.batchCheckUniqueKey (cyclomatic 16): addIndexTxnWorker.batchCheckUniqueKey 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":"pkg/ddl/index.go"},"region":{"startLine":2612}}}],"partialFingerprints":{"codehealthFindingId/v1":"35badde63a8670e1ae0736c008477145c4bed6f71e0ed01c34c61d726f1e376f"}},{"ruleId":"D1","level":"warning","message":{"text":"worker.rollbackLikeDropPartition (cyclomatic 16): worker.rollbackLikeDropPartition 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":"pkg/ddl/partition.go"},"region":{"startLine":2198}}}],"partialFingerprints":{"codehealthFindingId/v1":"81b3b5534032794cac9f87d214c3bb75fe039a296f12fd0e3e7b37932bbd7524"}},{"ruleId":"D1","level":"warning","message":{"text":"DDLNotifier.processEvents (cyclomatic 16): DDLNotifier.processEvents 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":"pkg/ddl/notifier/subscribe.go"},"region":{"startLine":185}}}],"partialFingerprints":{"codehealthFindingId/v1":"39046c5747f35b703419f551b50a94c44fc34e47bcd9a4085f8043d397611128"}},{"ruleId":"D1","level":"warning","message":{"text":"resourcegroup.NewGroupFromOptions (cyclomatic 16): resourcegroup.NewGroupFromOptions 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":"pkg/ddl/resourcegroup/group.go"},"region":{"startLine":27}}}],"partialFingerprints":{"codehealthFindingId/v1":"f2589b99d77f348fab2830295b825483ddde865ff645dad50efc151df852998a"}},{"ruleId":"D1","level":"warning","message":{"text":"RequestBuilder.Build (cyclomatic 16): RequestBuilder.Build has cyclomatic complexity 16 (threshold 15). Of this number, 13 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":"pkg/distsql/request_builder.go"},"region":{"startLine":61}}}],"partialFingerprints":{"codehealthFindingId/v1":"9756f8f37410b1e1267e5391a4936fe98ac59fc9cf62ad91f3c66f6924dedf1e"}},{"ruleId":"D1","level":"warning","message":{"text":"domain.dumpExplain (cyclomatic 16): domain.dumpExplain 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":"pkg/domain/plan_replayer_dump.go"},"region":{"startLine":756}}}],"partialFingerprints":{"codehealthFindingId/v1":"cec59d94335f9d83f25b3379eae5c0f1815fe9db6197e68daa9783630b116863"}},{"ruleId":"D1","level":"warning","message":{"text":"executor.fillRowChecksum (cyclomatic 16): executor.fillRowChecksum 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":"pkg/executor/point_get.go"},"region":{"startLine":464}}}],"partialFingerprints":{"codehealthFindingId/v1":"bff0ffa39387f4ac4d5c9da7293df09d262fbf1bf31781961bb2005ed7e06f76"}},{"ruleId":"D1","level":"warning","message":{"text":"executor.encodedPassword (cyclomatic 16): executor.encodedPassword 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":"pkg/executor/utils.go"},"region":{"startLine":151}}}],"partialFingerprints":{"codehealthFindingId/v1":"abb1e0b1158ab18b1c71ec0cb3d58d681894b8f866e71b0a552a25da94a64b71"}},{"ruleId":"D1","level":"warning","message":{"text":"aggfuncs.buildMaxMin (cyclomatic 16): aggfuncs.buildMaxMin has cyclomatic complexity 16 (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/executor/aggfuncs/builder.go"},"region":{"startLine":468}}}],"partialFingerprints":{"codehealthFindingId/v1":"f39581f26723d9461a2ab7a2f27bffc5dc9d2c737e502e7e3daf6a12e8487eab"}},{"ruleId":"D1","level":"warning","message":{"text":"HashAggExec.fetchChildData (cyclomatic 16): HashAggExec.fetchChildData has cyclomatic complexity 16 (threshold 15). 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, 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":"pkg/executor/aggregate/agg_hash_executor.go"},"region":{"startLine":451}}}],"partialFingerprints":{"codehealthFindingId/v1":"8485fe6f52ca76065d0bc387e301b7b2734a9be5fe6d4488a8540dde587293ca"}},{"ruleId":"D1","level":"warning","message":{"text":"executorBuilder.buildSimple (cyclomatic 16): executorBuilder.buildSimple 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":"pkg/executor/builder.go"},"region":{"startLine":947}}}],"partialFingerprints":{"codehealthFindingId/v1":"a84698960fd9fdc668262dcca737ec42189b29460c3de37f3c1917015a34c34f"}},{"ruleId":"D1","level":"warning","message":{"text":"executorBuilder.buildTraffic (cyclomatic 16): executorBuilder.buildTraffic has cyclomatic complexity 16 (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/executor/builder.go"},"region":{"startLine":1226}}}],"partialFingerprints":{"codehealthFindingId/v1":"87a73dd89b3c7f9ef0df40290f88028f7126aec2b7a3b61ca64564cfc11fea08"}},{"ruleId":"D1","level":"warning","message":{"text":"executorBuilder.buildHashAggFromChildExec (cyclomatic 16): executorBuilder.buildHashAggFromChildExec 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":"pkg/executor/builder.go"},"region":{"startLine":2133}}}],"partialFingerprints":{"codehealthFindingId/v1":"81b48b072de83f12235102fcfe5a8f297893d5f904b41efa2d459f9a59d219fe"}},{"ruleId":"D1","level":"warning","message":{"text":"executorBuilder.buildIndexMergeReader (cyclomatic 16): executorBuilder.buildIndexMergeReader 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":"pkg/executor/builder.go"},"region":{"startLine":4797}}}],"partialFingerprints":{"codehealthFindingId/v1":"9c6c99e94ca402b879cbc8d5616e64280919b8d1c4f0c58eb02466c3443b4f26"}},{"ruleId":"D1","level":"warning","message":{"text":"memoryDebugModeHandler.run (cyclomatic 16): memoryDebugModeHandler.run has cyclomatic complexity 16 (threshold 15). Of this number, 14 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/explain.go"},"region":{"startLine":255}}}],"partialFingerprints":{"codehealthFindingId/v1":"fbaff22e0f8e22ec168146b604649b728b3fb6e136f0dae01f50709490df3054"}},{"ruleId":"D1","level":"warning","message":{"text":"FKCascadeExec.buildFKCascadePlan (cyclomatic 16): FKCascadeExec.buildFKCascadePlan 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":"pkg/executor/foreign_key.go"},"region":{"startLine":761}}}],"partialFingerprints":{"codehealthFindingId/v1":"fe5be743c97d59640fc18e76e9574dffa59f64a61e8cc05f4d93d879e9c5cc38"}},{"ruleId":"D1","level":"warning","message":{"text":"IndexMergeReaderExecutor.startPartialTableWorker (cyclomatic 16): IndexMergeReaderExecutor.startPartialTableWorker has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 5 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 537). 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":"pkg/executor/index_merge_reader.go"},"region":{"startLine":518}}}],"partialFingerprints":{"codehealthFindingId/v1":"d6540f280121395498b7ad842c66045a8e86b78ad87b27d8935a0cc016dbdd7a"}},{"ruleId":"D1","level":"warning","message":{"text":"memtableRetriever.setDataFromIndex (cyclomatic 16): memtableRetriever.setDataFromIndex 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":"pkg/executor/infoschema_reader.go"},"region":{"startLine":1516}}}],"partialFingerprints":{"codehealthFindingId/v1":"3fc717671dd49a5d7f60814976d7a98250d456f4fb781815d0b1608ca133cfd3"}},{"ruleId":"D1","level":"warning","message":{"text":"memtableRetriever.keyColumnUsageInTable (cyclomatic 16): memtableRetriever.keyColumnUsageInTable 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":"pkg/executor/infoschema_reader.go"},"region":{"startLine":1993}}}],"partialFingerprints":{"codehealthFindingId/v1":"fd615ad7551353af17d6371dcca84967f4a4d92bf2dd4ca0c64c54e8a13af3f0"}},{"ruleId":"D1","level":"warning","message":{"text":"memtableRetriever.setDataFromTableConstraints (cyclomatic 16): memtableRetriever.setDataFromTableConstraints 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":"pkg/executor/infoschema_reader.go"},"region":{"startLine":2300}}}],"partialFingerprints":{"codehealthFindingId/v1":"62f97eedef14db847b53d6ae191ece66ea0f3f886d503f88533015ac977f502c"}},{"ruleId":"D1","level":"warning","message":{"text":"InsertValues.adjustAutoRandomDatum (cyclomatic 16): InsertValues.adjustAutoRandomDatum 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":"pkg/executor/insert_common.go"},"region":{"startLine":1043}}}],"partialFingerprints":{"codehealthFindingId/v1":"742fead080e338b59bffba7e7366bbc482488c48c139b669906da7d045a896aa"}},{"ruleId":"D1","level":"warning","message":{"text":"exec.Next (cyclomatic 16): exec.Next has cyclomatic complexity 16 (threshold 15). 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: 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":"pkg/executor/internal/exec/executor.go"},"region":{"startLine":627}}}],"partialFingerprints":{"codehealthFindingId/v1":"65ec7fc7441c6862c87691b5076f8190aa2b686b5d601518eb57fca1cb8fd29c"}},{"ruleId":"D1","level":"warning","message":{"text":"localMppCoordinator.handleAllReports (cyclomatic 16): localMppCoordinator.handleAllReports 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":"pkg/executor/internal/mpp/local_mpp_coordinator.go"},"region":{"startLine":730}}}],"partialFingerprints":{"codehealthFindingId/v1":"dc76d6cc8d35e3ca9dd6c49233bd583c2244f953503211f4c66cf114eeb39a30"}},{"ruleId":"D1","level":"warning","message":{"text":"VecGroupChecker.SplitIntoGroups (cyclomatic 16): VecGroupChecker.SplitIntoGroups 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":"pkg/executor/internal/vecgroupchecker/vec_group_checker.go"},"region":{"startLine":80}}}],"partialFingerprints":{"codehealthFindingId/v1":"7a8861d0c1a4d32e7b7838f564249d021995eef4ac7824a844f703e930fb16e2"}},{"ruleId":"D1","level":"warning","message":{"text":"join.newTableMeta (cyclomatic 16): join.newTableMeta has cyclomatic complexity 16 (threshold 15). Of this number, 14 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, 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":"pkg/executor/join/join_table_meta.go"},"region":{"startLine":184}}}],"partialFingerprints":{"codehealthFindingId/v1":"3c2289e72a14ed2e2fdbc8dbf1bd0cb2b6641dc7768d2b46ed46b37c9bf69148"}},{"ruleId":"D1","level":"warning","message":{"text":"join.NewJoiner (cyclomatic 16): join.NewJoiner 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":"pkg/executor/join/joiner.go"},"region":{"startLine":141}}}],"partialFingerprints":{"codehealthFindingId/v1":"1eff2e275ec5768ef040533716c02f07bfa3a50f525c909647533910021e5f6d"}},{"ruleId":"D1","level":"warning","message":{"text":"ProbeWorkerV1.runJoinWorker (cyclomatic 16): ProbeWorkerV1.runJoinWorker 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":"pkg/executor/join/hash_join_v1.go"},"region":{"startLine":319}}}],"partialFingerprints":{"codehealthFindingId/v1":"d3c8d18c2874abba37e3b3a68b921539124ccf0cd14bcfb5e12cc3c65bedd2f3"}},{"ruleId":"D1","level":"warning","message":{"text":"innerWorker.constructDatumLookupKey (cyclomatic 16): innerWorker.constructDatumLookupKey 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":"pkg/executor/join/index_lookup_join.go"},"region":{"startLine":654}}}],"partialFingerprints":{"codehealthFindingId/v1":"eaf08bc02a56289911b648be30ca7a6c6da0ce6d82a7643494ec5d205bd30e03"}},{"ruleId":"D1","level":"warning","message":{"text":"memTableReader.getRowData (cyclomatic 16): memTableReader.getRowData 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":"pkg/executor/mem_reader.go"},"region":{"startLine":501}}}],"partialFingerprints":{"codehealthFindingId/v1":"ad608ba30a9b3882a0885509f648740022ab9503d3f0b520d476aed40c0dbdd9"}},{"ruleId":"D1","level":"warning","message":{"text":"SelectLockExec.Next (cyclomatic 16): SelectLockExec.Next 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":"pkg/executor/select.go"},"region":{"startLine":247}}}],"partialFingerprints":{"codehealthFindingId/v1":"93f7543d0b26220ab4f55cacf1b5aca2796dab7a91b1a0e2997e6dcb4546c4a4"}},{"ruleId":"D1","level":"warning","message":{"text":"ShowExec.fetchAllTablePlacements (cyclomatic 16): ShowExec.fetchAllTablePlacements 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":"pkg/executor/show_placement.go"},"region":{"startLine":358}}}],"partialFingerprints":{"codehealthFindingId/v1":"2f66632873612f06353106be03fb9f5c23942674eed3aba30e87f7b6df04d793"}},{"ruleId":"D1","level":"warning","message":{"text":"ShowExec.fetchShowStatsHealthy (cyclomatic 16): ShowExec.fetchShowStatsHealthy 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":"pkg/executor/show_stats.go"},"region":{"startLine":468}}}],"partialFingerprints":{"codehealthFindingId/v1":"4402954365e33bf2d63946e6f8d1ca69fe1197af8a4b5f5f2919e1e890d48baa"}},{"ruleId":"D1","level":"warning","message":{"text":"SimpleExec.executeRollback (cyclomatic 16): SimpleExec.executeRollback 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":"pkg/executor/simple.go"},"region":{"startLine":795}}}],"partialFingerprints":{"codehealthFindingId/v1":"267f6929143f9e7ca066322939542b5da6ac6dd23c1a6d8eabe0f02f5cfdc914"}},{"ruleId":"D1","level":"warning","message":{"text":"UpdateExec.exec (cyclomatic 16): UpdateExec.exec 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":"pkg/executor/update.go"},"region":{"startLine":255}}}],"partialFingerprints":{"codehealthFindingId/v1":"ef5e85350e5d991e0bf1dc9959ce8ea6e3c04f9a599b03baaccf4369c025382f"}},{"ruleId":"D1","level":"warning","message":{"text":"maxMinCountFunction.Update (cyclomatic 16): maxMinCountFunction.Update 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":"pkg/expression/aggregation/max_min_count.go"},"region":{"startLine":48}}}],"partialFingerprints":{"codehealthFindingId/v1":"54eddde13bd19ab7d606fe432035107fd1a8c0cca9e9fbc0c0e362a9a5674f67"}},{"ruleId":"D1","level":"warning","message":{"text":"expression.RefineComparedConstant (cyclomatic 16): expression.RefineComparedConstant 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":"pkg/expression/builtin_compare.go"},"region":{"startLine":1574}}}],"partialFingerprints":{"codehealthFindingId/v1":"13a88f2a941a67105afe737acb1ab3ffed1dd1521566e434fcb05d9401d98a41"}},{"ruleId":"D1","level":"warning","message":{"text":"expression.scalarExprSupportedByTiKV (cyclomatic 16): expression.scalarExprSupportedByTiKV has cyclomatic complexity 16 (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/expression/infer_pushdown.go"},"region":{"startLine":186}}}],"partialFingerprints":{"codehealthFindingId/v1":"3fb31534c421fd4f961a4013159fe1fde854ce1c34605ab1805988c956b7c128"}},{"ruleId":"D1","level":"warning","message":{"text":"expression.typeInferForNull (cyclomatic 16): expression.typeInferForNull has cyclomatic complexity 16 (threshold 15). Of this number, 14 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the 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":"pkg/expression/scalar_function.go"},"region":{"startLine":168}}}],"partialFingerprints":{"codehealthFindingId/v1":"79def2c2d3f579aa43352681aa79cf6a7759336ff23a57633733f316f9124af7"}},{"ruleId":"D1","level":"warning","message":{"text":"expression.extractFiltersFromDNF (cyclomatic 16): expression.extractFiltersFromDNF 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":"pkg/expression/util.go"},"region":{"startLine":1222}}}],"partialFingerprints":{"codehealthFindingId/v1":"8f1e79593094e80a14f771bf3821d5063666909f6cf9e3d20f77bb39c218658a"}},{"ruleId":"D1","level":"warning","message":{"text":"builtinCastStringAsIntSig.evalInt (cyclomatic 16): builtinCastStringAsIntSig.evalInt 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":"pkg/expression/builtin_cast.go"},"region":{"startLine":1782}}}],"partialFingerprints":{"codehealthFindingId/v1":"3b8894e91948a34bc9454335c498db044344d12f0ad042756ecf367a12262958"}},{"ruleId":"D1","level":"warning","message":{"text":"greatestFunctionClass.getFunction (cyclomatic 16): greatestFunctionClass.getFunction 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":"pkg/expression/builtin_compare.go"},"region":{"startLine":498}}}],"partialFingerprints":{"codehealthFindingId/v1":"42cc1c4d6119c7b798c50dd36df7fbf8529019c9e930d20407e409f22d78944f"}},{"ruleId":"D1","level":"warning","message":{"text":"leastFunctionClass.getFunction (cyclomatic 16): leastFunctionClass.getFunction 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":"pkg/expression/builtin_compare.go"},"region":{"startLine":857}}}],"partialFingerprints":{"codehealthFindingId/v1":"a1aa31d8f1b9f29952290a083939fbeb28cc94241da86da303b30d3e02580e5a"}},{"ruleId":"D1","level":"warning","message":{"text":"builtinJSONMergeSig.vecEvalJSON (cyclomatic 16): builtinJSONMergeSig.vecEvalJSON 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":"pkg/expression/builtin_json_vec.go"},"region":{"startLine":1107}}}],"partialFingerprints":{"codehealthFindingId/v1":"81e98d5fc99bec2b60729e9c50e46f776d533411b00add0808afd30c53e06dec"}},{"ruleId":"D1","level":"warning","message":{"text":"builtinJSONObjectSig.vecEvalJSON (cyclomatic 16): builtinJSONObjectSig.vecEvalJSON 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":"pkg/expression/builtin_json_vec.go"},"region":{"startLine":619}}}],"partialFingerprints":{"codehealthFindingId/v1":"eeac99119d32dfbe53700b36af3017b669c129b60b01eba799708b0b7d381339"}},{"ruleId":"D1","level":"warning","message":{"text":"builtinJSONSchemaValidSig.evalInt (cyclomatic 16): builtinJSONSchemaValidSig.evalInt has cyclomatic complexity 16 (threshold 15). Of this number, 13 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":"pkg/expression/builtin_json.go"},"region":{"startLine":2068}}}],"partialFingerprints":{"codehealthFindingId/v1":"be2b65ea9e402e9db24b06961a4e65c878e840515caf1e7369c08a5f80551324"}},{"ruleId":"D1","level":"warning","message":{"text":"builtinInetAtonSig.vecEvalInt (cyclomatic 16): builtinInetAtonSig.vecEvalInt 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":"pkg/expression/builtin_miscellaneous_vec.go"},"region":{"startLine":654}}}],"partialFingerprints":{"codehealthFindingId/v1":"a2f7f8796f73d3725531a8b125b41b7392be091e2df77f9db7513e05a976396f"}},{"ruleId":"D1","level":"warning","message":{"text":"builtinSubstring3ArgsSig.vecEvalString (cyclomatic 16): builtinSubstring3ArgsSig.vecEvalString 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":"pkg/expression/builtin_string_vec.go"},"region":{"startLine":2825}}}],"partialFingerprints":{"codehealthFindingId/v1":"ac102be39a95a27f49320cec19c939c1c8afb00b6ed9936a3311c925afda3393"}},{"ruleId":"D1","level":"warning","message":{"text":"builtinSubstring3ArgsUTF8Sig.vecEvalString (cyclomatic 16): builtinSubstring3ArgsUTF8Sig.vecEvalString 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":"pkg/expression/builtin_string_vec.go"},"region":{"startLine":2031}}}],"partialFingerprints":{"codehealthFindingId/v1":"7641b1cb918b6a8481419305873d630ff09a7fd6b5b85b6793751db897675980"}},{"ruleId":"D1","level":"warning","message":{"text":"unixTimestampFunctionClass.getFunction (cyclomatic 16): unixTimestampFunctionClass.getFunction 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":"pkg/expression/builtin_time.go"},"region":{"startLine":4363}}}],"partialFingerprints":{"codehealthFindingId/v1":"834adf880254e347e84274cb0ccba44ae071f8b65c49c0d20ad8539d5de4a604"}},{"ruleId":"D1","level":"warning","message":{"text":"builtinMakeDateSig.vecEvalTime (cyclomatic 16): builtinMakeDateSig.vecEvalTime 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":"pkg/expression/builtin_time_vec.go"},"region":{"startLine":1308}}}],"partialFingerprints":{"codehealthFindingId/v1":"c868c3ee48a54445522bd5ce5252d5b3aee94750354f55aeef4dec7ab4c8ce44"}},{"ruleId":"D1","level":"warning","message":{"text":"Embedder.CreateEmbeddings (cyclomatic 16): Embedder.CreateEmbeddings 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":"pkg/inference/embedding/mock/mock.go"},"region":{"startLine":41}}}],"partialFingerprints":{"codehealthFindingId/v1":"6d07612401f55c20ee8afc6cba1f019faea0cb4e44ddf13cbce18e8d0982318a"}},{"ruleId":"D1","level":"warning","message":{"text":"infoschema.loadMaskingPoliciesWithTableIDs (cyclomatic 16): infoschema.loadMaskingPoliciesWithTableIDs has cyclomatic complexity 16 (threshold 15). Of this number, 10 points are the body\u0027s own statements and 6 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":"pkg/infoschema/infoschema.go"},"region":{"startLine":753}}}],"partialFingerprints":{"codehealthFindingId/v1":"c9d9c13fcad3bbd59613710f7908cf71829143204475d70c0cc2240afab21847"}},{"ruleId":"D1","level":"warning","message":{"text":"Syncer.MDLCheckLoop (cyclomatic 16): Syncer.MDLCheckLoop 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":"pkg/infoschema/issyncer/syncer.go"},"region":{"startLine":215}}}],"partialFingerprints":{"codehealthFindingId/v1":"e398074f25b81338d9c403dc6d69b5535d768bfd4ca8c68b3a7d5f14b7e8027d"}},{"ruleId":"D1","level":"warning","message":{"text":"globalsort.readAllData (cyclomatic 16): globalsort.readAllData has cyclomatic complexity 16 (threshold 15). Of this number, 8 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":"pkg/ingestor/globalsort/reader.go"},"region":{"startLine":42}}}],"partialFingerprints":{"codehealthFindingId/v1":"f60197ec8341812978cb0a332a635c8698302d3187eb1f6aa03055aabc1fad07"}},{"ruleId":"D1","level":"warning","message":{"text":"regionJobBaseWorker.runJob (cyclomatic 16): regionJobBaseWorker.runJob 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":"pkg/ingestor/ingestctrl/job_worker.go"},"region":{"startLine":171}}}],"partialFingerprints":{"codehealthFindingId/v1":"a94bdc5461a66dd667312bb19febd962464386e54452d964b420fbb91b77d74d"}},{"ruleId":"D1","level":"warning","message":{"text":"objStoreRegionJobWorker.write (cyclomatic 16): objStoreRegionJobWorker.write has cyclomatic complexity 16 (threshold 15). Of this number, 12 points are the body\u0027s own statements and 4 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":"pkg/ingestor/ingestctrl/job_worker.go"},"region":{"startLine":355}}}],"partialFingerprints":{"codehealthFindingId/v1":"b74d5732cc1ec4649723c12c692c30ac8b218ea07a6dcd9c58d9b4813422f832"}},{"ruleId":"D1","level":"warning","message":{"text":"Backend.forceTableSplitRange (cyclomatic 16): Backend.forceTableSplitRange has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 5 of the 16 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 955, 1009, 995). 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":"pkg/ingestor/ingestctrl/local.go"},"region":{"startLine":921}}}],"partialFingerprints":{"codehealthFindingId/v1":"01d72aa059472a11a8f75a82750ae3f1d71ddbe5e370c098ef749f8c0b54c92f"}},{"ruleId":"D1","level":"warning","message":{"text":"Backend.doIngest (cyclomatic 16): Backend.doIngest has cyclomatic complexity 16 (threshold 15). Of this number, 14 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ingestor/ingestctrl/region_job.go"},"region":{"startLine":695}}}],"partialFingerprints":{"codehealthFindingId/v1":"9187fba18a75bf0b4b71e989ea8ca8906b87ec01c31f280f1e83c6c6409c29ce"}},{"ruleId":"D1","level":"warning","message":{"text":"simplesst.GetReadRangeFromProps (cyclomatic 16): simplesst.GetReadRangeFromProps has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 6 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 193). 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":"pkg/ingestor/simplesst/util.go"},"region":{"startLine":165}}}],"partialFingerprints":{"codehealthFindingId/v1":"64a80813f357d1dbaf4fd8e020cd76a110db55231d2c3342dca2b79b38c75a35"}},{"ruleId":"D1","level":"warning","message":{"text":"tidbEncoder.appendSQL (cyclomatic 16): tidbEncoder.appendSQL has cyclomatic complexity 16 (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/lightning/backend/tidb/tidb.go"},"region":{"startLine":490}}}],"partialFingerprints":{"codehealthFindingId/v1":"9d21dc4dfc3bd752c7e89bbc6f8865afa055fe5dbc5769f9584cae65b93eb522"}},{"ruleId":"D1","level":"warning","message":{"text":"tidbEncoder.Encode (cyclomatic 16): tidbEncoder.Encode 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":"pkg/lightning/backend/tidb/tidb.go"},"region":{"startLine":580}}}],"partialFingerprints":{"codehealthFindingId/v1":"f793e00e632f6bed2d8c29c5164aeaa29fa00b3983d0f315f7c695fc22dd5517"}},{"ruleId":"D1","level":"warning","message":{"text":"CSVConfig.adjust (cyclomatic 16): CSVConfig.adjust 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":"pkg/lightning/config/config.go"},"region":{"startLine":852}}}],"partialFingerprints":{"codehealthFindingId/v1":"5e58a301c83f4ddd6e100e2da0119212bd4c33e2667b68fed862c3fcdb58972e"}},{"ruleId":"D1","level":"warning","message":{"text":"mydump.calculateFileBytes (cyclomatic 16): mydump.calculateFileBytes has cyclomatic complexity 16 (threshold 15). Of this number, 13 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":"pkg/lightning/mydump/loader.go"},"region":{"startLine":909}}}],"partialFingerprints":{"codehealthFindingId/v1":"2080c247d2f0cf8240eff354bab75482b97febf7cbb750f9bd1ff29277d71109"}},{"ruleId":"D1","level":"warning","message":{"text":"mydump.MakeTableRegions (cyclomatic 16): mydump.MakeTableRegions has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 239, 287). 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":"pkg/lightning/mydump/region.go"},"region":{"startLine":211}}}],"partialFingerprints":{"codehealthFindingId/v1":"bd042b9d72c7b26877d184a60e0ae4b1107a7ddde127b396a81f29334cb574e0"}},{"ruleId":"D1","level":"warning","message":{"text":"allocator.alloc4Unsigned (cyclomatic 16): allocator.alloc4Unsigned has cyclomatic complexity 16 (threshold 15). Of this number, 11 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":"pkg/meta/autoid/autoid.go"},"region":{"startLine":977}}}],"partialFingerprints":{"codehealthFindingId/v1":"5a5b5f7357b90121e766b8d7d80ee6dc80e07ae4e1ea374d16f40268ad796c84"}},{"ruleId":"D1","level":"warning","message":{"text":"allocator.alloc4Sequence (cyclomatic 16): allocator.alloc4Sequence has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 1100). 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":"pkg/meta/autoid/autoid.go"},"region":{"startLine":1087}}}],"partialFingerprints":{"codehealthFindingId/v1":"b6735cf58246dc9f0e7251248ec09d0bbed8c96280d543f1cf0d69ff43a8f200"}},{"ruleId":"D1","level":"warning","message":{"text":"cardinality.recordUsedItemStatsStatus (cyclomatic 16): cardinality.recordUsedItemStatsStatus 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":"pkg/planner/cardinality/trace.go"},"region":{"startLine":25}}}],"partialFingerprints":{"codehealthFindingId/v1":"2f1ee7a370bbe8b8485c865e3c639dbac2e3b5f0ededa7c06aa3e8229de8a0de"}},{"ruleId":"D1","level":"warning","message":{"text":"core.preferMppBCJ (cyclomatic 16): core.preferMppBCJ 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":"pkg/planner/core/exhaust_physical_plans.go"},"region":{"startLine":1875}}}],"partialFingerprints":{"codehealthFindingId/v1":"bafd05dfcc95db7fe9ba6db08b519f2bbf12536904e28d824379f4eaf27a1a45"}},{"ruleId":"D1","level":"warning","message":{"text":"core.buildSimpleExpr (cyclomatic 16): core.buildSimpleExpr has cyclomatic complexity 16 (threshold 15). Of this number, 13 points are the body\u0027s own statements and 3 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":"pkg/planner/core/expression_rewriter.go"},"region":{"startLine":108}}}],"partialFingerprints":{"codehealthFindingId/v1":"8e5d912368207526deedc48307daa79c4d49aed400d8196607e576cc196c27ed"}},{"ruleId":"D1","level":"warning","message":{"text":"core.resolveRedundantColumnFromNaturalUsingJoinPlan (cyclomatic 16): core.resolveRedundantColumnFromNaturalUsingJoinPlan 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":"pkg/planner/core/expression_rewriter.go"},"region":{"startLine":3200}}}],"partialFingerprints":{"codehealthFindingId/v1":"5ed49a94e0f065a08da04d5cb2bd7dd100f95d24d254405e8afe62c157916684"}},{"ruleId":"D1","level":"warning","message":{"text":"core.comparePseudo (cyclomatic 16): core.comparePseudo has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/find_best_task.go"},"region":{"startLine":986}}}],"partialFingerprints":{"codehealthFindingId/v1":"cf4d9ebeda89a298c24e526c1df8e2d0590a1be739b5a2b10e383c1808885c74"}},{"ruleId":"D1","level":"warning","message":{"text":"core.matchPartialOrderProperty (cyclomatic 16): core.matchPartialOrderProperty 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":"pkg/planner/core/find_best_task.go"},"region":{"startLine":1242}}}],"partialFingerprints":{"codehealthFindingId/v1":"86ba13fb1975d6b184f6c3fe159d09e1178a012831502c9edfa66604dc625513"}},{"ruleId":"D1","level":"warning","message":{"text":"core.convertToPointGet (cyclomatic 16): core.convertToPointGet 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":"pkg/planner/core/find_best_task.go"},"region":{"startLine":2994}}}],"partialFingerprints":{"codehealthFindingId/v1":"8f6f764a3a44298a06fc1e3d0e4f23014244193859aaf0636e85f8308fff98f7"}},{"ruleId":"D1","level":"warning","message":{"text":"core.indexJoinPathBuildTmpRange (cyclomatic 16): core.indexJoinPathBuildTmpRange has cyclomatic complexity 16 (threshold 15). Of this number, 13 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":"pkg/planner/core/index_join_path.go"},"region":{"startLine":440}}}],"partialFingerprints":{"codehealthFindingId/v1":"3b5cf43176abb285846d9734e8bb90b3fa3b6d9c2e307a5d4ebc0bb665f8711b"}},{"ruleId":"D1","level":"warning","message":{"text":"core.pruneAndBuildColPositionInfoForDelete (cyclomatic 16): core.pruneAndBuildColPositionInfoForDelete 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":"pkg/planner/core/logical_plan_builder.go"},"region":{"startLine":5868}}}],"partialFingerprints":{"codehealthFindingId/v1":"ae391283084518f4a90f7b57f1b61bfa8ec572cf82e12d042b94b51a094f469a"}},{"ruleId":"D1","level":"warning","message":{"text":"core.planCachePreprocess (cyclomatic 16): core.planCachePreprocess 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":"pkg/planner/core/plan_cache.go"},"region":{"startLine":107}}}],"partialFingerprints":{"codehealthFindingId/v1":"2e51736bb39c13ce2cebb97934500126f23a755f57655206c76d2144f7766fa9"}},{"ruleId":"D1","level":"warning","message":{"text":"core.TryFastPlan (cyclomatic 16): core.TryFastPlan has cyclomatic complexity 16 (threshold 15). Of this number, 14 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/point_get_plan.go"},"region":{"startLine":82}}}],"partialFingerprints":{"codehealthFindingId/v1":"3c1d34cf57cfbe14e367ec5d526eadc8ae9450e4d1d27e56fbc42232dddc1181"}},{"ruleId":"D1","level":"warning","message":{"text":"core.pruneRedundantApply (cyclomatic 16): core.pruneRedundantApply 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":"pkg/planner/core/rule_decorrelate.go"},"region":{"startLine":143}}}],"partialFingerprints":{"codehealthFindingId/v1":"22cc9743bc7c0306999feea7ea7410496902b309f59e5e1f32d8f9e1b487869b"}},{"ruleId":"D1","level":"warning","message":{"text":"core.isSelectionPartitionedRowNumberWindowOneUnique (cyclomatic 16): core.isSelectionPartitionedRowNumberWindowOneUnique has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/rule_join_elimination.go"},"region":{"startLine":205}}}],"partialFingerprints":{"codehealthFindingId/v1":"827ec051a0859951f4d1ca20f8a9e78c53ed4ebd31367864b61bcc4ebf1635af"}},{"ruleId":"D1","level":"warning","message":{"text":"tidbCodecFuncHelper.encodeIndexKeyFromRow (cyclomatic 16): tidbCodecFuncHelper.encodeIndexKeyFromRow 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":"pkg/planner/core/expression_codec_fn.go"},"region":{"startLine":168}}}],"partialFingerprints":{"codehealthFindingId/v1":"86940dc0e6e1bdb06708eda68cd74c403fcae727845c94bc80f9aa1610970724"}},{"ruleId":"D1","level":"warning","message":{"text":"expressionRewriter.patternLikeOrIlikeToExpression (cyclomatic 16): expressionRewriter.patternLikeOrIlikeToExpression 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":"pkg/planner/core/expression_rewriter.go"},"region":{"startLine":2375}}}],"partialFingerprints":{"codehealthFindingId/v1":"46acc9ba954fda6e84d30cb5fc1ad4eef4540b2f9916249176ab28369369b4fd"}},{"ruleId":"D1","level":"warning","message":{"text":"cc.shallowRefElement (cyclomatic 16): cc.shallowRefElement 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":"pkg/planner/core/generator/shallow_ref/shallow_ref_generator.go"},"region":{"startLine":94}}}],"partialFingerprints":{"codehealthFindingId/v1":"f62eeab5f71f43e9c0995d3cf825fd8d0b3e95774eb1786309f17bfb3823caf7"}},{"ruleId":"D1","level":"warning","message":{"text":"joinorder.BuildLeadingTreeFromList (cyclomatic 16): joinorder.BuildLeadingTreeFromList 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":"pkg/planner/core/joinorder/util.go"},"region":{"startLine":98}}}],"partialFingerprints":{"codehealthFindingId/v1":"611570d4882691cbf6329d362288ca8d5a2868d4b9ab824f20dbb6e40cb4c52d"}},{"ruleId":"D1","level":"warning","message":{"text":"LogicalApply.DeriveStats (cyclomatic 16): LogicalApply.DeriveStats 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":"pkg/planner/core/operator/logicalop/logical_apply.go"},"region":{"startLine":160}}}],"partialFingerprints":{"codehealthFindingId/v1":"5579d4c784f3d19746b601f2cd64ce0e38aaf6a68435c8df3059c3c64f96dd94"}},{"ruleId":"D1","level":"warning","message":{"text":"DataSource.BuildKeyInfo (cyclomatic 16): DataSource.BuildKeyInfo 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":"pkg/planner/core/operator/logicalop/logical_datasource.go"},"region":{"startLine":278}}}],"partialFingerprints":{"codehealthFindingId/v1":"ab63177cb1298455648b0675715adc26d597452b75c84d8c24b82c613d6c2278"}},{"ruleId":"D1","level":"warning","message":{"text":"LogicalProjection.ExtractFD (cyclomatic 16): LogicalProjection.ExtractFD 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":"pkg/planner/core/operator/logicalop/logical_projection.go"},"region":{"startLine":388}}}],"partialFingerprints":{"codehealthFindingId/v1":"ac39552a059b93abbffbab761041421d4e1efff7b466938a34c6882aa680d9f1"}},{"ruleId":"D1","level":"warning","message":{"text":"LogicalSelection.windowIsTopN (cyclomatic 16): LogicalSelection.windowIsTopN 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":"pkg/planner/core/operator/logicalop/logical_selection.go"},"region":{"startLine":339}}}],"partialFingerprints":{"codehealthFindingId/v1":"3bd959a38eec3310cc0f83b2da0c730c832ad4c89516e51774191d7a8f994952"}},{"ruleId":"D1","level":"warning","message":{"text":"physicalop.getHashAggs (cyclomatic 16): physicalop.getHashAggs 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":"pkg/planner/core/operator/physicalop/physical_hash_agg.go"},"region":{"startLine":52}}}],"partialFingerprints":{"codehealthFindingId/v1":"c4b16090710d3b0cf7c64949eff1fa59e346e7676b9cf29bbb832dddaec715dc"}},{"ruleId":"D1","level":"warning","message":{"text":"physicalop.getEnforcedMergeJoin (cyclomatic 16): physicalop.getEnforcedMergeJoin 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":"pkg/planner/core/operator/physicalop/physical_merge_join.go"},"region":{"startLine":146}}}],"partialFingerprints":{"codehealthFindingId/v1":"74a0a04d0dcb82e6eb617ec91e9bb30f7f563cc64bb8ac82b5b0f254f9f7f04e"}},{"ruleId":"D1","level":"warning","message":{"text":"physicalop.getPhysTopN (cyclomatic 16): physicalop.getPhysTopN 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":"pkg/planner/core/operator/physicalop/physical_topn.go"},"region":{"startLine":272}}}],"partialFingerprints":{"codehealthFindingId/v1":"904c038c7615780da809eeb4dd49218845bf6346f203d4a470cf346548d6e765"}},{"ruleId":"D1","level":"warning","message":{"text":"Insert.BuildOnInsertFKTriggers (cyclomatic 16): Insert.BuildOnInsertFKTriggers 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":"pkg/planner/core/operator/physicalop/foreign_key.go"},"region":{"startLine":165}}}],"partialFingerprints":{"codehealthFindingId/v1":"5f489a378340aad09587ee9ece227765fea8f2f02ad32a2e2ae9cfb75e031aec"}},{"ruleId":"D1","level":"warning","message":{"text":"PhysicalIndexScan.OperatorInfo (cyclomatic 16): PhysicalIndexScan.OperatorInfo 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":"pkg/planner/core/operator/physicalop/physical_index_scan.go"},"region":{"startLine":260}}}],"partialFingerprints":{"codehealthFindingId/v1":"00f38c3bf035e6e7f5d80b5a31695316b149e09d430f819c90271d06ae900ad3"}},{"ruleId":"D1","level":"warning","message":{"text":"PhysicalWindow.ResolveIndices (cyclomatic 16): PhysicalWindow.ResolveIndices 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":"pkg/planner/core/operator/physicalop/physical_window.go"},"region":{"startLine":230}}}],"partialFingerprints":{"codehealthFindingId/v1":"a7915479c8f52812000d956db71c7462b89c2664b6cfeb5aff34b968d8c31413"}},{"ruleId":"D1","level":"warning","message":{"text":"CopTask.convertToRootTaskImpl (cyclomatic 16): CopTask.convertToRootTaskImpl has cyclomatic complexity 16 (threshold 15). Of this number, 14 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, 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":"pkg/planner/core/operator/physicalop/task_base.go"},"region":{"startLine":509}}}],"partialFingerprints":{"codehealthFindingId/v1":"aa7d28c59e0573aada084e54e0c1ac5ad45b16002a149ab73060613489385df8"}},{"ruleId":"D1","level":"warning","message":{"text":"PBPlanBuilder.pbToPhysicalPlan (cyclomatic 16): PBPlanBuilder.pbToPhysicalPlan 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":"pkg/planner/core/pb_to_plan.go"},"region":{"startLine":65}}}],"partialFingerprints":{"codehealthFindingId/v1":"fd37ec1505a255231654cd4b0bb7247ebe7c4048fa55aeb07128d01906b9bd8e"}},{"ruleId":"D1","level":"warning","message":{"text":"PlanBuilder.groupWindowFuncs (cyclomatic 16): PlanBuilder.groupWindowFuncs 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":"pkg/planner/core/logical_plan_builder.go"},"region":{"startLine":7314}}}],"partialFingerprints":{"codehealthFindingId/v1":"27b2efeb03f8b1f0d82bf484573e855e032dbd6aa30ac66716bcb3dd49e8e7b0"}},{"ruleId":"D1","level":"warning","message":{"text":"PlanBuilder.buildSet (cyclomatic 16): PlanBuilder.buildSet 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":"pkg/planner/core/planbuilder.go"},"region":{"startLine":779}}}],"partialFingerprints":{"codehealthFindingId/v1":"72ac36e31d2b960b087a63ca2e406b43b4664d928755dd054f7a684ddb14423b"}},{"ruleId":"D1","level":"warning","message":{"text":"PlanBuilder.buildSplitIndexRegion (cyclomatic 16): PlanBuilder.buildSplitIndexRegion has cyclomatic complexity 16 (threshold 15). Of this number, 14 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/planbuilder.go"},"region":{"startLine":5048}}}],"partialFingerprints":{"codehealthFindingId/v1":"0b4d42a568fe5abe75dd4f615a8326378bdf4d8829ca121adb9c9d15f31d31f3"}},{"ruleId":"D1","level":"warning","message":{"text":"preprocessor.checkAlterTableGrammar (cyclomatic 16): preprocessor.checkAlterTableGrammar 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":"pkg/planner/core/preprocess.go"},"region":{"startLine":1424}}}],"partialFingerprints":{"codehealthFindingId/v1":"77509b9ced333946ffc9d1019e69879e2e47e3c5430815611eeaec76d4c77217"}},{"ruleId":"D1","level":"warning","message":{"text":"preprocessor.handleTableName (cyclomatic 16): preprocessor.handleTableName 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":"pkg/planner/core/preprocess.go"},"region":{"startLine":1757}}}],"partialFingerprints":{"codehealthFindingId/v1":"c454df45f7e27e06a4adbbda88f7c9b1b3059b10755685c33ac7a564995958e6"}},{"ruleId":"D1","level":"warning","message":{"text":"rule.canConvertAntiJoin (cyclomatic 16): rule.canConvertAntiJoin 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":"pkg/planner/core/rule/rule_outer_join_to_semi_join.go"},"region":{"startLine":217}}}],"partialFingerprints":{"codehealthFindingId/v1":"ddbfb1ade98696c95506652c8472dfb01b6c2d54a141bb676f9712204723f3cf"}},{"ruleId":"D1","level":"warning","message":{"text":"rule.joinCondNullRejectsInnerCol (cyclomatic 16): rule.joinCondNullRejectsInnerCol 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":"pkg/planner/core/rule/rule_outer_join_to_semi_join.go"},"region":{"startLine":335}}}],"partialFingerprints":{"codehealthFindingId/v1":"cc74085152b00382b46ce95cb1dd25cc6e307da9f2132217925c721d658416ea"}},{"ruleId":"D1","level":"warning","message":{"text":"rule.unsatisfiable (cyclomatic 16): rule.unsatisfiable 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":"pkg/planner/core/rule/rule_predicate_simplification.go"},"region":{"startLine":285}}}],"partialFingerprints":{"codehealthFindingId/v1":"2c182a37c366ce08953fbc748f377a7840dd84971219d1bf6feec2588593b575"}},{"ruleId":"D1","level":"warning","message":{"text":"rule.discountedHandlePrefixCols (cyclomatic 16): rule.discountedHandlePrefixCols 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":"pkg/planner/core/rule/rule_prune_indexes.go"},"region":{"startLine":316}}}],"partialFingerprints":{"codehealthFindingId/v1":"af567d7ef5a6266a146af8992900b361b6349e8b89cf423698d50f87541a99e8"}},{"ruleId":"D1","level":"warning","message":{"text":"GcSubstituter.substitute (cyclomatic 16): GcSubstituter.substitute has cyclomatic complexity 16 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/rule_generate_column_substitute.go"},"region":{"startLine":176}}}],"partialFingerprints":{"codehealthFindingId/v1":"e8b86247d94dba25486127ae91e541bad4762588b102a64f95b333660ce1c057"}},{"ruleId":"D1","level":"warning","message":{"text":"stats.GetStatsTable (cyclomatic 16): stats.GetStatsTable 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":"pkg/planner/core/stats/stats.go"},"region":{"startLine":60}}}],"partialFingerprints":{"codehealthFindingId/v1":"b92de541a11312889b6010ea2cc8c91750a57a33615cc1e7fe52e84050e44d8a"}},{"ruleId":"D1","level":"warning","message":{"text":"partitionpruning.handleDroppingForRange (cyclomatic 16): partitionpruning.handleDroppingForRange 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":"pkg/planner/util/partitionpruning/partition_prune.go"},"region":{"startLine":52}}}],"partialFingerprints":{"codehealthFindingId/v1":"919a58dcaf21fb49678cf8772604a30f851b49bfe25558e2447128860c57d40f"}},{"ruleId":"D1","level":"warning","message":{"text":"privileges.checkAuthTokenClaims (cyclomatic 16): privileges.checkAuthTokenClaims 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":"pkg/privilege/privileges/privileges.go"},"region":{"startLine":444}}}],"partialFingerprints":{"codehealthFindingId/v1":"0783b1e8d725614e4b12544f59e29a6f37612a889b7c0e7c3af770ce22c9c6e8"}},{"ruleId":"D1","level":"warning","message":{"text":"compressedWriter.Flush (cyclomatic 16): compressedWriter.Flush 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":"pkg/server/internal/packetio.go"},"region":{"startLine":366}}}],"partialFingerprints":{"codehealthFindingId/v1":"c14ef661f4cb2560bd632c25ad39449fdfb6f52c70e1c303c2a83ab037ab6c91"}},{"ruleId":"D1","level":"warning","message":{"text":"Server.startNetworkListener (cyclomatic 16): Server.startNetworkListener 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":"pkg/server/server.go"},"region":{"startLine":561}}}],"partialFingerprints":{"codehealthFindingId/v1":"9fa87587c4aca2d96034327b0116685d5d34c67001418b58dc6852e49b13d507"}},{"ruleId":"D1","level":"warning","message":{"text":"session.runInBootstrapSession (cyclomatic 16): session.runInBootstrapSession 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":"pkg/session/session.go"},"region":{"startLine":4697}}}],"partialFingerprints":{"codehealthFindingId/v1":"99980779655ca640122b817284153e009551468fcdf50a55355ddde180dd199e"}},{"ruleId":"D1","level":"warning","message":{"text":"baseTxnContextProvider.OnInitialize (cyclomatic 16): baseTxnContextProvider.OnInitialize 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":"pkg/sessiontxn/isolation/base.go"},"region":{"startLine":81}}}],"partialFingerprints":{"codehealthFindingId/v1":"ee3df3801c20e0ffa8c448695ddc0afe19859da22f1254b10b8ef9184b6d62e4"}},{"ruleId":"D1","level":"warning","message":{"text":"DynamicPartitionedTableAnalysisJob.ValidateAndPrepare (cyclomatic 16): DynamicPartitionedTableAnalysisJob.ValidateAndPrepare has cyclomatic complexity 16 (threshold 15). 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, 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":"pkg/statistics/handle/autoanalyze/priorityqueue/dynamic_partitioned_table_analysis_job.go"},"region":{"startLine":161}}}],"partialFingerprints":{"codehealthFindingId/v1":"37987c287e063147e65db8186b35af798ef451a9672f2563c3bbbead5ba28897"}},{"ruleId":"D1","level":"warning","message":{"text":"Refresher.AnalyzeHighestPriorityTables (cyclomatic 16): Refresher.AnalyzeHighestPriorityTables 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":"pkg/statistics/handle/autoanalyze/refresher/refresher.go"},"region":{"startLine":93}}}],"partialFingerprints":{"codehealthFindingId/v1":"f95f5521ffed3e6a16ffcf76c77b31d41b5c5fc44528867ed5b51f68bb4234da"}},{"ruleId":"D1","level":"warning","message":{"text":"globalstats.MergePartTopN2GlobalTopN (cyclomatic 16): globalstats.MergePartTopN2GlobalTopN 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":"pkg/statistics/handle/globalstats/topn.go"},"region":{"startLine":136}}}],"partialFingerprints":{"codehealthFindingId/v1":"a268139f5e841c13b890dc1958c6dab51f42455650bb5aac8633672b671cd529"}},{"ruleId":"D1","level":"warning","message":{"text":"topnStatsMergeWorker.Run (cyclomatic 16): topnStatsMergeWorker.Run 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":"pkg/statistics/handle/globalstats/merge_worker.go"},"region":{"startLine":90}}}],"partialFingerprints":{"codehealthFindingId/v1":"66c2b3bd8fbb69963a709f7c0f04970858aef9923bd692195e0d04cf608298b0"}},{"ruleId":"D1","level":"warning","message":{"text":"Handle.getStatsByPhysicalID (cyclomatic 16): Handle.getStatsByPhysicalID has cyclomatic complexity 16 (threshold 15). Of this number, 14 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/statistics/handle/handle.go"},"region":{"startLine":205}}}],"partialFingerprints":{"codehealthFindingId/v1":"535bd09b4e2e4dcddbca1b8c4685e398c5e62729ed192775ef72f8f900e122f4"}},{"ruleId":"D1","level":"warning","message":{"text":"statsSyncLoad.readStatsForOneItem (cyclomatic 16): statsSyncLoad.readStatsForOneItem has cyclomatic complexity 16 (threshold 15). 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, 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":"pkg/statistics/handle/syncload/stats_syncload.go"},"region":{"startLine":434}}}],"partialFingerprints":{"codehealthFindingId/v1":"890927457fac2305c81692677d3bfb129d14ef154398e29538b11adfb78e4713"}},{"ruleId":"D1","level":"warning","message":{"text":"RowSampleBuilder.Collect (cyclomatic 16): RowSampleBuilder.Collect 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":"pkg/statistics/row_sampler.go"},"region":{"startLine":162}}}],"partialFingerprints":{"codehealthFindingId/v1":"d115b3b57eb13cbd5880873ed6d384d6db692cc968ef08f0624d4ab2d5ac3b07"}},{"ruleId":"D1","level":"warning","message":{"text":"copIteratorWorker.handleCopCache (cyclomatic 16): copIteratorWorker.handleCopCache 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":"pkg/store/copr/coprocessor.go"},"region":{"startLine":2586}}}],"partialFingerprints":{"codehealthFindingId/v1":"c9e71402aee0a97d00c8af146fe67caddc424ffd167b73067e56f8d787b30e93"}},{"ruleId":"D1","level":"warning","message":{"text":"TiKVDriver.OpenWithOptions (cyclomatic 16): TiKVDriver.OpenWithOptions 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, 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":"pkg/store/driver/tikv_driver.go"},"region":{"startLine":127}}}],"partialFingerprints":{"codehealthFindingId/v1":"a6593692b4d6e25ed24d2ea3a491e3c5414d105c294cd94f51d585a402a0e978"}},{"ruleId":"D1","level":"warning","message":{"text":"Helper.GetMvccByEncodedKeyWithTS (cyclomatic 16): Helper.GetMvccByEncodedKeyWithTS 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":"pkg/store/helper/helper.go"},"region":{"startLine":136}}}],"partialFingerprints":{"codehealthFindingId/v1":"041cd4201718a7e1224ee0ced51f0a368637b5384cf44cb2ed7d0eadb304785b"}},{"ruleId":"D1","level":"warning","message":{"text":"closureExecutor.indexScanProcessCore (cyclomatic 16): closureExecutor.indexScanProcessCore 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":"pkg/store/mockstore/unistore/cophandler/closure_exec.go"},"region":{"startLine":894}}}],"partialFingerprints":{"codehealthFindingId/v1":"0a039ff459448ee94bf1278a38a90a01ad525b6b04bbc3addcf7aead401b75af"}},{"ruleId":"D1","level":"warning","message":{"text":"tables.checkIndexKeys (cyclomatic 16): tables.checkIndexKeys 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":"pkg/table/tables/mutation_checker.go"},"region":{"startLine":215}}}],"partialFingerprints":{"codehealthFindingId/v1":"258f9a597866b1260ea99e28861329eebf12b203544ccb3904e572ad66eb0b5a"}},{"ruleId":"D1","level":"warning","message":{"text":"stateRemoteHandle.lockForWriteOnce (cyclomatic 16): stateRemoteHandle.lockForWriteOnce has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 188). 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":"pkg/table/tables/state_remote.go"},"region":{"startLine":180}}}],"partialFingerprints":{"codehealthFindingId/v1":"d81da2637674334c05f387a1cc92d33a767f5e8d98e7708f7063b4cfece7a1a7"}},{"ruleId":"D1","level":"warning","message":{"text":"tablecodec.Unflatten (cyclomatic 16): tablecodec.Unflatten 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":"pkg/tablecodec/tablecodec.go"},"region":{"startLine":660}}}],"partialFingerprints":{"codehealthFindingId/v1":"c51b7ba7fb2747f2de05b4bc43f4543e02c0fefb30ac03ceaa2449f7a8b69c0e"}},{"ruleId":"D1","level":"warning","message":{"text":"TimerGroupRuntime.loop (cyclomatic 16): TimerGroupRuntime.loop 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":"pkg/timer/runtime/runtime.go"},"region":{"startLine":165}}}],"partialFingerprints":{"codehealthFindingId/v1":"3ac57e4d564988bf5321ac02fc313290517a9bd72e529579b871531adaf081a6"}},{"ruleId":"D1","level":"warning","message":{"text":"cache.GetNextIntDatumFromCommonHandle (cyclomatic 16): cache.GetNextIntDatumFromCommonHandle 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":"pkg/ttl/cache/table.go"},"region":{"startLine":565}}}],"partialFingerprints":{"codehealthFindingId/v1":"385bacadc02ba85f7a138b74b275754aec6c84f5c70bad90a921024bdf65f2c0"}},{"ruleId":"D1","level":"warning","message":{"text":"cache.GetNextBytesHandleDatum (cyclomatic 16): cache.GetNextBytesHandleDatum 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":"pkg/ttl/cache/table.go"},"region":{"startLine":632}}}],"partialFingerprints":{"codehealthFindingId/v1":"22551006772e1ca8e0d493ecc10c21f1f1e7d060baed0661c2f8e8c5f090c53f"}},{"ruleId":"D1","level":"warning","message":{"text":"PhysicalTable.splitIntRanges (cyclomatic 16): PhysicalTable.splitIntRanges 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":"pkg/ttl/cache/table.go"},"region":{"startLine":340}}}],"partialFingerprints":{"codehealthFindingId/v1":"0b5b0b8798d3db14dbb63cf8778e6d67e7ade3b8c0c23c9e276fbe60927caf4b"}},{"ruleId":"D1","level":"warning","message":{"text":"JobManager.rescheduleJobs (cyclomatic 16): JobManager.rescheduleJobs 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":"pkg/ttl/ttlworker/job_manager.go"},"region":{"startLine":610}}}],"partialFingerprints":{"codehealthFindingId/v1":"fd1160ead83cda9beec6c3ab419c1ef20a5cdf3811ad1931b5ae913a850ca6d1"}},{"ruleId":"D1","level":"warning","message":{"text":"TTLTimersSyncer.SyncTimers (cyclomatic 16): TTLTimersSyncer.SyncTimers has cyclomatic complexity 16 (threshold 15). Of this number, 13 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":"pkg/ttl/ttlworker/timer_sync.go"},"region":{"startLine":176}}}],"partialFingerprints":{"codehealthFindingId/v1":"8e9447f649258b8572ed6673bff71261aca1736d8ea5511aeaf7d909d4697a67"}},{"ruleId":"D1","level":"warning","message":{"text":"TTLTimersSyncer.syncOneTimer (cyclomatic 16): TTLTimersSyncer.syncOneTimer 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":"pkg/ttl/ttlworker/timer_sync.go"},"region":{"startLine":280}}}],"partialFingerprints":{"codehealthFindingId/v1":"04c7bc47c779188470f24d9f3ae116a9ff38d620d20e5c10890c2d6fe4d2445a"}},{"ruleId":"D1","level":"warning","message":{"text":"types.matchDuration (cyclomatic 16): types.matchDuration 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":"pkg/types/time.go"},"region":{"startLine":1722}}}],"partialFingerprints":{"codehealthFindingId/v1":"9af749a68a3be9e2236873b2e95efc2ac3c0e9766edec3f1bb45692a3291fec2"}},{"ruleId":"D1","level":"warning","message":{"text":"types.time12Hour (cyclomatic 16): types.time12Hour has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 3219). 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":"pkg/types/time.go"},"region":{"startLine":3218}}}],"partialFingerprints":{"codehealthFindingId/v1":"0b487a550e7bbbe42b8f530d1efe858bde5a8a03f7b3d8b230cdc520b21fa8bb"}},{"ruleId":"D1","level":"warning","message":{"text":"Datum.convertToMysqlJSON (cyclomatic 16): Datum.convertToMysqlJSON 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":"pkg/types/datum.go"},"region":{"startLine":1807}}}],"partialFingerprints":{"codehealthFindingId/v1":"1d5e71945845d8eb367ab5bad3445d33909dfa76f67f610532a8ec50a3c1f10c"}},{"ruleId":"D1","level":"warning","message":{"text":"Row.ToString (cyclomatic 16): Row.ToString has cyclomatic complexity 16 (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/util/chunk/row.go"},"region":{"startLine":222}}}],"partialFingerprints":{"codehealthFindingId/v1":"abda8a66adf5a82f38713b1380571fd8d635021e2c57e103008a6eae05970b64"}},{"ruleId":"D1","level":"warning","message":{"text":"cet.insertWeights (cyclomatic 16): cet.insertWeights 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":"pkg/util/collate/ucadata/generator/main.go"},"region":{"startLine":177}}}],"partialFingerprints":{"codehealthFindingId/v1":"7504f37e67af49a7d8cc11de0730284e71b3060fbeb6ce48e2cbbd06c5707e72"}},{"ruleId":"D1","level":"warning","message":{"text":"extsort.buildCompactions (cyclomatic 16): extsort.buildCompactions 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":"pkg/util/extsort/disk_sorter.go"},"region":{"startLine":1151}}}],"partialFingerprints":{"codehealthFindingId/v1":"695099dfa97cf7b42ff9cc62fa1876af7a116c5b4141b62f8fbdd633465233b4"}},{"ruleId":"D1","level":"warning","message":{"text":"Filter.initRules (cyclomatic 16): Filter.initRules 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":"pkg/util/filter/filter.go"},"region":{"startLine":109}}}],"partialFingerprints":{"codehealthFindingId/v1":"4c65c3fccaf1e00c572fc5d01a63464f01bd9881bc758049eccdc48bc1a16e5f"}},{"ruleId":"D1","level":"warning","message":{"text":"keydecoder.DecodeKey (cyclomatic 16): keydecoder.DecodeKey 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":"pkg/util/keydecoder/keydecoder.go"},"region":{"startLine":74}}}],"partialFingerprints":{"codehealthFindingId/v1":"1461981aa9d18a6e8fafc373ce4a84746e9807df06a70799f299837c3bc16da3"}},{"ruleId":"D1","level":"warning","message":{"text":"topLevelJSONTokenIter.next (cyclomatic 16): topLevelJSONTokenIter.next 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":"pkg/util/partialjson/extract.go"},"region":{"startLine":73}}}],"partialFingerprints":{"codehealthFindingId/v1":"f705da9d017b67ace5fa9fc682a8982562b34cb6da645bc12a647df57049cac6"}},{"ruleId":"D1","level":"warning","message":{"text":"plancodec.DecodeBinaryPlan (cyclomatic 16): plancodec.DecodeBinaryPlan 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":"pkg/util/plancodec/binary_plan_decode.go"},"region":{"startLine":28}}}],"partialFingerprints":{"codehealthFindingId/v1":"60eb32528b9dcf1aec438cd019e5372985f8acb070615c27b38de01983c77ef8"}},{"ruleId":"D1","level":"warning","message":{"text":"plancodec.DecodeBinaryPlan4Connection (cyclomatic 16): plancodec.DecodeBinaryPlan4Connection has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/util/plancodec/binary_plan_decode.go"},"region":{"startLine":112}}}],"partialFingerprints":{"codehealthFindingId/v1":"7ec01c85f6016aa7e3420b65c0b70f180c6d0cbc32e129109f91fcdf1157cfa5"}},{"ruleId":"D1","level":"warning","message":{"text":"main.main (cyclomatic 16): main.main has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 37). 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/tazel/main.go"},"region":{"startLine":31}}}],"partialFingerprints":{"codehealthFindingId/v1":"87f835a7d1008fc188287580b99c72c4a7b782687da81cacd0519761436af683"}},{"ruleId":"D1","level":"warning","message":{"text":"CreateIndexStmt.Restore (cyclomatic 16): CreateIndexStmt.Restore 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":"pkg/parser/ast/ddl.go"},"region":{"startLine":2103}}}],"partialFingerprints":{"codehealthFindingId/v1":"cc38898a18150adfb77059dd335cbd3588b09a7cbf1cf5f1ab8e7cf8935d0875"}},{"ruleId":"D1","level":"warning","message":{"text":"AlterTableStmt.Restore (cyclomatic 16): AlterTableStmt.Restore 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":"pkg/parser/ast/ddl.go"},"region":{"startLine":4330}}}],"partialFingerprints":{"codehealthFindingId/v1":"7dde6b750d13726a318aa72451b5629bb7c393e0047d33663eb089dfde2ed819"}},{"ruleId":"D1","level":"warning","message":{"text":"PartitionOptions.Restore (cyclomatic 16): PartitionOptions.Restore 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":"pkg/parser/ast/ddl.go"},"region":{"startLine":4932}}}],"partialFingerprints":{"codehealthFindingId/v1":"b3e0ecf15073a19944e180c7cdaf3582fb3dd99b8fa55141312520f91d178093"}},{"ruleId":"D1","level":"warning","message":{"text":"FieldType.Equal (cyclomatic 16): FieldType.Equal has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/parser/types/field_type.go"},"region":{"startLine":371}}}],"partialFingerprints":{"codehealthFindingId/v1":"3693733efa6acf5551930f746362c3b17d1f26f6a5a1d24401af7c016e232c17"}},{"ruleId":"D2","level":"warning","message":{"text":"AlterTableSpec.Restore (cognitive 315): AlterTableSpec.Restore has cognitive complexity 315 (threshold 15). Drivers by points: if/else 260, loops 43, match/switch 7, boolean chains 5 (nesting depth added 177). Of this number, 307 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":"pkg/parser/ast/ddl.go"},"region":{"startLine":3616}}}],"partialFingerprints":{"codehealthFindingId/v1":"716769ae73be538237a5568b09ad42ec51591786f0ece9f77d3fd4e60f8294b1"}},{"ruleId":"D2","level":"warning","message":{"text":"executor.constructResultOfShowCreateTable (cognitive 274): executor.constructResultOfShowCreateTable has cognitive complexity 274 (threshold 15). Drivers by points: if/else 233, loops 24, boolean chains 12, match/switch 5 (nesting depth added 131). Of this number, 268 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":"pkg/executor/show.go"},"region":{"startLine":1052}}}],"partialFingerprints":{"codehealthFindingId/v1":"a8fdcba0e53caf5f34f80875cfc79f08485ab6bbdd603f1767cd645ee183f7ea"}},{"ruleId":"D2","level":"warning","message":{"text":"SimpleExec.executeAlterUser (cognitive 260): SimpleExec.executeAlterUser has cognitive complexity 260 (threshold 15). Drivers by points: if/else 206, boolean chains 32, loops 15, match/switch 7 (nesting depth added 130). 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/executor/simple.go"},"region":{"startLine":1731}}}],"partialFingerprints":{"codehealthFindingId/v1":"a29831df2a87c4e1b7006c79b42084f62dcbf80707e70f0237ac23252089095c"}},{"ruleId":"D2","level":"warning","message":{"text":"DecorrelateSolver.optimize (cognitive 251): DecorrelateSolver.optimize has cognitive complexity 251 (threshold 15). Drivers by points: if/else 149, loops 85, boolean chains 6, match/switch 6, jumps 5 (nesting depth added 176). 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/planner/core/rule_decorrelate.go"},"region":{"startLine":215}}}],"partialFingerprints":{"codehealthFindingId/v1":"0dace9dcb25c99a5db00afd48c38dd5100e9fb550a6646d917506382d2d6d496"}},{"ruleId":"D2","level":"warning","message":{"text":"ErrorManager.ReplaceConflictKeys (cognitive 233): ErrorManager.ReplaceConflictKeys has cognitive complexity 233 (threshold 15). Drivers by points: if/else 198, loops 24, match/switch 8, boolean chains 3 (nesting depth added 163). Most of this is not in the body itself: 10 of the 233 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 748, 549, 914). 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":"lightning/pkg/errormanager/errormanager.go"},"region":{"startLine":512}}}],"partialFingerprints":{"codehealthFindingId/v1":"6d4ee6ef95ed48efcede331dd667146b308e0255303e8e30968d5ef71847989b"}},{"ruleId":"D2","level":"warning","message":{"text":"AggregationPushDownSolver.aggPushDown (cognitive 215): AggregationPushDownSolver.aggPushDown has cognitive complexity 215 (threshold 15). Drivers by points: if/else 164, loops 49, boolean chains 2 (nesting depth added 164). 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/planner/core/rule_aggregation_push_down.go"},"region":{"startLine":480}}}],"partialFingerprints":{"codehealthFindingId/v1":"32580cf54eada62888a78c5bfd39f25fcb12a661dde10e4550688927b6212a7a"}},{"ruleId":"D2","level":"warning","message":{"text":"index.create (cognitive 199): index.create has cognitive complexity 199 (threshold 15). Drivers by points: if/else 177, boolean chains 16, loops 6 (nesting depth added 117). 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/table/tables/index.go"},"region":{"startLine":301}}}],"partialFingerprints":{"codehealthFindingId/v1":"c733711a4fa32c9f19dcd4955bca32d9f3cee7aa176ba883700389f504538826"}},{"ruleId":"D2","level":"warning","message":{"text":"task.runSnapshotRestore (cognitive 182): task.runSnapshotRestore has cognitive complexity 182 (threshold 15). Drivers by points: if/else 152, boolean chains 22, loops 8 (nesting depth added 54). Of this number, 142 points are the body\u0027s own statements and 40 belong to 8 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":"br/pkg/task/restore.go"},"region":{"startLine":1303}}}],"partialFingerprints":{"codehealthFindingId/v1":"d9fa38b5b76a798fb4b99a8fd7074bb518391fb25f36923b61b1b1447b30dac1"}},{"ruleId":"D2","level":"warning","message":{"text":"worker.onReorganizePartition (cognitive 182): worker.onReorganizePartition has cognitive complexity 182 (threshold 15). Drivers by points: if/else 152, loops 21, boolean chains 8, match/switch 1 (nesting depth added 99). Of this number, 162 points are the body\u0027s own statements and 20 belong to 10 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":"pkg/ddl/partition.go"},"region":{"startLine":3234}}}],"partialFingerprints":{"codehealthFindingId/v1":"db5a75e1b022e578b121d1f0f9480e2b215099a585561cf7b57bf2ba7e63d9df"}},{"ruleId":"D2","level":"warning","message":{"text":"core.findBestTask4LogicalDataSource (cognitive 180): core.findBestTask4LogicalDataSource has cognitive complexity 180 (threshold 15). Drivers by points: if/else 148, boolean chains 20, loops 12 (nesting depth added 91). Of this number, 166 points are the body\u0027s own statements and 14 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/find_best_task.go"},"region":{"startLine":2009}}}],"partialFingerprints":{"codehealthFindingId/v1":"31b1603a2797494ad516d2a18ed641fc777ed5bdeab923e4761990ee012c12c8"}},{"ruleId":"D2","level":"warning","message":{"text":"PlanBuilder.buildDataSource (cognitive 172): PlanBuilder.buildDataSource has cognitive complexity 172 (threshold 15). Drivers by points: if/else 139, loops 22, boolean chains 11 (nesting depth added 89). Of this number, 163 points are the body\u0027s own statements and 9 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/logical_plan_builder.go"},"region":{"startLine":4930}}}],"partialFingerprints":{"codehealthFindingId/v1":"9bebb101628d28bb665ee17ff75dc042d4b5642f81efd43e1f5c0aaa73ccfcf5"}},{"ruleId":"D2","level":"warning","message":{"text":"executor.getStmtDbLabel (cognitive 168): executor.getStmtDbLabel has cognitive complexity 168 (threshold 15). Drivers by points: if/else 101, loops 45, match/switch 19, boolean chains 3 (nesting depth added 93). 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/executor/compiler.go"},"region":{"startLine":234}}}],"partialFingerprints":{"codehealthFindingId/v1":"f5953f133c7a54447468b9a3bbed11ec57767fc43b6754a8db1871f0b327dc88"}},{"ruleId":"D2","level":"warning","message":{"text":"codec.serializeKeysImpl (cognitive 164): codec.serializeKeysImpl has cognitive complexity 164 (threshold 15). Drivers by points: if/else 119, loops 39, boolean chains 4, match/switch 2 (nesting depth added 116). Of this number, 161 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":"pkg/util/codec/codec.go"},"region":{"startLine":652}}}],"partialFingerprints":{"codehealthFindingId/v1":"cd97266f13ceb59412b0290d676fb37a03f55ddf21055c0733e1c0ab45138219"}},{"ruleId":"D2","level":"warning","message":{"text":"core.getPossibleAccessPaths (cognitive 160): core.getPossibleAccessPaths has cognitive complexity 160 (threshold 15). Drivers by points: if/else 130, loops 16, boolean chains 14 (nesting depth added 86). 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/planner/core/planbuilder.go"},"region":{"startLine":1320}}}],"partialFingerprints":{"codehealthFindingId/v1":"103f73b7721646279bd84895f71293235e42dcf8f2da93dadca85deb1da92095"}},{"ruleId":"D2","level":"warning","message":{"text":"codec.HashChunkSelected (cognitive 159): codec.HashChunkSelected has cognitive complexity 159 (threshold 15). Drivers by points: if/else 118, loops 26, boolean chains 14, match/switch 1 (nesting depth added 85). 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":"pkg/util/codec/codec.go"},"region":{"startLine":919}}}],"partialFingerprints":{"codehealthFindingId/v1":"2f77dc8ef5da1c04b45e7e8f91761c5fd46e94fa0df24b119a2140307ee76e5c"}},{"ruleId":"D2","level":"warning","message":{"text":"PlanBuilder.buildDDL (cognitive 156): PlanBuilder.buildDDL has cognitive complexity 156 (threshold 15). Drivers by points: if/else 132, loops 17, boolean chains 6, match/switch 1 (nesting depth added 86). 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":"pkg/planner/core/planbuilder.go"},"region":{"startLine":5300}}}],"partialFingerprints":{"codehealthFindingId/v1":"0fe36f86ae4b9a93e0a3be03893baad132f718f27fac34fc074f9db1eea9cd57"}},{"ruleId":"D2","level":"warning","message":{"text":"cardinality.Selectivity (cognitive 155): cardinality.Selectivity has cognitive complexity 155 (threshold 15). Drivers by points: if/else 107, loops 20, match/switch 19, boolean chains 8, jumps 1 (nesting depth added 83). 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/planner/cardinality/selectivity.go"},"region":{"startLine":51}}}],"partialFingerprints":{"codehealthFindingId/v1":"aacc953e9bb24c7a7b1bc030c9f2bbc6cd21cccec677ca982d19984f8367656c"}},{"ruleId":"D2","level":"warning","message":{"text":"checkIndexWorker.HandleTask (cognitive 153): checkIndexWorker.HandleTask has cognitive complexity 153 (threshold 15). Drivers by points: if/else 120, loops 21, boolean chains 11, match/switch 1 (nesting depth added 77). Of this number, 134 points are the body\u0027s own statements and 19 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":"pkg/executor/check_table_index.go"},"region":{"startLine":474}}}],"partialFingerprints":{"codehealthFindingId/v1":"1cc57a3cb83444bbc95db2a8e3d60d63c26c41d345e45fce1396004e927a7c08"}},{"ruleId":"D2","level":"warning","message":{"text":"Plan.initOptions (cognitive 147): Plan.initOptions has cognitive complexity 147 (threshold 15). Drivers by points: if/else 112, boolean chains 23, loops 10, match/switch 2 (nesting depth added 47). Of this number, 140 points are the body\u0027s own statements and 7 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":"pkg/executor/importer/import.go"},"region":{"startLine":767}}}],"partialFingerprints":{"codehealthFindingId/v1":"09b5d6a1700c9647c459bddfd5064064d83e5d16daddf02d6bc873881d644040"}},{"ruleId":"D2","level":"warning","message":{"text":"chunkProcessor.encodeLoop (cognitive 143): chunkProcessor.encodeLoop has cognitive complexity 143 (threshold 15). Drivers by points: if/else 110, loops 17, match/switch 9, boolean chains 4, jumps 3 (nesting depth added 93). Of this number, 137 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":"lightning/pkg/importer/chunk_process.go"},"region":{"startLine":246}}}],"partialFingerprints":{"codehealthFindingId/v1":"0c4624912474985245b9ef4f59596ed31d870c887e80ed5028b852f9779c09b3"}},{"ruleId":"D2","level":"warning","message":{"text":"SelectStmt.Restore (cognitive 141): SelectStmt.Restore has cognitive complexity 141 (threshold 15). Drivers by points: if/else 123, loops 11, boolean chains 4, match/switch 3 (nesting depth added 79). 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/parser/ast/dml.go"},"region":{"startLine":1330}}}],"partialFingerprints":{"codehealthFindingId/v1":"ff83466dcf6bb5e273f38f7e793bbcd3375881746e246377353843fedd8ab91c"}},{"ruleId":"D2","level":"warning","message":{"text":"VecGroupChecker.evalGroupItemsAndResolveGroups (cognitive 139): VecGroupChecker.evalGroupItemsAndResolveGroups has cognitive complexity 139 (threshold 15). Drivers by points: if/else 94, match/switch 21, loops 16, boolean chains 8 (nesting depth added 86). 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/executor/internal/vecgroupchecker/vec_group_checker.go"},"region":{"startLine":350}}}],"partialFingerprints":{"codehealthFindingId/v1":"8977833740f77e04d55b8ba8319b7f23023f3e7945e7f941b84496cc6c256ac4"}},{"ruleId":"D2","level":"warning","message":{"text":"ShowStmt.Restore (cognitive 139): ShowStmt.Restore has cognitive complexity 139 (threshold 15). Drivers by points: if/else 125, match/switch 7, loops 6, boolean chains 1 (nesting depth added 76). Of this number, 128 points are the body\u0027s own statements and 11 belong to 4 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":"pkg/parser/ast/dml.go"},"region":{"startLine":3296}}}],"partialFingerprints":{"codehealthFindingId/v1":"de8c88fd7ba888604f33fe253fe007705c55e1138c354120d720e165d78c1c6a"}},{"ruleId":"D2","level":"warning","message":{"text":"PlanBuilder.buildSelect (cognitive 137): PlanBuilder.buildSelect has cognitive complexity 137 (threshold 15). Drivers by points: if/else 118, boolean chains 13, loops 6 (nesting depth added 51). 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/planner/core/logical_plan_builder.go"},"region":{"startLine":4260}}}],"partialFingerprints":{"codehealthFindingId/v1":"3f1e2a91d26c313a89ba48f31824bad9e062c82d22198f6dde9d9187a5168c61"}},{"ruleId":"D2","level":"warning","message":{"text":"codec.preAllocForSerializedKeyBuffer (cognitive 136): codec.preAllocForSerializedKeyBuffer has cognitive complexity 136 (threshold 15). Drivers by points: if/else 93, loops 38, boolean chains 3, match/switch 2 (nesting depth added 91). Of this number, 131 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":"pkg/util/codec/codec.go"},"region":{"startLine":459}}}],"partialFingerprints":{"codehealthFindingId/v1":"96ce00a90c3c36adb6ba22bde9e198a8a985687932643bb3b24e4abec3390361"}},{"ruleId":"D2","level":"warning","message":{"text":"SimpleExec.executeCreateUser (cognitive 135): SimpleExec.executeCreateUser has cognitive complexity 135 (threshold 15). Drivers by points: if/else 116, boolean chains 12, loops 5, match/switch 2 (nesting depth added 56). 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/executor/simple.go"},"region":{"startLine":1049}}}],"partialFingerprints":{"codehealthFindingId/v1":"f3e02caa93839229b92672a68e3b3de2a33b83aa9a2f80c4efd64f2bee4625ea"}},{"ruleId":"D2","level":"warning","message":{"text":"expression.toBool (cognitive 131): expression.toBool has cognitive complexity 131 (threshold 15). Drivers by points: if/else 102, loops 23, match/switch 6 (nesting depth added 82). 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":"pkg/expression/expression.go"},"region":{"startLine":507}}}],"partialFingerprints":{"codehealthFindingId/v1":"373ffb40f3de6cf8e849f0ec4798e66844bcb16c078ddb0147e32202243d9414"}},{"ruleId":"D2","level":"warning","message":{"text":"statistics.MergePartitionHist2GlobalHist (cognitive 130): statistics.MergePartitionHist2GlobalHist has cognitive complexity 130 (threshold 15). Drivers by points: if/else 101, loops 28, boolean chains 1 (nesting depth added 77). 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/statistics/histogram.go"},"region":{"startLine":1670}}}],"partialFingerprints":{"codehealthFindingId/v1":"c439378036ea4e6cac113c035d2ae0e2d7ef405320806f268399749c16bc6066"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.BuildTableInfo (cognitive 128): ddl.BuildTableInfo has cognitive complexity 128 (threshold 15). Drivers by points: if/else 110, loops 9, match/switch 5, boolean chains 4 (nesting depth added 77). 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/ddl/create_table.go"},"region":{"startLine":1323}}}],"partialFingerprints":{"codehealthFindingId/v1":"72af6a2beda92bb9feb92bf3a60876bf5e23c221a1e4fc8c8df86948fa255e38"}},{"ruleId":"D2","level":"warning","message":{"text":"executor.AlterTable (cognitive 126): executor.AlterTable has cognitive complexity 126 (threshold 15). Drivers by points: if/else 103, match/switch 9, loops 8, boolean chains 6 (nesting depth added 75). 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/ddl/executor.go"},"region":{"startLine":1707}}}],"partialFingerprints":{"codehealthFindingId/v1":"0d94a149aa9aaa9e3850ae91a2f5fee61efa89ef68ffd8383800cb67cf94fc46"}},{"ruleId":"D2","level":"warning","message":{"text":"BatchPointGetExec.initialize (cognitive 126): BatchPointGetExec.initialize has cognitive complexity 126 (threshold 15). Drivers by points: if/else 107, boolean chains 13, loops 6 (nesting depth added 64). Of this number, 106 points are the body\u0027s own statements and 20 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":"pkg/executor/batch_point_get.go"},"region":{"startLine":253}}}],"partialFingerprints":{"codehealthFindingId/v1":"0803a9bd3672e436cba473b4885fd02b4c5c6759f877ff355b31b6984592ddcd"}},{"ruleId":"D2","level":"warning","message":{"text":"core.newBatchPointGetPlan (cognitive 125): core.newBatchPointGetPlan has cognitive complexity 125 (threshold 15). Drivers by points: if/else 97, loops 15, match/switch 9, boolean chains 4 (nesting depth added 77). 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/planner/core/point_get_plan.go"},"region":{"startLine":164}}}],"partialFingerprints":{"codehealthFindingId/v1":"0deb6858453c5d6b2acca29dd97d72440c064415eb3ffa580fcd3f12589ba2ce"}},{"ruleId":"D2","level":"warning","message":{"text":"Controller.importTables (cognitive 122): Controller.importTables has cognitive complexity 122 (threshold 15). Drivers by points: if/else 89, loops 26, boolean chains 4, match/switch 3 (nesting depth added 63). Of this number, 84 points are the body\u0027s own statements and 38 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":"lightning/pkg/importer/import.go"},"region":{"startLine":1317}}}],"partialFingerprints":{"codehealthFindingId/v1":"a707bab0071e30c0f5c973a26c903c42c5202397077cbc410708eb47e363854a"}},{"ruleId":"D2","level":"warning","message":{"text":"physicalop.BuildFinalModeAggregation (cognitive 117): physicalop.BuildFinalModeAggregation has cognitive complexity 117 (threshold 15). Drivers by points: if/else 94, loops 13, boolean chains 10 (nesting depth added 68). Of this number, 82 points are the body\u0027s own statements and 35 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/planner/core/operator/physicalop/base_physical_agg.go"},"region":{"startLine":614}}}],"partialFingerprints":{"codehealthFindingId/v1":"5b6744f45de74eff8576f43c8dac02a21d6732db6170512904db5ad1202e7756"}},{"ruleId":"D2","level":"warning","message":{"text":"PlanBuilder.buildProjection (cognitive 117): PlanBuilder.buildProjection has cognitive complexity 117 (threshold 15). Drivers by points: if/else 85, loops 18, match/switch 9, boolean chains 5 (nesting depth added 77). 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/planner/core/logical_plan_builder.go"},"region":{"startLine":1773}}}],"partialFingerprints":{"codehealthFindingId/v1":"421b07dd9e42baceac7a4b15f7cba4e305ca11ed03855e9a8a69b9f9efb02502"}},{"ruleId":"D2","level":"warning","message":{"text":"main.main1 (cognitive 117): main.main1 has cognitive complexity 117 (threshold 15). Drivers by points: if/else 78, loops 19, match/switch 12, boolean chains 8 (nesting depth added 52). Of this number, 100 points are the body\u0027s own statements and 17 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":"pkg/parser/goyacc/main.go"},"region":{"startLine":244}}}],"partialFingerprints":{"codehealthFindingId/v1":"3af9a842a0b122b1187fc9979673698ffb11251f7c204ad44b97951922ea7caa"}},{"ruleId":"D2","level":"warning","message":{"text":"GrantExec.Next (cognitive 116): GrantExec.Next has cognitive complexity 116 (threshold 15). Drivers by points: if/else 97, loops 10, boolean chains 7, match/switch 2 (nesting depth added 61). Of this number, 113 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":"pkg/executor/grant.go"},"region":{"startLine":74}}}],"partialFingerprints":{"codehealthFindingId/v1":"35859ec487f35de12ca3fb3ccb2222a5de6bb3cfbed779db0a00e6586a57ff14"}},{"ruleId":"D2","level":"warning","message":{"text":"BatchPointGetPlan.PrunePartitionsAndValues (cognitive 114): BatchPointGetPlan.PrunePartitionsAndValues has cognitive complexity 114 (threshold 15). Drivers by points: if/else 77, loops 23, boolean chains 14 (nesting depth added 58). 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/planner/core/operator/physicalop/physical_batch_point_get.go"},"region":{"startLine":815}}}],"partialFingerprints":{"codehealthFindingId/v1":"c8e0653ae9eed44445bf1734d8e308f44ebb0e5f5bc6817d9060268bcc7a21fb"}},{"ruleId":"D2","level":"warning","message":{"text":"TableImporter.postProcess (cognitive 113): TableImporter.postProcess has cognitive complexity 113 (threshold 15). Drivers by points: if/else 91, boolean chains 12, loops 5, match/switch 5 (nesting depth added 58). 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":"lightning/pkg/importer/table_import.go"},"region":{"startLine":987}}}],"partialFingerprints":{"codehealthFindingId/v1":"66828b6f533be91f013400338163d6c135ac25d7c64f314467c9df1b1f9c5082"}},{"ruleId":"D2","level":"warning","message":{"text":"executor.updateRecord (cognitive 111): executor.updateRecord has cognitive complexity 111 (threshold 15). Drivers by points: if/else 93, boolean chains 10, loops 8 (nesting depth added 46). Of this number, 87 points are the body\u0027s own statements and 24 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":"pkg/executor/write.go"},"region":{"startLine":81}}}],"partialFingerprints":{"codehealthFindingId/v1":"8eefa7e4e0501aed7db7d3d78590bf58e7beb0f0a880be64835af63b20f50d09"}},{"ruleId":"D2","level":"warning","message":{"text":"MySQLPrivilege.showGrants (cognitive 111): MySQLPrivilege.showGrants has cognitive complexity 111 (threshold 15). Drivers by points: if/else 74, loops 32, boolean chains 5 (nesting depth added 51). Of this number, 82 points are the body\u0027s own statements and 29 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":"pkg/privilege/privileges/cache.go"},"region":{"startLine":1740}}}],"partialFingerprints":{"codehealthFindingId/v1":"8e52905a67e211802b578c2832ee9066bb82489d09062c4263c78f5399dcfd17"}},{"ruleId":"D2","level":"warning","message":{"text":"tables.partitionedTableUpdateRecord (cognitive 110): tables.partitionedTableUpdateRecord has cognitive complexity 110 (threshold 15). Drivers by points: if/else 101, boolean chains 8, match/switch 1 (nesting depth added 44). Of this number, 95 points are the body\u0027s own statements and 15 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":"pkg/table/tables/partition.go"},"region":{"startLine":1911}}}],"partialFingerprints":{"codehealthFindingId/v1":"01de6c5b42191cd938c75e97460e8709ec74fd37d1521c22474040316b262d23"}},{"ruleId":"D2","level":"warning","message":{"text":"AnalyzeColumnsExec.subBuildWorker (cognitive 108): AnalyzeColumnsExec.subBuildWorker has cognitive complexity 108 (threshold 15). Drivers by points: if/else 84, loops 14, boolean chains 4, jumps 4, match/switch 2 (nesting depth added 74). Of this number, 104 points are the body\u0027s own statements and 4 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":"pkg/executor/analyze_col_sampling.go"},"region":{"startLine":712}}}],"partialFingerprints":{"codehealthFindingId/v1":"8343474a3f808b508aff167d19285c5bf4ad63effc37b0ba64b92385ff4c6c6c"}},{"ruleId":"D2","level":"warning","message":{"text":"Engine.ingestSSTLoop (cognitive 108): Engine.ingestSSTLoop has cognitive complexity 108 (threshold 15). Drivers by points: if/else 71, loops 23, match/switch 12, jumps 2 (nesting depth added 70). Of this number, 38 points are the body\u0027s own statements and 70 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":"pkg/ingestor/ingestctrl/engine.go"},"region":{"startLine":634}}}],"partialFingerprints":{"codehealthFindingId/v1":"1a68a4943a22d900663f43b1cc0b7f9fa702f558634ffda75251b331f3338752"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.getFuncCallDefaultValue (cognitive 106): ddl.getFuncCallDefaultValue has cognitive complexity 106 (threshold 15). Drivers by points: if/else 95, boolean chains 10, match/switch 1 (nesting depth added 60). 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":"pkg/ddl/add_column.go"},"region":{"startLine":651}}}],"partialFingerprints":{"codehealthFindingId/v1":"d8fc0b123908712270fda4f7b1d64e084abf9547029526e87c6a8098846d9c64"}},{"ruleId":"D2","level":"warning","message":{"text":"InsertStmt.Restore (cognitive 106): InsertStmt.Restore has cognitive complexity 106 (threshold 15). Drivers by points: if/else 82, loops 21, match/switch 2, boolean chains 1 (nesting depth added 60). 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/parser/ast/dml.go"},"region":{"startLine":2431}}}],"partialFingerprints":{"codehealthFindingId/v1":"e7da12b5fe23fb5287d76601765b154cec9ad04baea5e3e5373eb493a379955d"}},{"ruleId":"D2","level":"warning","message":{"text":"PlanBuilder.buildRecursiveCTE (cognitive 105): PlanBuilder.buildRecursiveCTE has cognitive complexity 105 (threshold 15). Drivers by points: if/else 93, loops 6, match/switch 4, boolean chains 2 (nesting depth added 71). 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":"pkg/planner/core/logical_plan_builder.go"},"region":{"startLine":7749}}}],"partialFingerprints":{"codehealthFindingId/v1":"ba5d6a8139d8d321a190af29a1d8f47878cb6e745d916c4dc2c9d7ab7679ea0f"}},{"ruleId":"D2","level":"warning","message":{"text":"TableImporter.preprocessEngine (cognitive 103): TableImporter.preprocessEngine has cognitive complexity 103 (threshold 15). Drivers by points: if/else 79, boolean chains 9, loops 9, match/switch 5, jumps 1 (nesting depth added 45). Of this number, 66 points are the body\u0027s own statements and 37 belong to 4 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":"lightning/pkg/importer/table_import.go"},"region":{"startLine":660}}}],"partialFingerprints":{"codehealthFindingId/v1":"2a277ce0484ebc4a12b18b7e684bb553f6369643e126fdbd3853e77e541455fa"}},{"ruleId":"D2","level":"warning","message":{"text":"expression.EvalExpr (cognitive 103): expression.EvalExpr has cognitive complexity 103 (threshold 15). Drivers by points: if/else 74, loops 24, match/switch 4, boolean chains 1 (nesting depth added 66). 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/expression/expression.go"},"region":{"startLine":678}}}],"partialFingerprints":{"codehealthFindingId/v1":"85bedb729f5a7a3f5ca32abb258b6362cd8494911d6593c2532c2266b4d2b7c9"}},{"ruleId":"D2","level":"warning","message":{"text":"subscriber.handle (cognitive 103): subscriber.handle has cognitive complexity 103 (threshold 15). Drivers by points: if/else 69, loops 33, match/switch 1 (nesting depth added 60). 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":"pkg/statistics/handle/ddl/subscriber.go"},"region":{"startLine":49}}}],"partialFingerprints":{"codehealthFindingId/v1":"89f965193dcbd20e7e214eb0bae8532242cffcc5b89bedcfd2e028f3871c1665"}},{"ruleId":"D2","level":"warning","message":{"text":"TableCommon.addRecord (cognitive 103): TableCommon.addRecord has cognitive complexity 103 (threshold 15). Drivers by points: if/else 93, boolean chains 6, loops 4 (nesting depth added 43). Of this number, 100 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":"pkg/table/tables/tables.go"},"region":{"startLine":748}}}],"partialFingerprints":{"codehealthFindingId/v1":"00f39ff3f3327e016f719c4c824d24910356a9f67be1312f4ee0e56565256824"}},{"ruleId":"D2","level":"warning","message":{"text":"Tracker.Consume (cognitive 103): Tracker.Consume has cognitive complexity 103 (threshold 15). Drivers by points: if/else 87, boolean chains 9, loops 7 (nesting depth added 59). Of this number, 100 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":"pkg/util/memory/tracker.go"},"region":{"startLine":453}}}],"partialFingerprints":{"codehealthFindingId/v1":"e484357ce58c405feee6b07b4046c76b8ccbc95a7da46e9a0a2222d6c07de9f4"}},{"ruleId":"D2","level":"warning","message":{"text":"testutil.genRandomColumn (cognitive 102): testutil.genRandomColumn has cognitive complexity 102 (threshold 15). Drivers by points: if/else 69, loops 28, match/switch 5 (nesting depth added 60). Of this number, 98 points are the body\u0027s own statements and 4 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":"pkg/executor/internal/testutil/testutil.go"},"region":{"startLine":371}}}],"partialFingerprints":{"codehealthFindingId/v1":"9ec7cd1e445f68ba94f6ab00840ebbd0ee141b4d9fcb53607c997f3399fd8469"}},{"ruleId":"D2","level":"warning","message":{"text":"MVCCStore.pessimisticLockInner (cognitive 101): MVCCStore.pessimisticLockInner has cognitive complexity 101 (threshold 15). Drivers by points: if/else 90, loops 8, boolean chains 3 (nesting depth added 58). 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/store/mockstore/unistore/tikv/mvcc.go"},"region":{"startLine":240}}}],"partialFingerprints":{"codehealthFindingId/v1":"a386255688270dcc5e592a9be637d18c0d36ad01e596ccc7a0c603cab062458b"}},{"ruleId":"D2","level":"warning","message":{"text":"session.executeStmtImpl (cognitive 99): session.executeStmtImpl has cognitive complexity 99 (threshold 15). Drivers by points: if/else 87, boolean chains 6, loops 3, match/switch 3 (nesting depth added 38). Of this number, 90 points are the body\u0027s own statements and 9 belong to 4 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":"pkg/session/session.go"},"region":{"startLine":2428}}}],"partialFingerprints":{"codehealthFindingId/v1":"b74aa8bca86e266fe3b6cdd427343d9f202df21b9c4fef92bc066f5fcae15cf6"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.insertJobIntoDeleteRangeTable (cognitive 97): ddl.insertJobIntoDeleteRangeTable has cognitive complexity 97 (threshold 15). Drivers by points: if/else 79, loops 17, match/switch 1 (nesting depth added 56). Of this number, 95 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":"pkg/ddl/delete_range.go"},"region":{"startLine":277}}}],"partialFingerprints":{"codehealthFindingId/v1":"443d7d37c78bad0b4b70c9e6ac5a45c5e4383f1cf1f6d77e6e47d29e7613ceef"}},{"ruleId":"D2","level":"warning","message":{"text":"expression.ColumnSubstituteImpl (cognitive 96): expression.ColumnSubstituteImpl has cognitive complexity 96 (threshold 15). Drivers by points: if/else 77, boolean chains 9, match/switch 8, loops 2 (nesting depth added 58). 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":"pkg/expression/util.go"},"region":{"startLine":566}}}],"partialFingerprints":{"codehealthFindingId/v1":"527b08aee6798746ce1563d8b3f19cec2cb72c364dc524f2665da2512d09a525"}},{"ruleId":"D2","level":"warning","message":{"text":"PlanBuilder.coalesceCommonColumns (cognitive 96): PlanBuilder.coalesceCommonColumns has cognitive complexity 96 (threshold 15). Drivers by points: if/else 75, loops 16, boolean chains 5 (nesting depth added 49). Of this number, 88 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":"pkg/planner/core/logical_plan_builder.go"},"region":{"startLine":1148}}}],"partialFingerprints":{"codehealthFindingId/v1":"6aa4dda62aa8bfe139533683c4791bda033e59779df398d19970b72add44d4ca"}},{"ruleId":"D2","level":"warning","message":{"text":"memtableRetriever.setDataFromPartitions (cognitive 94): memtableRetriever.setDataFromPartitions has cognitive complexity 94 (threshold 15). Drivers by points: if/else 71, loops 15, match/switch 5, boolean chains 3 (nesting depth added 65). 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/executor/infoschema_reader.go"},"region":{"startLine":1309}}}],"partialFingerprints":{"codehealthFindingId/v1":"c8c757453ca2abdae22c2cc4772fd0c15d4e0bec974313529bd9d36dbcaaa48f"}},{"ruleId":"D2","level":"warning","message":{"text":"PlanBuilder.buildUpdateLists (cognitive 94): PlanBuilder.buildUpdateLists has cognitive complexity 94 (threshold 15). Drivers by points: if/else 72, loops 11, boolean chains 8, match/switch 3 (nesting depth added 47). Of this number, 91 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":"pkg/planner/core/logical_plan_builder.go"},"region":{"startLine":6303}}}],"partialFingerprints":{"codehealthFindingId/v1":"9e81502f15fec7d88ce2e25fea854043a026f62704b4408d15999e1d6433002b"}},{"ruleId":"D2","level":"warning","message":{"text":"worker.onCreateIndex (cognitive 93): worker.onCreateIndex has cognitive complexity 93 (threshold 15). Drivers by points: if/else 70, loops 17, match/switch 3, jumps 2, boolean chains 1 (nesting depth added 54). Of this number, 75 points are the body\u0027s own statements and 18 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/ddl/index.go"},"region":{"startLine":1161}}}],"partialFingerprints":{"codehealthFindingId/v1":"74ac6915c81bb27fdd6b65a6337e9b9634e52f79debc2efae4eee6eef5c29813"}},{"ruleId":"D2","level":"warning","message":{"text":"rangeDetacher.detachDNFCondAndBuildRangeForIndex (cognitive 92): rangeDetacher.detachDNFCondAndBuildRangeForIndex has cognitive complexity 92 (threshold 15). Drivers by points: if/else 81, loops 6, boolean chains 5 (nesting depth added 59). 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/util/ranger/detacher.go"},"region":{"startLine":849}}}],"partialFingerprints":{"codehealthFindingId/v1":"687c36dfc3863eb5f4eb5c9fac2bab828f4168e27ab47750ed2cbacc493fbbe3"}},{"ruleId":"D2","level":"warning","message":{"text":"InsertValues.batchCheckAndInsert (cognitive 91): InsertValues.batchCheckAndInsert has cognitive complexity 91 (threshold 15). Drivers by points: if/else 84, loops 4, boolean chains 3 (nesting depth added 56). 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/executor/insert_common.go"},"region":{"startLine":1244}}}],"partialFingerprints":{"codehealthFindingId/v1":"86c4c3fda8e007605b0ea216fa0f0c67e15e3e79333edb5074fbba1fd1a7a45f"}},{"ruleId":"D2","level":"warning","message":{"text":"PartitionProcessor.getUsedHashPartitions (cognitive 91): PartitionProcessor.getUsedHashPartitions has cognitive complexity 91 (threshold 15). Drivers by points: if/else 73, loops 13, boolean chains 5 (nesting depth added 60). 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/planner/core/rule/rule_partition_processor.go"},"region":{"startLine":159}}}],"partialFingerprints":{"codehealthFindingId/v1":"55861d8acbd456e579657696b82f60a84118eee48e101ca93d6f570b0ed9c635"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.buildTablePartitionInfo (cognitive 90): ddl.buildTablePartitionInfo has cognitive complexity 90 (threshold 15). Drivers by points: if/else 71, loops 12, boolean chains 6, match/switch 1 (nesting depth added 44). 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/ddl/partition.go"},"region":{"startLine":567}}}],"partialFingerprints":{"codehealthFindingId/v1":"49cd510df90d2abdc92e9ce42e40f25af581e2bee3c671faf8db90779151c28b"}},{"ruleId":"D2","level":"warning","message":{"text":"PointGetExecutor.Next (cognitive 90): PointGetExecutor.Next has cognitive complexity 90 (threshold 15). Drivers by points: if/else 88, boolean chains 2 (nesting depth added 56). Of this number, 87 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":"pkg/executor/point_get.go"},"region":{"startLine":303}}}],"partialFingerprints":{"codehealthFindingId/v1":"235093c363f04637878c95f62a1e2783b04fdfade8a16956fc11feb12be2d19e"}},{"ruleId":"D2","level":"warning","message":{"text":"LogicalJoin.updateEQCond (cognitive 90): LogicalJoin.updateEQCond has cognitive complexity 90 (threshold 15). Drivers by points: if/else 68, boolean chains 15, loops 7 (nesting depth added 45). Of this number, 32 points are the body\u0027s own statements and 58 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/planner/core/operator/logicalop/logical_join.go"},"region":{"startLine":1700}}}],"partialFingerprints":{"codehealthFindingId/v1":"0eb500097f93b0cb48bb2c6bfab8885a27367fa7c0add28f953b0744a98989d8"}},{"ruleId":"D2","level":"warning","message":{"text":"Client.RunLoop (cognitive 89): Client.RunLoop has cognitive complexity 89 (threshold 15). Drivers by points: if/else 72, jumps 7, loops 5, match/switch 5 (nesting depth added 59). 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":"br/pkg/backup/client.go"},"region":{"startLine":191}}}],"partialFingerprints":{"codehealthFindingId/v1":"0ad7400a673616ead12b65765da7a73f6c87bd78f51b1cad8d3f617c5d2f340c"}},{"ruleId":"D2","level":"warning","message":{"text":"main.genColumnData (cognitive 89): main.genColumnData has cognitive complexity 89 (threshold 15). Drivers by points: if/else 87, boolean chains 1, match/switch 1 (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/importer/db.go"},"region":{"startLine":136}}}],"partialFingerprints":{"codehealthFindingId/v1":"0e3a20b2ffca79dd4241dc7eb6b4de403f381f6c9397201acdec17185382d774"}},{"ruleId":"D2","level":"warning","message":{"text":"copr.buildCopTasks (cognitive 89): copr.buildCopTasks has cognitive complexity 89 (threshold 15). Drivers by points: if/else 68, loops 13, boolean chains 8 (nesting depth added 41). Of this number, 88 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":"pkg/store/copr/coprocessor.go"},"region":{"startLine":525}}}],"partialFingerprints":{"codehealthFindingId/v1":"0c7cc8f9aacc7fed6d5145957190ee867102d6d8806ceca6c79168eddbd2e656"}},{"ruleId":"D2","level":"warning","message":{"text":"core.derivePathStatsAndTryHeuristics (cognitive 88): core.derivePathStatsAndTryHeuristics has cognitive complexity 88 (threshold 15). Drivers by points: if/else 65, boolean chains 13, loops 10 (nesting depth added 40). 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/planner/core/stats.go"},"region":{"startLine":633}}}],"partialFingerprints":{"codehealthFindingId/v1":"e9b9cc1692bf2d1fd7d3682e23da0c701e61f30eb7f43aa37284bcd09c1685ab"}},{"ruleId":"D2","level":"warning","message":{"text":"rangeDetacher.detachCNFCondAndBuildRangeForIndex (cognitive 88): rangeDetacher.detachCNFCondAndBuildRangeForIndex has cognitive complexity 88 (threshold 15). Drivers by points: if/else 76, boolean chains 7, loops 5 (nesting depth added 45). 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/util/ranger/detacher.go"},"region":{"startLine":397}}}],"partialFingerprints":{"codehealthFindingId/v1":"bcb1f913e2dd1f8919f3cb154fe152bdca523a20f824a52a3b4c3acae1a70dd5"}},{"ruleId":"D2","level":"warning","message":{"text":"csvHeaderCheckItem.Check (cognitive 87): csvHeaderCheckItem.Check has cognitive complexity 87 (threshold 15). Drivers by points: if/else 62, loops 18, boolean chains 6, jumps 1 (nesting depth added 40). 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":"lightning/pkg/importer/precheck_impl.go"},"region":{"startLine":1160}}}],"partialFingerprints":{"codehealthFindingId/v1":"e3ff208ac71e7e208dfa6e894127e438e16fb82d566e6d4572ddd6e0919bab8f"}},{"ruleId":"D2","level":"warning","message":{"text":"VecGroupChecker.getFirstAndLastRowDatum (cognitive 87): VecGroupChecker.getFirstAndLastRowDatum has cognitive complexity 87 (threshold 15). Drivers by points: if/else 86, match/switch 1 (nesting depth added 36). 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":"pkg/executor/internal/vecgroupchecker/vec_group_checker.go"},"region":{"startLine":160}}}],"partialFingerprints":{"codehealthFindingId/v1":"8906390402dd61a635a01befb46be4849fcc33e1cf53f7dddf022662f8881197"}},{"ruleId":"D2","level":"warning","message":{"text":"core.tryToGetMppHashJoin (cognitive 87): core.tryToGetMppHashJoin has cognitive complexity 87 (threshold 15). Drivers by points: if/else 68, boolean chains 16, match/switch 3 (nesting depth added 30). Of this number, 86 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":"pkg/planner/core/exhaust_physical_plans.go"},"region":{"startLine":1939}}}],"partialFingerprints":{"codehealthFindingId/v1":"fe68404d57fead0e9e9f0416485352b845bfdcefc24a5812e3cd6284a061ff95"}},{"ruleId":"D2","level":"warning","message":{"text":"copr.balanceBatchCopTask (cognitive 87): copr.balanceBatchCopTask has cognitive complexity 87 (threshold 15). Drivers by points: if/else 65, loops 21, boolean chains 1 (nesting depth added 51). Of this number, 63 points are the body\u0027s own statements and 24 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/store/copr/batch_coprocessor.go"},"region":{"startLine":296}}}],"partialFingerprints":{"codehealthFindingId/v1":"b458c0de26f161b208f995ece55d52d4661800b8955124b7001e61c9d0d66188"}},{"ruleId":"D2","level":"warning","message":{"text":"export.updateSpecifiedTablesMeta (cognitive 86): export.updateSpecifiedTablesMeta has cognitive complexity 86 (threshold 15). Drivers by points: if/else 65, loops 18, boolean chains 2, match/switch 1 (nesting depth added 57). Of this number, 53 points are the body\u0027s own statements and 33 belong to 2 function literals inside it that branch. 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":"dumpling/export/sql.go"},"region":{"startLine":251}}}],"partialFingerprints":{"codehealthFindingId/v1":"bc50d29ac9cdef974b6f49e94935426a0bd35f050cede6d1b6d72446741698fd"}},{"ruleId":"D2","level":"warning","message":{"text":"expressionRewriter.handleInSubquery (cognitive 86): expressionRewriter.handleInSubquery has cognitive complexity 86 (threshold 15). Drivers by points: if/else 74, boolean chains 10, loops 2 (nesting depth added 42). 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/planner/core/expression_rewriter.go"},"region":{"startLine":1284}}}],"partialFingerprints":{"codehealthFindingId/v1":"d6ac8e35b85d1ad2681f37dc685b5a22a9c3b9dbcd89ed72c290499fc56a926f"}},{"ruleId":"D2","level":"warning","message":{"text":"SettingsHandler.ServeHTTP (cognitive 86): SettingsHandler.ServeHTTP has cognitive complexity 86 (threshold 15). Drivers by points: if/else 68, match/switch 15, boolean chains 3 (nesting depth added 48). 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/server/handler/tikvhandler/tikv_handler.go"},"region":{"startLine":438}}}],"partialFingerprints":{"codehealthFindingId/v1":"3ddfa6081210413eff4236803267d13805400f362a6f1c335e91a18b67b291f5"}},{"ruleId":"D2","level":"warning","message":{"text":"task.RunBackup (cognitive 85): task.RunBackup has cognitive complexity 85 (threshold 15). Drivers by points: if/else 78, boolean chains 7 (nesting depth added 22). Of this number, 56 points are the body\u0027s own statements and 29 belong to 6 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":"br/pkg/task/backup.go"},"region":{"startLine":392}}}],"partialFingerprints":{"codehealthFindingId/v1":"789def28fd764329247552f1df0c4bb896d706a742e95c7df03e8f538833c2a4"}},{"ruleId":"D2","level":"warning","message":{"text":"main.overrideConfig (cognitive 85): main.overrideConfig has cognitive complexity 85 (threshold 15). Drivers by points: if/else 76, boolean chains 9 (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":"cmd/tidb-server/main.go"},"region":{"startLine":758}}}],"partialFingerprints":{"codehealthFindingId/v1":"0efe1330b8cbd5bcd7ae6a3218d67fc32dbaacb7cc92e42634185c6ae08376b0"}},{"ruleId":"D2","level":"warning","message":{"text":"core.buildRangesForBatchGet (cognitive 85): core.buildRangesForBatchGet has cognitive complexity 85 (threshold 15). Drivers by points: if/else 67, loops 14, boolean chains 4 (nesting depth added 53). 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/planner/core/plan_cache_rebuild.go"},"region":{"startLine":326}}}],"partialFingerprints":{"codehealthFindingId/v1":"fd30f5778a9a9492463006aa6dd1d606267050aaff028dafdbd9cdc4ca8141a4"}},{"ruleId":"D2","level":"warning","message":{"text":"havingWindowAndOrderbyExprResolver.Leave (cognitive 85): havingWindowAndOrderbyExprResolver.Leave has cognitive complexity 85 (threshold 15). Drivers by points: if/else 69, boolean chains 9, loops 6, match/switch 1 (nesting depth added 49). 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":"pkg/planner/core/logical_plan_builder.go"},"region":{"startLine":2790}}}],"partialFingerprints":{"codehealthFindingId/v1":"01fd2e97055f851b1d6b5a0466fcedd8389954a78c6953b2c3e4d9ea3f032b4d"}},{"ruleId":"D2","level":"warning","message":{"text":"globalstats.blockingMergePartitionStats2GlobalStats (cognitive 85): globalstats.blockingMergePartitionStats2GlobalStats has cognitive complexity 85 (threshold 15). Drivers by points: if/else 67, loops 14, boolean chains 4 (nesting depth added 46). 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/statistics/handle/globalstats/global_stats.go"},"region":{"startLine":168}}}],"partialFingerprints":{"codehealthFindingId/v1":"636a29622dc7cacb7660180719f01ee473dcec87564c87d840af9452a2e43517"}},{"ruleId":"D2","level":"warning","message":{"text":"copr.buildBatchCopTasksCore (cognitive 85): copr.buildBatchCopTasksCore has cognitive complexity 85 (threshold 15). Drivers by points: if/else 52, loops 32, boolean chains 1 (nesting depth added 50). Of this number, 79 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":"pkg/store/copr/batch_coprocessor.go"},"region":{"startLine":905}}}],"partialFingerprints":{"codehealthFindingId/v1":"609f02465faa9a315a4ab1c1aa3fdeb89a34336b8228d674f27421b943c9ca86"}},{"ruleId":"D2","level":"warning","message":{"text":"types.parseDatetime (cognitive 85): types.parseDatetime has cognitive complexity 85 (threshold 15). Drivers by points: if/else 63, boolean chains 15, match/switch 7 (nesting depth added 34). Of this number, 83 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":"pkg/types/time.go"},"region":{"startLine":952}}}],"partialFingerprints":{"codehealthFindingId/v1":"6666371917eac8618c2e50c7fe04c9cdba68455b884b1442c5f8fdcd1e17f714"}},{"ruleId":"D2","level":"warning","message":{"text":"bootstrap.checkUpgradeDotGo (cognitive 84): bootstrap.checkUpgradeDotGo has cognitive complexity 84 (threshold 15). Drivers by points: if/else 68, match/switch 9, loops 5, boolean chains 2 (nesting depth added 61). 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":"build/linter/bootstrap/analyzer.go"},"region":{"startLine":170}}}],"partialFingerprints":{"codehealthFindingId/v1":"45ff568392d72e323c9e787c3d533dc6e52185f1ebed8aaac9c0ebbeb3d5c87c"}},{"ruleId":"D2","level":"warning","message":{"text":"PartitionProcessor.getUsedKeyPartitions (cognitive 84): PartitionProcessor.getUsedKeyPartitions has cognitive complexity 84 (threshold 15). Drivers by points: if/else 74, loops 6, boolean chains 4 (nesting depth added 56). 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/planner/core/rule/rule_partition_processor.go"},"region":{"startLine":275}}}],"partialFingerprints":{"codehealthFindingId/v1":"5f66735c873c0f2f4ebbde5401641b569c4b8b7c89121f226ddd9be6e038e055"}},{"ruleId":"D2","level":"warning","message":{"text":"executor.DoDDLJobWrapper (cognitive 83): executor.DoDDLJobWrapper has cognitive complexity 83 (threshold 15). Drivers by points: if/else 71, loops 6, boolean chains 3, match/switch 3 (nesting depth added 46). Of this number, 82 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":"pkg/ddl/executor.go"},"region":{"startLine":7218}}}],"partialFingerprints":{"codehealthFindingId/v1":"75d81cd0df363ee0593ce2cb4d2f3ed8b33bf2ad9edecab11e4f2e450c1e67b7"}},{"ruleId":"D2","level":"warning","message":{"text":"types.doDivMod (cognitive 83): types.doDivMod has cognitive complexity 83 (threshold 15). Drivers by points: if/else 59, loops 18, boolean chains 6 (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":"pkg/types/mydecimal.go"},"region":{"startLine":2214}}}],"partialFingerprints":{"codehealthFindingId/v1":"c4e8473a4a0a191017e33e13188b9d23b6fb05ed7f6240cb1d4fc41319ab3c43"}},{"ruleId":"D2","level":"warning","message":{"text":"BinaryJSON.extractToCallback (cognitive 83): BinaryJSON.extractToCallback has cognitive complexity 83 (threshold 15). Drivers by points: if/else 53, loops 16, boolean chains 12, match/switch 2 (nesting depth added 45). 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/types/json_binary_functions.go"},"region":{"startLine":1261}}}],"partialFingerprints":{"codehealthFindingId/v1":"680510180fdbcd79691e2e1fbbab1463641ce5d246713873a4b02f5250198599"}},{"ruleId":"D2","level":"warning","message":{"text":"selectResult.fetchRespWithIntermediateResults (cognitive 82): selectResult.fetchRespWithIntermediateResults has cognitive complexity 82 (threshold 15). Drivers by points: if/else 75, loops 6, boolean chains 1 (nesting depth added 50). Of this number, 57 points are the body\u0027s own statements and 25 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/distsql/select_result.go"},"region":{"startLine":369}}}],"partialFingerprints":{"codehealthFindingId/v1":"79caf33e99e9ec5151d5cd33e67e98f8c5168bdfa56c61cf1e2299ef7cc39073"}},{"ruleId":"D2","level":"warning","message":{"text":"LogicalJoin.ExtractOnCondition (cognitive 82): LogicalJoin.ExtractOnCondition has cognitive complexity 82 (threshold 15). Drivers by points: if/else 68, boolean chains 6, match/switch 5, loops 3 (nesting depth added 52). 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/planner/core/operator/logicalop/logical_join.go"},"region":{"startLine":1394}}}],"partialFingerprints":{"codehealthFindingId/v1":"25e1bf2886a15e72e5cf67fea48c7d16bfa9cf3185bb63108dcdd0dcf0db1af9"}},{"ruleId":"D2","level":"warning","message":{"text":"clientConn.Run (cognitive 82): clientConn.Run has cognitive complexity 82 (threshold 15). Drivers by points: if/else 73, boolean chains 5, loops 4 (nesting depth added 46). Of this number, 80 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":"pkg/server/conn.go"},"region":{"startLine":1157}}}],"partialFingerprints":{"codehealthFindingId/v1":"45ff868ffba82842a69b211c18030d95d3801b0400f729ffb49e7cd1815b59c8"}},{"ruleId":"D2","level":"warning","message":{"text":"index.Delete (cognitive 82): index.Delete has cognitive complexity 82 (threshold 15). Drivers by points: if/else 80, boolean chains 1, loops 1 (nesting depth added 56). 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/table/tables/index.go"},"region":{"startLine":572}}}],"partialFingerprints":{"codehealthFindingId/v1":"d82a92143aa3f75a8567e1030e7014d1845b60afd7c6a102b78beb2027460152"}},{"ruleId":"D2","level":"warning","message":{"text":"conditionChecker.checkScalarFunction (cognitive 82): conditionChecker.checkScalarFunction has cognitive complexity 82 (threshold 15). Drivers by points: if/else 66, boolean chains 10, loops 5, match/switch 1 (nesting depth added 47). 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":"pkg/util/ranger/checker.go"},"region":{"startLine":55}}}],"partialFingerprints":{"codehealthFindingId/v1":"8801612514b2035a858873e9ffa2c3fda28e8c77ff11bc664140a844f2647046"}},{"ruleId":"D2","level":"warning","message":{"text":"core.skylinePruning (cognitive 81): core.skylinePruning has cognitive complexity 81 (threshold 15). Drivers by points: if/else 62, boolean chains 14, loops 5 (nesting depth added 39). 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/planner/core/find_best_task.go"},"region":{"startLine":1752}}}],"partialFingerprints":{"codehealthFindingId/v1":"c59e6f61f854f821c4811fff977f16e5271f49cbf1da18d539b42dfd2bba1723"}},{"ruleId":"D2","level":"warning","message":{"text":"LogClient.RepairIngestIndex (cognitive 80): LogClient.RepairIngestIndex has cognitive complexity 80 (threshold 15). Drivers by points: if/else 64, loops 11, boolean chains 5 (nesting depth added 38). Of this number, 59 points are the body\u0027s own statements and 21 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":"br/pkg/restore/log_client/client.go"},"region":{"startLine":2137}}}],"partialFingerprints":{"codehealthFindingId/v1":"71a8eb52552a246047d5d21477511ad58c9c63e647e16faaa0a4b2531ee20696"}},{"ruleId":"D2","level":"warning","message":{"text":"TableImporter.importEngines (cognitive 80): TableImporter.importEngines has cognitive complexity 80 (threshold 15). Drivers by points: if/else 55, loops 21, match/switch 3, boolean chains 1 (nesting depth added 47). Of this number, 60 points are the body\u0027s own statements and 20 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":"lightning/pkg/importer/table_import.go"},"region":{"startLine":458}}}],"partialFingerprints":{"codehealthFindingId/v1":"16bb1da598ce9c3eb7a4093f238ec0440ed352982f4242d17c41a336bf599be6"}},{"ruleId":"D2","level":"warning","message":{"text":"executor.ResetContextOfStmt (cognitive 80): executor.ResetContextOfStmt has cognitive complexity 80 (threshold 15). Drivers by points: if/else 60, boolean chains 17, match/switch 2, loops 1 (nesting depth added 16). Of this number, 76 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":"pkg/executor/select.go"},"region":{"startLine":923}}}],"partialFingerprints":{"codehealthFindingId/v1":"f217845f78d026513449bdd4a858d3f4b79a0a56434f7c4b09be12d4c019b58c"}},{"ruleId":"D2","level":"warning","message":{"text":"core.tryLockMDLAndUpdateSchemaIfNecessary (cognitive 80): core.tryLockMDLAndUpdateSchemaIfNecessary has cognitive complexity 80 (threshold 15). Drivers by points: if/else 62, loops 12, boolean chains 6 (nesting depth added 41). Of this number, 72 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":"pkg/planner/core/preprocess.go"},"region":{"startLine":2196}}}],"partialFingerprints":{"codehealthFindingId/v1":"2ccf163b3c8c364f3fe617a6526f4a754b34fd8bf53889b86040a9e53208eed7"}},{"ruleId":"D2","level":"warning","message":{"text":"PlanBuilder.buildDelete (cognitive 80): PlanBuilder.buildDelete has cognitive complexity 80 (threshold 15). Drivers by points: if/else 69, loops 9, boolean chains 2 (nesting depth added 38). 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/planner/core/logical_plan_builder.go"},"region":{"startLine":6494}}}],"partialFingerprints":{"codehealthFindingId/v1":"673e1814da1551f42b38c9f3f7ed76068cd81235339ed675fb59356b1ecaa3cf"}},{"ruleId":"D2","level":"warning","message":{"text":"session.approxParseSQLTokenCnt (cognitive 80): session.approxParseSQLTokenCnt has cognitive complexity 80 (threshold 15). Drivers by points: if/else 49, loops 16, boolean chains 15 (nesting depth added 39). 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/session/session.go"},"region":{"startLine":1538}}}],"partialFingerprints":{"codehealthFindingId/v1":"1ac82dc52303771e48d41669f94ae2dc52446b8fb8cf90ac0635c8faaeccda50"}},{"ruleId":"D2","level":"warning","message":{"text":"worker.doModifyColumnTypeWithData (cognitive 79): worker.doModifyColumnTypeWithData has cognitive complexity 79 (threshold 15). Drivers by points: if/else 67, match/switch 8, loops 3, boolean chains 1 (nesting depth added 48). Of this number, 71 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":"pkg/ddl/modify_column.go"},"region":{"startLine":924}}}],"partialFingerprints":{"codehealthFindingId/v1":"d3c7735ce4570e768b5f8cdbf35176f7807efae39dd1cc8fffca75e7f47ab75c"}},{"ruleId":"D2","level":"warning","message":{"text":"Config.Valid (cognitive 78): Config.Valid has cognitive complexity 78 (threshold 15). Drivers by points: if/else 50, boolean chains 26, loops 1, match/switch 1 (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":"pkg/config/config.go"},"region":{"startLine":1717}}}],"partialFingerprints":{"codehealthFindingId/v1":"8111d9ef5c8e15d4cacc676fa6b0b3b20465b0d60402c0fbdc985019ef515145"}},{"ruleId":"D2","level":"warning","message":{"text":"core.matchProperty (cognitive 78): core.matchProperty has cognitive complexity 78 (threshold 15). Drivers by points: if/else 54, boolean chains 13, loops 11 (nesting depth added 36). 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/planner/core/find_best_task.go"},"region":{"startLine":1042}}}],"partialFingerprints":{"codehealthFindingId/v1":"cf810ae41b5db60247d87b9dd7b02b2edcdb1c1705557247fa8b49f6fe34792a"}},{"ruleId":"D2","level":"warning","message":{"text":"core.matchPropForIndexMergeAlternatives (cognitive 78): core.matchPropForIndexMergeAlternatives has cognitive complexity 78 (threshold 15). Drivers by points: if/else 56, loops 17, boolean chains 5 (nesting depth added 43). Of this number, 67 points are the body\u0027s own statements and 11 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/planner/core/find_best_task.go"},"region":{"startLine":1402}}}],"partialFingerprints":{"codehealthFindingId/v1":"526585f2754cd07a558f89d13e264e29a83400d32346a7351a20b7745f5a9a75"}},{"ruleId":"D2","level":"warning","message":{"text":"StmtRecord.Add (cognitive 78): StmtRecord.Add has cognitive complexity 78 (threshold 15). Drivers by points: if/else 73, loops 4, 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":"pkg/util/stmtsummary/v2/record.go"},"region":{"startLine":247}}}],"partialFingerprints":{"codehealthFindingId/v1":"3e8ea0ea87cf330f6d4991e720da42ef6fe267daede4c3ec512ba13585e43ea8"}},{"ruleId":"D2","level":"warning","message":{"text":"FDSet.ProjectCols (cognitive 77): FDSet.ProjectCols has cognitive complexity 77 (threshold 15). Drivers by points: if/else 67, loops 7, boolean chains 3 (nesting depth added 39). 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/planner/funcdep/fd_graph.go"},"region":{"startLine":985}}}],"partialFingerprints":{"codehealthFindingId/v1":"3506b221f4dcf82eb6cd9c1a3ee2bd3c3762a0e6774a45598696f59388ca07a0"}},{"ruleId":"D2","level":"warning","message":{"text":"redact.DeRedact (cognitive 77): redact.DeRedact has cognitive complexity 77 (threshold 15). Drivers by points: if/else 73, loops 3, boolean chains 1 (nesting depth added 52). 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/util/redact/redact.go"},"region":{"startLine":104}}}],"partialFingerprints":{"codehealthFindingId/v1":"9078092a884728ec532c12e075a432c0ea0479e0501c7179006446e6467a145f"}},{"ruleId":"D2","level":"warning","message":{"text":"stmtSummaryStats.add (cognitive 77): stmtSummaryStats.add has cognitive complexity 77 (threshold 15). Drivers by points: if/else 73, loops 4 (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":"pkg/util/stmtsummary/statement_summary.go"},"region":{"startLine":791}}}],"partialFingerprints":{"codehealthFindingId/v1":"5aa1e730c2d45d0d80fd4a0b00024314714743d650421318f5c6d73476d96639"}},{"ruleId":"D2","level":"warning","message":{"text":"Controller.preCheckRequirements (cognitive 76): Controller.preCheckRequirements has cognitive complexity 76 (threshold 15). Drivers by points: if/else 74, boolean chains 2 (nesting depth added 42). 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":"lightning/pkg/importer/import.go"},"region":{"startLine":1888}}}],"partialFingerprints":{"codehealthFindingId/v1":"b86aa37e5d395242e21f827513bd35cce417e38db97324f6161402cb9c361c6d"}},{"ruleId":"D2","level":"warning","message":{"text":"executor.getKeysNeedCheckOneRow (cognitive 76): executor.getKeysNeedCheckOneRow has cognitive complexity 76 (threshold 15). Drivers by points: if/else 64, loops 7, boolean chains 5 (nesting depth added 38). 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/executor/batch_checker.go"},"region":{"startLine":97}}}],"partialFingerprints":{"codehealthFindingId/v1":"33f676c1f7db21fde58bb56e2db6e7839ca47bdccbe9b2ceb0da1b6b4576bcef"}},{"ruleId":"D2","level":"warning","message":{"text":"cardinality.getIndexRowCountForStatsV2 (cognitive 76): cardinality.getIndexRowCountForStatsV2 has cognitive complexity 76 (threshold 15). Drivers by points: if/else 65, boolean chains 10, loops 1 (nesting depth added 42). 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/planner/cardinality/row_count_index.go"},"region":{"startLine":198}}}],"partialFingerprints":{"codehealthFindingId/v1":"20f245b895855261d6945934d92150a853f100ddd39f11b3af24140844ec213c"}},{"ruleId":"D2","level":"warning","message":{"text":"schemaCheckItem.SchemaIsValid (cognitive 75): schemaCheckItem.SchemaIsValid has cognitive complexity 75 (threshold 15). Drivers by points: if/else 49, loops 20, boolean chains 6 (nesting depth added 30). 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":"lightning/pkg/importer/precheck_impl.go"},"region":{"startLine":957}}}],"partialFingerprints":{"codehealthFindingId/v1":"c110b9d9abbb55c33171f3d41045ec6a62ed405c81e88b1c4720a3e7cf2b435b"}},{"ruleId":"D2","level":"warning","message":{"text":"expressionRewriter.Leave (cognitive 75): expressionRewriter.Leave has cognitive complexity 75 (threshold 15). Drivers by points: if/else 65, boolean chains 5, match/switch 5 (nesting depth added 33). Of this number, 73 points are the body\u0027s own statements and 2 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":"pkg/planner/core/expression_rewriter.go"},"region":{"startLine":1672}}}],"partialFingerprints":{"codehealthFindingId/v1":"e60a5bf82895c7d8fcd6e591c5a4c85e3521e65cbf0b024ba40f08363025f605"}},{"ruleId":"D2","level":"warning","message":{"text":"Config.ParseFromFlags (cognitive 74): Config.ParseFromFlags has cognitive complexity 74 (threshold 15). Drivers by points: if/else 69, boolean chains 4, loops 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":"dumpling/export/config.go"},"region":{"startLine":417}}}],"partialFingerprints":{"codehealthFindingId/v1":"580366d193d1279a28bcd38d428c46bc345335e2a93c81373df8614b666b2c6f"}},{"ruleId":"D2","level":"warning","message":{"text":"core.toString (cognitive 74): core.toString has cognitive complexity 74 (threshold 15). Drivers by points: if/else 38, loops 31, match/switch 4, boolean chains 1 (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/stringer.go"},"region":{"startLine":86}}}],"partialFingerprints":{"codehealthFindingId/v1":"9653606a03f69464ae6aa0eda09213c29a7842b70541ed0b9efa9bc2a58cc937"}},{"ruleId":"D2","level":"warning","message":{"text":"exchSenderExec.next (cognitive 74): exchSenderExec.next has cognitive complexity 74 (threshold 15). Drivers by points: loops 42, if/else 28, match/switch 3, boolean chains 1 (nesting depth added 48). Of this number, 66 points are the body\u0027s own statements and 8 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":"pkg/store/mockstore/unistore/cophandler/mpp_exec.go"},"region":{"startLine":955}}}],"partialFingerprints":{"codehealthFindingId/v1":"f8aef62d3ce5402c54e5134156b72c440051720e7e8bbb028089cef0b3d60967"}},{"ruleId":"D2","level":"warning","message":{"text":"sqlescape.escapeSQL (cognitive 74): sqlescape.escapeSQL has cognitive complexity 74 (threshold 15). Drivers by points: if/else 47, loops 16, match/switch 11 (nesting depth added 53). 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/util/sqlescape/utils.go"},"region":{"startLine":97}}}],"partialFingerprints":{"codehealthFindingId/v1":"ee142541a09c73e7be48960f4a4081d7469ebfb80f9a47b43765cab28b9c0d95"}},{"ruleId":"D2","level":"warning","message":{"text":"MetaReader.ReadSchemasFiles (cognitive 73): MetaReader.ReadSchemasFiles has cognitive complexity 73 (threshold 15). Drivers by points: if/else 47, loops 12, match/switch 11, boolean chains 2, jumps 1 (nesting depth added 42). Of this number, 23 points are the body\u0027s own statements and 50 belong to 4 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":"br/pkg/metautil/metafile.go"},"region":{"startLine":533}}}],"partialFingerprints":{"codehealthFindingId/v1":"d1a0af3b49b1413a1878724a4e620e95e97e306697eeb3ea083837ca09301854"}},{"ruleId":"D2","level":"warning","message":{"text":"chunkProcessor.deliverLoop (cognitive 73): chunkProcessor.deliverLoop has cognitive complexity 73 (threshold 15). Drivers by points: if/else 55, loops 9, boolean chains 4, match/switch 3, jumps 2 (nesting depth added 41). Of this number, 52 points are the body\u0027s own statements and 21 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":"lightning/pkg/importer/chunk_process.go"},"region":{"startLine":580}}}],"partialFingerprints":{"codehealthFindingId/v1":"226089ff67c9bbe43e2a54dc18f428ff3894d74e9d8b48537ee443b808ee5b9e"}},{"ruleId":"D2","level":"warning","message":{"text":"dataLockWaitsTableRetriever.retrieve (cognitive 73): dataLockWaitsTableRetriever.retrieve has cognitive complexity 73 (threshold 15). Drivers by points: if/else 55, loops 11, match/switch 6, boolean chains 1 (nesting depth added 37). Most of this is not in the body itself: 9 of the 73 points are its own statements and the rest belongs to one function literal inside it that branches (line 3230). 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":"pkg/executor/infoschema_reader.go"},"region":{"startLine":3198}}}],"partialFingerprints":{"codehealthFindingId/v1":"4c935efb52f1ebce9d2024d82b0735cd03000d3555a68ff977e145a19a06db3a"}},{"ruleId":"D2","level":"warning","message":{"text":"ProbeWorkerV1.joinNAALOSJMatchProbeSideRow2Chunk (cognitive 73): ProbeWorkerV1.joinNAALOSJMatchProbeSideRow2Chunk has cognitive complexity 73 (threshold 15). Drivers by points: if/else 65, loops 8 (nesting depth added 44). 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/executor/join/hash_join_v1.go"},"region":{"startLine":432}}}],"partialFingerprints":{"codehealthFindingId/v1":"29dfda12438e5e156de9a2f4f5d3ac55057398d59c6edd5b94ba6c1e42979110"}},{"ruleId":"D2","level":"warning","message":{"text":"ProbeWorkerV1.joinNAASJMatchProbeSideRow2Chunk (cognitive 73): ProbeWorkerV1.joinNAASJMatchProbeSideRow2Chunk has cognitive complexity 73 (threshold 15). Drivers by points: if/else 65, loops 8 (nesting depth added 44). 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/executor/join/hash_join_v1.go"},"region":{"startLine":590}}}],"partialFingerprints":{"codehealthFindingId/v1":"81429d0be6cedc5b4b128c332d6b6752116581b477a4475439b49c49c7be9269"}},{"ruleId":"D2","level":"warning","message":{"text":"session.Auth (cognitive 73): session.Auth has cognitive complexity 73 (threshold 15). Drivers by points: if/else 72, boolean chains 1 (nesting depth added 44). 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/session/session.go"},"region":{"startLine":3651}}}],"partialFingerprints":{"codehealthFindingId/v1":"31287770c459044d06f9b23db0cca92c6f21078932aa5347e9308f1da826347a"}},{"ruleId":"D2","level":"warning","message":{"text":"MyDecimal.Round (cognitive 73): MyDecimal.Round has cognitive complexity 73 (threshold 15). Drivers by points: if/else 48, loops 18, boolean chains 5, match/switch 2 (nesting depth added 32). 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/types/mydecimal.go"},"region":{"startLine":822}}}],"partialFingerprints":{"codehealthFindingId/v1":"7e770ba21eabf765b90cca3dfc34cde5ef359c0baccdfc0400d58646b59df288"}},{"ruleId":"D2","level":"warning","message":{"text":"task.restoreStream (cognitive 72): task.restoreStream has cognitive complexity 72 (threshold 15). Drivers by points: if/else 70, boolean chains 2 (nesting depth added 12). Of this number, 48 points are the body\u0027s own statements and 24 belong to 6 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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":"br/pkg/task/stream.go"},"region":{"startLine":1565}}}],"partialFingerprints":{"codehealthFindingId/v1":"6a4652c0934e5a0cc90f3599263e48fc3e468b915e52d5d2eb4f651cb88d777f"}},{"ruleId":"D2","level":"warning","message":{"text":"ExecStmt.Exec (cognitive 72): ExecStmt.Exec has cognitive complexity 72 (threshold 15). Drivers by points: if/else 62, boolean chains 10 (nesting depth added 26). Of this number, 38 points are the body\u0027s own statements and 34 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":"pkg/executor/adapter.go"},"region":{"startLine":573}}}],"partialFingerprints":{"codehealthFindingId/v1":"0f3f86c3237dcf3ea5801df9f1fa7f9cbcd1bebb66dc3126376fe45d609bbf94"}},{"ruleId":"D2","level":"warning","message":{"text":"SetExecutor.setSysVariable (cognitive 72): SetExecutor.setSysVariable has cognitive complexity 72 (threshold 15). Drivers by points: if/else 62, boolean chains 8, loops 2 (nesting depth added 27). Of this number, 66 points are the body\u0027s own statements and 6 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":"pkg/executor/set.go"},"region":{"startLine":117}}}],"partialFingerprints":{"codehealthFindingId/v1":"f3faebc4f7564ea6ae5a12fb9f9f39c2474940c1a98338bd607444b5acbc4397"}},{"ruleId":"D2","level":"warning","message":{"text":"SimpleExec.executeDropUser (cognitive 72): SimpleExec.executeDropUser has cognitive complexity 72 (threshold 15). Drivers by points: if/else 63, boolean chains 5, loops 4 (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":"pkg/executor/simple.go"},"region":{"startLine":2510}}}],"partialFingerprints":{"codehealthFindingId/v1":"458ddace2ff0d85d1b6980009c4f2ac0168f2a79ab7a51a9cb988cadaff0094d"}},{"ruleId":"D2","level":"warning","message":{"text":"slowLogReverseScanner.nextBlock (cognitive 72): slowLogReverseScanner.nextBlock has cognitive complexity 72 (threshold 15). Drivers by points: if/else 58, loops 11, boolean chains 3 (nesting depth added 45). 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/executor/slow_query.go"},"region":{"startLine":460}}}],"partialFingerprints":{"codehealthFindingId/v1":"e1c80b79bf8bcf324c756dd45715f376f44fd65081f7fcb41ec1b39d0a55bbdd"}},{"ruleId":"D2","level":"warning","message":{"text":"expression.extractConstantEqColumnsOrScalar (cognitive 72): expression.extractConstantEqColumnsOrScalar has cognitive complexity 72 (threshold 15). Drivers by points: if/else 59, boolean chains 9, loops 3, match/switch 1 (nesting depth added 44). 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":"pkg/expression/util.go"},"region":{"startLine":414}}}],"partialFingerprints":{"codehealthFindingId/v1":"51703114ec1f094ff09b0fdf917b08cb1217e6338d3c0d92fabb3744964fffa6"}},{"ruleId":"D2","level":"warning","message":{"text":"planner.optimizeNoCache (cognitive 72): planner.optimizeNoCache has cognitive complexity 72 (threshold 15). Drivers by points: if/else 54, loops 11, boolean chains 7 (nesting depth added 31). Of this number, 69 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":"pkg/planner/optimize.go"},"region":{"startLine":223}}}],"partialFingerprints":{"codehealthFindingId/v1":"0bd02c545b28e8be180f9bcea2f99b55590ef264cab6e6efa51692e12f3ee808"}},{"ruleId":"D2","level":"warning","message":{"text":"storage.SaveAnalyzeResultToStorage (cognitive 72): storage.SaveAnalyzeResultToStorage has cognitive complexity 72 (threshold 15). Drivers by points: if/else 66, boolean chains 3, loops 3 (nesting depth added 37). Of this number, 71 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":"pkg/statistics/handle/storage/save.go"},"region":{"startLine":119}}}],"partialFingerprints":{"codehealthFindingId/v1":"842542c9a4b740e8793c27c6038c2d3fe3ff395237dfd63a41c816e60e8e18a5"}},{"ruleId":"D2","level":"warning","message":{"text":"Handle.Run (cognitive 72): Handle.Run has cognitive complexity 72 (threshold 15). Drivers by points: if/else 62, boolean chains 4, loops 4, match/switch 2 (nesting depth added 51). 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/util/expensivequery/expensivequery.go"},"region":{"startLine":51}}}],"partialFingerprints":{"codehealthFindingId/v1":"fc80cc4b5cc5dd6876dc662cec5878e0583108bb434e45283966c4e15420c727"}},{"ruleId":"D2","level":"warning","message":{"text":"SchemaTracker.AlterTable (cognitive 71): SchemaTracker.AlterTable has cognitive complexity 71 (threshold 15). Drivers by points: if/else 52, loops 10, match/switch 9 (nesting depth added 49). Of this number, 70 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":"pkg/ddl/schematracker/dm_tracker.go"},"region":{"startLine":886}}}],"partialFingerprints":{"codehealthFindingId/v1":"580c4973a5fc3098bcbe5fadbacb3d80e1fa9500b33afa337e6b1b50d64ac7e3"}},{"ruleId":"D2","level":"warning","message":{"text":"core.extractJoinGroupImpl (cognitive 71): core.extractJoinGroupImpl has cognitive complexity 71 (threshold 15). Drivers by points: if/else 40, boolean chains 23, loops 7, match/switch 1 (nesting depth added 16). Of this number, 64 points are the body\u0027s own statements and 7 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":"pkg/planner/core/rule_join_reorder.go"},"region":{"startLine":58}}}],"partialFingerprints":{"codehealthFindingId/v1":"8690b83ac81ab0d52122b36c66b000660def9f0a5819266e24cdc6beb279c5f7"}},{"ruleId":"D2","level":"warning","message":{"text":"types.ProduceStrWithSpecifiedTp (cognitive 71): types.ProduceStrWithSpecifiedTp has cognitive complexity 71 (threshold 15). Drivers by points: if/else 53, loops 11, boolean chains 4, match/switch 3 (nesting depth added 47). 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/types/datum.go"},"region":{"startLine":1219}}}],"partialFingerprints":{"codehealthFindingId/v1":"5937c6573d32527441119aca32b157aa675cc9c1df7e95e77486c21edb40dd7c"}},{"ruleId":"D2","level":"warning","message":{"text":"TableImporter.importTable (cognitive 70): TableImporter.importTable has cognitive complexity 70 (threshold 15). Drivers by points: if/else 62, boolean chains 5, loops 2, match/switch 1 (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lightning/pkg/importer/table_import.go"},"region":{"startLine":118}}}],"partialFingerprints":{"codehealthFindingId/v1":"0cca639b446570e0d5012a703b2362b3022844ed22c81d07ceee7afc6c52437b"}},{"ruleId":"D2","level":"warning","message":{"text":"slowQueryRetriever.parseLog (cognitive 70): slowQueryRetriever.parseLog has cognitive complexity 70 (threshold 15). Drivers by points: if/else 61, loops 6, boolean chains 3 (nesting depth added 40). Of this number, 67 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":"pkg/executor/slow_query.go"},"region":{"startLine":922}}}],"partialFingerprints":{"codehealthFindingId/v1":"44fc5cc1299451baa718981d8bdb25455fa87ea9f6b8b850568d1346da6c5898"}},{"ruleId":"D2","level":"warning","message":{"text":"core.convertToTableScan (cognitive 70): core.convertToTableScan has cognitive complexity 70 (threshold 15). Drivers by points: if/else 43, boolean chains 22, 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":"pkg/planner/core/find_best_task.go"},"region":{"startLine":2811}}}],"partialFingerprints":{"codehealthFindingId/v1":"f17551295af801002194ab3758c8427874196de5a2dfd5a80d82b5558d6cb640"}},{"ruleId":"D2","level":"warning","message":{"text":"physicalop.handleTiFlashPredicatePushDown (cognitive 70): physicalop.handleTiFlashPredicatePushDown has cognitive complexity 70 (threshold 15). Drivers by points: if/else 40, loops 23, boolean chains 5, match/switch 2 (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":"pkg/planner/core/operator/physicalop/tiflash_predicate_push_down.go"},"region":{"startLine":267}}}],"partialFingerprints":{"codehealthFindingId/v1":"c997f044a2c267bd081e5a7d43165cabc4483e313ef97d718482e03939cabfb2"}},{"ruleId":"D2","level":"warning","message":{"text":"OrderAwareJoinReorder.optimizeRecursive (cognitive 70): OrderAwareJoinReorder.optimizeRecursive has cognitive complexity 70 (threshold 15). Drivers by points: if/else 46, boolean chains 23, match/switch 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":"pkg/planner/core/rule/rule_order_aware_join_reorder.go"},"region":{"startLine":39}}}],"partialFingerprints":{"codehealthFindingId/v1":"7cfd475ee07f8dfab6c16856f155b1d4c371023465d76246228be925582a8c9f"}},{"ruleId":"D2","level":"warning","message":{"text":"clientConn.prefetchPointPlanKeys (cognitive 70): clientConn.prefetchPointPlanKeys has cognitive complexity 70 (threshold 15). Drivers by points: if/else 56, loops 8, boolean chains 3, match/switch 3 (nesting depth added 32). Of this number, 40 points are the body\u0027s own statements and 30 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/server/conn.go"},"region":{"startLine":1984}}}],"partialFingerprints":{"codehealthFindingId/v1":"08eced2cff2347c9a88e0cc99eac15e896cba69d3c551a6e03510486ec053ea9"}},{"ruleId":"D2","level":"warning","message":{"text":"dbTableMetaMgr.AllocTableRowIDs (cognitive 69): dbTableMetaMgr.AllocTableRowIDs has cognitive complexity 69 (threshold 15). Drivers by points: if/else 58, boolean chains 7, loops 2, match/switch 2 (nesting depth added 28). Of this number, 32 points are the body\u0027s own statements and 37 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":"lightning/pkg/importer/meta_manager.go"},"region":{"startLine":181}}}],"partialFingerprints":{"codehealthFindingId/v1":"61a8e9a5a926e0c38459a73a34d3727feadbf475ad78ffbaece0b65f707c2229"}},{"ruleId":"D2","level":"warning","message":{"text":"hugeMemTableRetriever.dataForColumnsInTable (cognitive 69): hugeMemTableRetriever.dataForColumnsInTable has cognitive complexity 69 (threshold 15). Drivers by points: if/else 56, loops 7, boolean chains 3, match/switch 3 (nesting depth added 38). 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/executor/infoschema_reader.go"},"region":{"startLine":1148}}}],"partialFingerprints":{"codehealthFindingId/v1":"af1f080f84cd0face5564c3e0208559af94e0b9facd28c1167b19a84d2e6d2c3"}},{"ruleId":"D2","level":"warning","message":{"text":"SessionVars.SlowLogFormat (cognitive 69): SessionVars.SlowLogFormat has cognitive complexity 69 (threshold 15). Drivers by points: if/else 54, loops 14, boolean chains 1 (nesting depth added 19). 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":"pkg/sessionctx/variable/slow_log.go"},"region":{"startLine":373}}}],"partialFingerprints":{"codehealthFindingId/v1":"a520ecf395bfddbef7ee1455f5b22350c7a13bf44ad595e09c6fb6d3beefeb20"}},{"ruleId":"D2","level":"warning","message":{"text":"Dumper.dumpDatabases (cognitive 68): Dumper.dumpDatabases has cognitive complexity 68 (threshold 15). Drivers by points: if/else 58, loops 5, match/switch 4, boolean chains 1 (nesting depth added 44). 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":"dumpling/export/dump.go"},"region":{"startLine":395}}}],"partialFingerprints":{"codehealthFindingId/v1":"a7f795f8b68c74a52faad894b6fd23b9942d1f9370292295a88c9ffea9064e00"}},{"ruleId":"D2","level":"warning","message":{"text":"PreImportInfoGetterImpl.sampleDataFromTable (cognitive 68): PreImportInfoGetterImpl.sampleDataFromTable has cognitive complexity 68 (threshold 15). Drivers by points: if/else 50, loops 12, match/switch 3, boolean chains 2, jumps 1 (nesting depth added 38). 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":"lightning/pkg/importer/get_pre_info.go"},"region":{"startLine":614}}}],"partialFingerprints":{"codehealthFindingId/v1":"8eec93fdd746cacf0a10b5dc5274b2dc32f8fb4a224d818cd8a8c657bb9f9134"}},{"ruleId":"D2","level":"warning","message":{"text":"core.genHintsFromSingle (cognitive 68): core.genHintsFromSingle has cognitive complexity 68 (threshold 15). Drivers by points: if/else 63, boolean chains 2, loops 2, match/switch 1 (nesting depth added 36). 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/planner/core/hint_utils.go"},"region":{"startLine":81}}}],"partialFingerprints":{"codehealthFindingId/v1":"37057d4ec510dcc861a32ad1ed8cd9fdd188c901b4528b72c37f50ab6d89d5b4"}},{"ruleId":"D2","level":"warning","message":{"text":"expression.genVecFromConstExpr (cognitive 67): expression.genVecFromConstExpr has cognitive complexity 67 (threshold 15). Drivers by points: if/else 38, loops 28, 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":"pkg/expression/vectorized.go"},"region":{"startLine":23}}}],"partialFingerprints":{"codehealthFindingId/v1":"c293c4b0e78edf0c8f2e983a51354590cc6330d01666cf5452e1c7c58b3dced6"}},{"ruleId":"D2","level":"warning","message":{"text":"core.newPlanCacheKeyWithMatchedBinding (cognitive 67): core.newPlanCacheKeyWithMatchedBinding has cognitive complexity 67 (threshold 15). Drivers by points: if/else 45, boolean chains 11, loops 11 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/plan_cache_utils.go"},"region":{"startLine":325}}}],"partialFingerprints":{"codehealthFindingId/v1":"6799d233b9ad73b93120a82f0aa516e49df36b152b2cd0168a2e88e6f1015e77"}},{"ruleId":"D2","level":"warning","message":{"text":"core.getNameValuePairs (cognitive 67): core.getNameValuePairs has cognitive complexity 67 (threshold 15). Drivers by points: if/else 52, boolean chains 8, match/switch 7 (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":"pkg/planner/core/point_get_plan.go"},"region":{"startLine":924}}}],"partialFingerprints":{"codehealthFindingId/v1":"72dfcad6c095e8d214856063069e68bf4c3af6e22588dcecce65fdfca4f642da"}},{"ruleId":"D2","level":"warning","message":{"text":"DataSource.ExtractFD (cognitive 67): DataSource.ExtractFD has cognitive complexity 67 (threshold 15). Drivers by points: if/else 43, loops 19, boolean chains 5 (nesting depth added 39). 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/planner/core/operator/logicalop/logical_datasource.go"},"region":{"startLine":398}}}],"partialFingerprints":{"codehealthFindingId/v1":"02b8f4923c8fbc49490f4a8387042001751e27338a109948cd84bfdbb09488c4"}},{"ruleId":"D2","level":"warning","message":{"text":"ast.convertBinaryStringLiterals (cognitive 67): ast.convertBinaryStringLiterals has cognitive complexity 67 (threshold 15). Drivers by points: if/else 52, boolean chains 8, loops 7 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/parser/ast/base.go"},"region":{"startLine":137}}}],"partialFingerprints":{"codehealthFindingId/v1":"00ddc8ce5f62e4420a89686a6d8203ddd4744dcd1ed32e963f06b96849829ce6"}},{"ruleId":"D2","level":"warning","message":{"text":"AdminStmt.Restore (cognitive 67): AdminStmt.Restore has cognitive complexity 67 (threshold 15). Drivers by points: if/else 53, loops 11, match/switch 3 (nesting depth added 34). Of this number, 59 points are the body\u0027s own statements and 8 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":"pkg/parser/ast/misc.go"},"region":{"startLine":2817}}}],"partialFingerprints":{"codehealthFindingId/v1":"fb136ac0616b73652179396664646aef76b19c47c8dae3fc9193a28568cf2fa7"}},{"ruleId":"D2","level":"warning","message":{"text":"executorBuilder.setTelemetryInfo (cognitive 66): executorBuilder.setTelemetryInfo has cognitive complexity 66 (threshold 15). Drivers by points: if/else 57, match/switch 6, loops 2, boolean chains 1 (nesting depth added 43). 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/executor/builder.go"},"region":{"startLine":1317}}}],"partialFingerprints":{"codehealthFindingId/v1":"80b98a7746401d7307037f5af455154e6e10958bcc953dd771a8877c1c04ef01"}},{"ruleId":"D2","level":"warning","message":{"text":"expression.foldConstant (cognitive 66): expression.foldConstant has cognitive complexity 66 (threshold 15). Drivers by points: if/else 46, loops 7, match/switch 7, boolean chains 6 (nesting depth added 35). 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":"pkg/expression/constant_fold.go"},"region":{"startLine":162}}}],"partialFingerprints":{"codehealthFindingId/v1":"44c864d4d5629c8fe4953e1deb9f9043866ca589e35a92103665f517056dc412"}},{"ruleId":"D2","level":"warning","message":{"text":"MySQLPrivilege.decodeUserTableRow (cognitive 66): MySQLPrivilege.decodeUserTableRow has cognitive complexity 66 (threshold 15). Drivers by points: if/else 63, match/switch 2, loops 1 (nesting depth added 41). Most of this is not in the body itself: 0 of the 66 points are its own statements and the rest belongs to one function literal inside it that branches (line 1010). 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":"pkg/privilege/privileges/cache.go"},"region":{"startLine":1009}}}],"partialFingerprints":{"codehealthFindingId/v1":"3c152d8c8c1d9d905994fa63e1a8452004355671c1edf8ef8bc8aacd6b0b4eb3"}},{"ruleId":"D2","level":"warning","message":{"text":"hint.ParseStmtHints (cognitive 66): hint.ParseStmtHints has cognitive complexity 66 (threshold 15). Drivers by points: if/else 59, loops 5, match/switch 2 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/util/hint/hint.go"},"region":{"startLine":310}}}],"partialFingerprints":{"codehealthFindingId/v1":"bd6266c2af4cc56929e920bbf658b5262e7561a8feca7ba3b5c1fceb72bb3dfd"}},{"ruleId":"D2","level":"warning","message":{"text":"hint.ParsePlanHints (cognitive 66): hint.ParsePlanHints has cognitive complexity 66 (threshold 15). Drivers by points: if/else 51, match/switch 10, boolean chains 3, loops 2 (nesting depth added 40). 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/util/hint/hint.go"},"region":{"startLine":826}}}],"partialFingerprints":{"codehealthFindingId/v1":"d66b74bb18be1779644f6be011903ac358774cd4ce6ac47075a5d2e68d982e38"}},{"ruleId":"D2","level":"warning","message":{"text":"worker.onExchangeTablePartition (cognitive 65): worker.onExchangeTablePartition has cognitive complexity 65 (threshold 15). Drivers by points: if/else 61, boolean chains 2, loops 2 (nesting depth added 18). Of this number, 59 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":"pkg/ddl/partition.go"},"region":{"startLine":2825}}}],"partialFingerprints":{"codehealthFindingId/v1":"4f4abe7748229e6cc02e39b4679112a45e82d3851ff164d94d4d86ea1854e33a"}},{"ruleId":"D2","level":"warning","message":{"text":"PlanBuilder.buildAggregation (cognitive 65): PlanBuilder.buildAggregation has cognitive complexity 65 (threshold 15). Drivers by points: if/else 53, loops 12 (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/logical_plan_builder.go"},"region":{"startLine":255}}}],"partialFingerprints":{"codehealthFindingId/v1":"b275ae657eb875a9d504b96751402df7c8764fe5f62e534068849cc210437f2b"}},{"ruleId":"D2","level":"warning","message":{"text":"tables.newPartitionedTable (cognitive 65): tables.newPartitionedTable has cognitive complexity 65 (threshold 15). Drivers by points: if/else 45, loops 16, boolean chains 3, match/switch 1 (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":"pkg/table/tables/partition.go"},"region":{"startLine":112}}}],"partialFingerprints":{"codehealthFindingId/v1":"fec2a761c8424442ed5d0b353d7a5f945a652850254932a45fb651a3704671cb"}},{"ruleId":"D2","level":"warning","message":{"text":"CSVParser.readRecord (cognitive 64): CSVParser.readRecord has cognitive complexity 64 (threshold 15). Drivers by points: if/else 55, boolean chains 4, loops 2, match/switch 2, jumps 1 (nesting depth added 37). 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/lightning/mydump/csv_parser.go"},"region":{"startLine":423}}}],"partialFingerprints":{"codehealthFindingId/v1":"bb84c438c15b51f187895571d09aca321747801deba4f590f69736b54560b2f5"}},{"ruleId":"D2","level":"warning","message":{"text":"core.attach2Task4PhysicalTopN (cognitive 64): core.attach2Task4PhysicalTopN has cognitive complexity 64 (threshold 15). Drivers by points: if/else 54, boolean chains 6, loops 4 (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":"pkg/planner/core/task.go"},"region":{"startLine":1249}}}],"partialFingerprints":{"codehealthFindingId/v1":"56b9e0b230e62d9e7bd60d057b852578bd5dd41b566a9628cc409aa2a8bc7595"}},{"ruleId":"D2","level":"warning","message":{"text":"PlanBuilder.buildShow (cognitive 64): PlanBuilder.buildShow has cognitive complexity 64 (threshold 15). Drivers by points: if/else 56, boolean chains 4, loops 3, match/switch 1 (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":"pkg/planner/core/planbuilder.go"},"region":{"startLine":3532}}}],"partialFingerprints":{"codehealthFindingId/v1":"b578f50526365e14647e7a3bf117905677748272067fc41a23c878cd7e32961b"}},{"ruleId":"D2","level":"warning","message":{"text":"task.RunRestore (cognitive 63): task.RunRestore has cognitive complexity 63 (threshold 15). Drivers by points: if/else 54, loops 7, boolean chains 2 (nesting depth added 20). Of this number, 41 points are the body\u0027s own statements and 22 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":"br/pkg/task/restore.go"},"region":{"startLine":982}}}],"partialFingerprints":{"codehealthFindingId/v1":"b8a3323338b001eefe8e912f846146fae3107014452c1c00683290f2d76e695b"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinRegexpInStrFuncSig.vecEvalInt (cognitive 63): builtinRegexpInStrFuncSig.vecEvalInt has cognitive complexity 63 (threshold 15). Drivers by points: if/else 56, boolean chains 5, loops 2 (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":"pkg/expression/builtin_regexp.go"},"region":{"startLine":793}}}],"partialFingerprints":{"codehealthFindingId/v1":"691cc5545f234bbdb744a64add6368ae57bd57038fb86985a825771585920ba7"}},{"ruleId":"D2","level":"warning","message":{"text":"preprocessor.Leave (cognitive 63): preprocessor.Leave has cognitive complexity 63 (threshold 15). Drivers by points: if/else 52, match/switch 5, boolean chains 4, loops 2 (nesting depth added 33). 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":"pkg/planner/core/preprocess.go"},"region":{"startLine":634}}}],"partialFingerprints":{"codehealthFindingId/v1":"0eefba6206c55c5bf8a1abaf0dc90c1b5a948c9e07a825e9ef40fbb2de1271f6"}},{"ruleId":"D2","level":"warning","message":{"text":"rule.PruneIndexesByWhereAndOrder (cognitive 63): rule.PruneIndexesByWhereAndOrder has cognitive complexity 63 (threshold 15). Drivers by points: if/else 45, loops 10, boolean chains 8 (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":"pkg/planner/core/rule/rule_prune_indexes.go"},"region":{"startLine":100}}}],"partialFingerprints":{"codehealthFindingId/v1":"3bf87f2fceea1cc23dddaa90ef828b966e32607db1de676f8f5960cdf3995da1"}},{"ruleId":"D2","level":"warning","message":{"text":"MyDecimal.FromString (cognitive 63): MyDecimal.FromString has cognitive complexity 63 (threshold 15). Drivers by points: if/else 50, loops 7, boolean chains 5, match/switch 1 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/types/mydecimal.go"},"region":{"startLine":406}}}],"partialFingerprints":{"codehealthFindingId/v1":"eb2fcdb278dc66d73f8ad7936ba98660d8584c609ff0e228dc4c58832e8ff178"}},{"ruleId":"D2","level":"warning","message":{"text":"export.ListAllDatabasesTables (cognitive 62): export.ListAllDatabasesTables has cognitive complexity 62 (threshold 15). Drivers by points: if/else 47, loops 12, boolean chains 2, match/switch 1 (nesting depth added 37). Of this number, 46 points are the body\u0027s own statements and 16 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":"dumpling/export/sql.go"},"region":{"startLine":367}}}],"partialFingerprints":{"codehealthFindingId/v1":"bc4b76926da5200aba1caae47cbc059250a0bb4f4782c4602b287ae06a7169a6"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.columnDefToCol (cognitive 62): ddl.columnDefToCol has cognitive complexity 62 (threshold 15). Drivers by points: if/else 56, match/switch 3, loops 2, boolean chains 1 (nesting depth added 42). 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/ddl/add_column.go"},"region":{"startLine":469}}}],"partialFingerprints":{"codehealthFindingId/v1":"1c09f0b879a8b3f15c52a401242d14ca26d55bdaca3cff2de03bba8b96366dda"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.refreshTiFlashTicker (cognitive 62): ddl.refreshTiFlashTicker has cognitive complexity 62 (threshold 15). Drivers by points: if/else 53, loops 6, boolean chains 3 (nesting depth added 32). Of this number, 55 points are the body\u0027s own statements and 7 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":"pkg/ddl/ddl_tiflash_api.go"},"region":{"startLine":384}}}],"partialFingerprints":{"codehealthFindingId/v1":"fe47b4bff343cca43635c92ba7f43ac1efb5c0c94ca6b599501bd10fca26045a"}},{"ruleId":"D2","level":"warning","message":{"text":"MergeJoinExec.Next (cognitive 62): MergeJoinExec.Next has cognitive complexity 62 (threshold 15). Drivers by points: if/else 43, boolean chains 10, loops 9 (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":"pkg/executor/join/merge_join.go"},"region":{"startLine":327}}}],"partialFingerprints":{"codehealthFindingId/v1":"fa4b4878e0607582b1a41bd6b0b2c9fb6d2c5aaff29dbe01c8157521fa636538"}},{"ruleId":"D2","level":"warning","message":{"text":"ParallelNestedLoopApplyExec.reorderWorker (cognitive 62): ParallelNestedLoopApplyExec.reorderWorker has cognitive complexity 62 (threshold 15). Drivers by points: if/else 43, loops 11, match/switch 8 (nesting depth added 41). Of this number, 53 points are the body\u0027s own statements and 9 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":"pkg/executor/parallel_apply.go"},"region":{"startLine":483}}}],"partialFingerprints":{"codehealthFindingId/v1":"ab674d2f6273092affeefcf82b3bf1445488f5d1877825d1206e72ffc473f4c7"}},{"ruleId":"D2","level":"warning","message":{"text":"cardinality.getColumnRowCount (cognitive 62): cardinality.getColumnRowCount has cognitive complexity 62 (threshold 15). Drivers by points: if/else 50, boolean chains 7, loops 5 (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":"pkg/planner/cardinality/row_count_column.go"},"region":{"startLine":121}}}],"partialFingerprints":{"codehealthFindingId/v1":"6fb6c6b97813dcfd09ef5eb5f15c1eaff167652efae8eefe3c1b769c83a84afb"}},{"ruleId":"D2","level":"warning","message":{"text":"core.attach2TaskForMpp (cognitive 62): core.attach2TaskForMpp has cognitive complexity 62 (threshold 15). Drivers by points: if/else 49, loops 9, boolean chains 3, 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":"pkg/planner/core/task.go"},"region":{"startLine":2035}}}],"partialFingerprints":{"codehealthFindingId/v1":"aba57af7f420810bbb0a40f671eb85d690b3890bd86c475d0887646da98a0a4d"}},{"ruleId":"D2","level":"warning","message":{"text":"Explain.RenderResult (cognitive 62): Explain.RenderResult has cognitive complexity 62 (threshold 15). Drivers by points: if/else 50, boolean chains 6, loops 5, match/switch 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":"pkg/planner/core/common_plans.go"},"region":{"startLine":826}}}],"partialFingerprints":{"codehealthFindingId/v1":"e77c7624320f736d1ef2b7ffee4a632aab31db0d93a3e02b4c6292c2b181d8e9"}},{"ruleId":"D2","level":"warning","message":{"text":"FDSet.MakeOuterJoin (cognitive 62): FDSet.MakeOuterJoin has cognitive complexity 62 (threshold 15). Drivers by points: if/else 38, loops 18, boolean chains 6 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/funcdep/fd_graph.go"},"region":{"startLine":743}}}],"partialFingerprints":{"codehealthFindingId/v1":"e71f465b40e101e59afb38469302f5bb3c681663048da36334b0ccdcd10beb3e"}},{"ruleId":"D2","level":"warning","message":{"text":"session.bootstrapSessionImpl (cognitive 62): session.bootstrapSessionImpl has cognitive complexity 62 (threshold 15). Drivers by points: if/else 56, boolean chains 3, loops 3 (nesting depth added 12). Of this number, 60 points are the body\u0027s own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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":"pkg/session/session.go"},"region":{"startLine":4408}}}],"partialFingerprints":{"codehealthFindingId/v1":"5d6ada345749d3c50eaf3b7c79f65104cd784742ccee17f4286e1200c47d5eaa"}},{"ruleId":"D2","level":"warning","message":{"text":"types.doSub (cognitive 62): types.doSub has cognitive complexity 62 (threshold 15). Drivers by points: if/else 33, loops 22, boolean chains 7 (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":"pkg/types/mydecimal.go"},"region":{"startLine":1737}}}],"partialFingerprints":{"codehealthFindingId/v1":"f5bcad06bd5e13885aeb59b20bf2cd4eaa324e88f9e1ea33401e49ee05eb0869"}},{"ruleId":"D2","level":"warning","message":{"text":"logclient.ApplyKVFilesWithBatchMethod (cognitive 61): logclient.ApplyKVFilesWithBatchMethod has cognitive complexity 61 (threshold 15). Drivers by points: if/else 47, loops 10, boolean chains 4 (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":"br/pkg/restore/log_client/client.go"},"region":{"startLine":870}}}],"partialFingerprints":{"codehealthFindingId/v1":"1b1465a38b3adbe3e67deb0ba3a211234cd71404c492ae8a2772d6f191036503"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.GeneratePartDefsFromInterval (cognitive 61): ddl.GeneratePartDefsFromInterval has cognitive complexity 61 (threshold 15). Drivers by points: if/else 57, boolean chains 2, loops 1, match/switch 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":"pkg/ddl/partition.go"},"region":{"startLine":1283}}}],"partialFingerprints":{"codehealthFindingId/v1":"c1526e83179c5b1311375a9c10051ac4a010fc411ea93062745683f602088432"}},{"ruleId":"D2","level":"warning","message":{"text":"executor.dropTableObject (cognitive 61): executor.dropTableObject has cognitive complexity 61 (threshold 15). Drivers by points: if/else 46, loops 7, boolean chains 5, match/switch 3 (nesting depth added 30). 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/ddl/executor.go"},"region":{"startLine":4254}}}],"partialFingerprints":{"codehealthFindingId/v1":"47fbde89567465ef9ba2f0c18057a11498b14ee3c83a4495f060315a5744ac8a"}},{"ruleId":"D2","level":"warning","message":{"text":"expression.adjustRetFtForCastString (cognitive 61): expression.adjustRetFtForCastString has cognitive complexity 61 (threshold 15). Drivers by points: if/else 54, match/switch 7 (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":"pkg/expression/builtin_cast.go"},"region":{"startLine":367}}}],"partialFingerprints":{"codehealthFindingId/v1":"aba40cb3840b541829760ca73e6cd73cb3d67d6d95113fd5127ed6a426267196"}},{"ruleId":"D2","level":"warning","message":{"text":"tableListExtractor.Enter (cognitive 61): tableListExtractor.Enter has cognitive complexity 61 (threshold 15). Drivers by points: if/else 50, boolean chains 7, loops 3, match/switch 1 (nesting depth added 33). Of this number, 60 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":"pkg/planner/core/logical_plan_builder.go"},"region":{"startLine":7521}}}],"partialFingerprints":{"codehealthFindingId/v1":"2a06706e17265d378dd1f040991bf26e4e210dcec36cd7d11efc9b96d8da3e8a"}},{"ruleId":"D2","level":"warning","message":{"text":"PlanBuilder.buildSelectPlanOfInsert (cognitive 61): PlanBuilder.buildSelectPlanOfInsert has cognitive complexity 61 (threshold 15). Drivers by points: if/else 35, loops 19, boolean chains 7 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/planbuilder.go"},"region":{"startLine":4408}}}],"partialFingerprints":{"codehealthFindingId/v1":"860ba8c17227266d8d85117a4524f4ad085bcae92ded28595f9de470824ef3e2"}},{"ruleId":"D2","level":"warning","message":{"text":"JoinReOrderSolver.optimizeRecursive (cognitive 61): JoinReOrderSolver.optimizeRecursive has cognitive complexity 61 (threshold 15). Drivers by points: if/else 51, loops 7, boolean chains 3 (nesting depth added 36). Of this number, 58 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":"pkg/planner/core/rule_join_reorder.go"},"region":{"startLine":326}}}],"partialFingerprints":{"codehealthFindingId/v1":"d820840e46e913cff423d9e2986c74db9cff1650134b630b65438ca2cf817e99"}},{"ruleId":"D2","level":"warning","message":{"text":"RPCClient.SendRequest (cognitive 61): RPCClient.SendRequest has cognitive complexity 61 (threshold 15). Drivers by points: if/else 41, match/switch 11, boolean chains 6, loops 3 (nesting depth added 21). Of this number, 17 points are the body\u0027s own statements and 44 belong to 19 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":"pkg/store/mockstore/unistore/rpc.go"},"region":{"startLine":76}}}],"partialFingerprints":{"codehealthFindingId/v1":"bcaf758d1e5e4430290e5197719e7fd66c68c08da768c23e6acd407bf6f15684"}},{"ruleId":"D2","level":"warning","message":{"text":"ExecDetails.String (cognitive 61): ExecDetails.String has cognitive complexity 61 (threshold 15). Drivers by points: if/else 61 (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":"pkg/util/execdetails/execdetails.go"},"region":{"startLine":236}}}],"partialFingerprints":{"codehealthFindingId/v1":"af9fbb1ba824af68d153e52e30fdb4a7042fecad4de3fedea2c9ab5773f03d43"}},{"ruleId":"D2","level":"warning","message":{"text":"RestoreConfig.ParseFromFlags (cognitive 60): RestoreConfig.ParseFromFlags has cognitive complexity 60 (threshold 15). Drivers by points: if/else 57, boolean chains 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":"br/pkg/task/restore.go"},"region":{"startLine":488}}}],"partialFingerprints":{"codehealthFindingId/v1":"57425c619b0444b578252d09c1043104243a7df42a5ee65857fbd76cf12b2cc1"}},{"ruleId":"D2","level":"warning","message":{"text":"Controller.buildRunPeriodicActionAndCancelFunc (cognitive 60): Controller.buildRunPeriodicActionAndCancelFunc has cognitive complexity 60 (threshold 15). Drivers by points: if/else 48, match/switch 5, boolean chains 4, loops 3 (nesting depth added 32). Most of this is not in the body itself: 5 of the 60 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 1036, 1020, 1196). 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":"lightning/pkg/importer/import.go"},"region":{"startLine":1001}}}],"partialFingerprints":{"codehealthFindingId/v1":"aea32bd2f57bb9a809b4013d892c4cf4eb90336800761121975c86c7b631c268"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.onMultiSchemaChange (cognitive 60): ddl.onMultiSchemaChange has cognitive complexity 60 (threshold 15). Drivers by points: if/else 45, loops 12, boolean chains 3 (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/multi_schema_change.go"},"region":{"startLine":32}}}],"partialFingerprints":{"codehealthFindingId/v1":"dfd881b288f80462d8fb75e05e749b9b19281b41493e738c692ff466cea09a37"}},{"ruleId":"D2","level":"warning","message":{"text":"BaseTaskExecutor.Run (cognitive 60): BaseTaskExecutor.Run has cognitive complexity 60 (threshold 15). Drivers by points: if/else 52, boolean chains 4, match/switch 3, loops 1 (nesting depth added 30). Of this number, 58 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":"pkg/dxf/framework/taskexecutor/task_executor.go"},"region":{"startLine":273}}}],"partialFingerprints":{"codehealthFindingId/v1":"6f9a9b9a14a1bc39693518e633dd1e20ca48095e085667da134906d44e27e8e1"}},{"ruleId":"D2","level":"warning","message":{"text":"memtableRetriever.setDataFromResourceGroups (cognitive 60): memtableRetriever.setDataFromResourceGroups has cognitive complexity 60 (threshold 15). Drivers by points: if/else 51, match/switch 8, loops 1 (nesting depth added 38). 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/executor/infoschema_reader.go"},"region":{"startLine":3934}}}],"partialFingerprints":{"codehealthFindingId/v1":"bf3f38adb582ed8327ad35025e83a591b147e2e80edcf14daf7178c214929b5c"}},{"ruleId":"D2","level":"warning","message":{"text":"deadlocksTableRetriever.retrieve (cognitive 60): deadlocksTableRetriever.retrieve has cognitive complexity 60 (threshold 15). Drivers by points: if/else 50, loops 9, boolean chains 1 (nesting depth added 31). Most of this is not in the body itself: 10 of the 60 points are its own statements and the rest belongs to one function literal inside it that branches (line 3442). 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":"pkg/executor/infoschema_reader.go"},"region":{"startLine":3408}}}],"partialFingerprints":{"codehealthFindingId/v1":"7c286fe4edd0f7f8444f5f96d756347a120927a9cf0163f7440d0ed376547cdf"}},{"ruleId":"D2","level":"warning","message":{"text":"PipelinedWindowExec.produce (cognitive 60): PipelinedWindowExec.produce has cognitive complexity 60 (threshold 15). Drivers by points: if/else 51, loops 7, boolean chains 2 (nesting depth added 37). 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/executor/windows/pipelined_window.go"},"region":{"startLine":343}}}],"partialFingerprints":{"codehealthFindingId/v1":"4b1b1f05452fb9288557bc4198a49ac9e5481f3272ac8733548895bfccd1df8e"}},{"ruleId":"D2","level":"warning","message":{"text":"expression.ExecBinaryParam (cognitive 60): expression.ExecBinaryParam has cognitive complexity 60 (threshold 15). Drivers by points: if/else 46, match/switch 11, loops 2, boolean chains 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":"pkg/expression/util.go"},"region":{"startLine":2117}}}],"partialFingerprints":{"codehealthFindingId/v1":"71fec6405e76d867cf5c374a3788e4c60dbc3ada10e5a1c6b72c6d4f5f0d8c9d"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinRegexpReplaceFuncSig.vecEvalString (cognitive 60): builtinRegexpReplaceFuncSig.vecEvalString has cognitive complexity 60 (threshold 15). Drivers by points: if/else 55, boolean chains 3, loops 2 (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":"pkg/expression/builtin_regexp.go"},"region":{"startLine":1267}}}],"partialFingerprints":{"codehealthFindingId/v1":"b744152d9400e33096727545297771e76c098fe47fd65cb076ca643f0c8bb9f6"}},{"ruleId":"D2","level":"warning","message":{"text":"PlanBuilder.tryBuildCTE (cognitive 60): PlanBuilder.tryBuildCTE has cognitive complexity 60 (threshold 15). Drivers by points: if/else 45, loops 8, match/switch 4, boolean chains 3 (nesting depth added 39). 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/planner/core/logical_plan_builder.go"},"region":{"startLine":4742}}}],"partialFingerprints":{"codehealthFindingId/v1":"a5a167e0001f6c7529133e464962b0c4672905d20de8765998c6995af7dcd565"}},{"ruleId":"D2","level":"warning","message":{"text":"PlanBuilder.buildSimple (cognitive 60): PlanBuilder.buildSimple has cognitive complexity 60 (threshold 15). Drivers by points: if/else 46, loops 12, boolean chains 1, match/switch 1 (nesting depth added 31). 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":"pkg/planner/core/planbuilder.go"},"region":{"startLine":3723}}}],"partialFingerprints":{"codehealthFindingId/v1":"904acdbfbdf7a4b2e5c51621daf3cb17ce53961459407d1ac482f6165b0d4204"}},{"ruleId":"D2","level":"warning","message":{"text":"LoadKeyspaceController.Handler (cognitive 60): LoadKeyspaceController.Handler has cognitive complexity 60 (threshold 15). Drivers by points: if/else 53, boolean chains 5, match/switch 2 (nesting depth added 26). Most of this is not in the body itself: 0 of the 60 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 313, 233, 366). 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":"pkg/standby/standby.go"},"region":{"startLine":230}}}],"partialFingerprints":{"codehealthFindingId/v1":"0b6b688ad82aab57e055387f8ac5b2e136be3d5237217c8e92e70b75b73fc7df"}},{"ruleId":"D2","level":"warning","message":{"text":"worker.doModifyColumnIndexReorg (cognitive 59): worker.doModifyColumnIndexReorg has cognitive complexity 59 (threshold 15). Drivers by points: if/else 40, loops 10, match/switch 8, boolean chains 1 (nesting depth added 33). Of this number, 57 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":"pkg/ddl/modify_column.go"},"region":{"startLine":1137}}}],"partialFingerprints":{"codehealthFindingId/v1":"2136638ddf2b1ef2b722c6ebd00b35fa67a0d36a1fbacfa33056cb27cfefbacb"}},{"ruleId":"D2","level":"warning","message":{"text":"worker.reorgPartitionDataAndIndex (cognitive 59): worker.reorgPartitionDataAndIndex has cognitive complexity 59 (threshold 15). Drivers by points: if/else 53, loops 5, boolean chains 1 (nesting depth added 30). Of this number, 58 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":"pkg/ddl/partition.go"},"region":{"startLine":4102}}}],"partialFingerprints":{"codehealthFindingId/v1":"7c38759f21dfdec9531e1100e7e9cbf18e0f15ce37695649496f6b6316a59eed"}},{"ruleId":"D2","level":"warning","message":{"text":"memtableRetriever.dataForTableTiFlashReplica (cognitive 59): memtableRetriever.dataForTableTiFlashReplica has cognitive complexity 59 (threshold 15). Drivers by points: if/else 48, loops 9, boolean chains 2 (nesting depth added 37). 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/executor/infoschema_reader.go"},"region":{"startLine":2816}}}],"partialFingerprints":{"codehealthFindingId/v1":"75d37707b19cdea29f245055ebf5786c65c306a7d48eb0e68277819a13f07f23"}},{"ruleId":"D2","level":"warning","message":{"text":"inspectionSummaryRetriever.retrieve (cognitive 59): inspectionSummaryRetriever.retrieve has cognitive complexity 59 (threshold 15). Drivers by points: if/else 40, loops 15, boolean chains 4 (nesting depth added 36). 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/executor/inspection_summary.go"},"region":{"startLine":412}}}],"partialFingerprints":{"codehealthFindingId/v1":"2b35914a005d533a44e928d43e0cf8ab17c7a4b9a6dce79fccf245309f14f402"}},{"ruleId":"D2","level":"warning","message":{"text":"expression.inferCollation (cognitive 59): expression.inferCollation has cognitive complexity 59 (threshold 15). Drivers by points: if/else 38, boolean chains 14, match/switch 6, loops 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/collation.go"},"region":{"startLine":450}}}],"partialFingerprints":{"codehealthFindingId/v1":"cd3a33b652da9eb2c6bf5f53c730affd7b5a30884cf79c970d3149fe7ecbb07c"}},{"ruleId":"D2","level":"warning","message":{"text":"listPartitionPruner.locateColumnPartitionsByCondition (cognitive 59): listPartitionPruner.locateColumnPartitionsByCondition has cognitive complexity 59 (threshold 15). Drivers by points: if/else 51, loops 6, boolean chains 2 (nesting depth added 37). 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/planner/core/rule/rule_partition_processor.go"},"region":{"startLine":659}}}],"partialFingerprints":{"codehealthFindingId/v1":"c6826bd894d7663fead38e1814068457713f8633cc78b1d4c1a833946b2707bf"}},{"ruleId":"D2","level":"warning","message":{"text":"ranger.getPotentialEqOrInColOffset (cognitive 59): ranger.getPotentialEqOrInColOffset has cognitive complexity 59 (threshold 15). Drivers by points: if/else 40, loops 10, boolean chains 8, match/switch 1 (nesting depth added 28). Of this number, 57 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":"pkg/util/ranger/detacher.go"},"region":{"startLine":109}}}],"partialFingerprints":{"codehealthFindingId/v1":"f0497f5c85256128ab345989a1180caf5275fd43f5dba6c95e3934dff5ddabb1"}},{"ruleId":"D2","level":"warning","message":{"text":"TableOptimizerHint.Restore (cognitive 59): TableOptimizerHint.Restore has cognitive complexity 59 (threshold 15). Drivers by points: if/else 40, loops 12, boolean chains 5, match/switch 2 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/parser/ast/misc.go"},"region":{"startLine":4208}}}],"partialFingerprints":{"codehealthFindingId/v1":"ae9e1a3e345577fc2ef63d4bbf2aed62b00cc494af962c9e830e5a6acc161db9"}},{"ruleId":"D2","level":"warning","message":{"text":"importer.NewImportControllerWithPauser (cognitive 58): importer.NewImportControllerWithPauser has cognitive complexity 58 (threshold 15). Drivers by points: if/else 55, match/switch 2, boolean chains 1 (nesting depth added 23). Of this number, 54 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":"lightning/pkg/importer/import.go"},"region":{"startLine":306}}}],"partialFingerprints":{"codehealthFindingId/v1":"3ffcae073078a4ea5f1a42f69ede7cdae04d3fee8662c8b8e69ed65a85b7bf77"}},{"ruleId":"D2","level":"warning","message":{"text":"domain.DumpPlanReplayerInfo (cognitive 58): domain.DumpPlanReplayerInfo has cognitive complexity 58 (threshold 15). Drivers by points: if/else 54, loops 3, boolean chains 1 (nesting depth added 16). Of this number, 45 points are the body\u0027s own statements and 13 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":"pkg/domain/plan_replayer_dump.go"},"region":{"startLine":234}}}],"partialFingerprints":{"codehealthFindingId/v1":"6ddcf8d90c8765d616388d87e415a1c6b9e6ea4eb4d08cc73ab12157b4542ad1"}},{"ruleId":"D2","level":"warning","message":{"text":"core.constructDS2IndexScanTask (cognitive 58): core.constructDS2IndexScanTask has cognitive complexity 58 (threshold 15). Drivers by points: if/else 42, boolean chains 11, 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":"pkg/planner/core/exhaust_physical_plans.go"},"region":{"startLine":1066}}}],"partialFingerprints":{"codehealthFindingId/v1":"d04bd39787a1d5439085abd00bf01f47fe6d1dac0e6e79558070a707f01a9f71"}},{"ruleId":"D2","level":"warning","message":{"text":"core.checkAccessFilter4IdxCol (cognitive 58): core.checkAccessFilter4IdxCol has cognitive complexity 58 (threshold 15). Drivers by points: if/else 46, boolean chains 6, loops 4, match/switch 2 (nesting depth added 25). 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/planner/core/indexmerge_path.go"},"region":{"startLine":1238}}}],"partialFingerprints":{"codehealthFindingId/v1":"b95768460ff7b23af9ca3dd1eb3b7a5c3bb7ea3e04ed0934a41d5e56463162aa"}},{"ruleId":"D2","level":"warning","message":{"text":"core.checkColumn (cognitive 58): core.checkColumn has cognitive complexity 58 (threshold 15). Drivers by points: if/else 48, boolean chains 4, match/switch 4, loops 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":"pkg/planner/core/preprocess.go"},"region":{"startLine":1578}}}],"partialFingerprints":{"codehealthFindingId/v1":"11c28cf143b36f1f6b543dcfea49e2ac118feca707b20967d2f3b8155419439c"}},{"ruleId":"D2","level":"warning","message":{"text":"PlanBuilder.buildUpdate (cognitive 58): PlanBuilder.buildUpdate has cognitive complexity 58 (threshold 15). Drivers by points: if/else 47, loops 10, boolean chains 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/logical_plan_builder.go"},"region":{"startLine":6048}}}],"partialFingerprints":{"codehealthFindingId/v1":"4808b2bf24b2f8d9f7fe99827c6d18245c94c1632f8bf13824afdf0ebc326b67"}},{"ruleId":"D2","level":"warning","message":{"text":"SkewDistinctAggRewriter.rewriteSkewDistinctAgg (cognitive 58): SkewDistinctAggRewriter.rewriteSkewDistinctAgg has cognitive complexity 58 (threshold 15). Drivers by points: if/else 47, loops 11 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/rule_aggregation_skew_rewrite.go"},"region":{"startLine":51}}}],"partialFingerprints":{"codehealthFindingId/v1":"e565d8d9fcec1aab6160bc16da22d31f1e69e1ccc88247ada21516fd9a03d1cb"}},{"ruleId":"D2","level":"warning","message":{"text":"Handle.initStatsHistograms4Chunk (cognitive 58): Handle.initStatsHistograms4Chunk has cognitive complexity 58 (threshold 15). Drivers by points: if/else 48, loops 7, boolean chains 3 (nesting depth added 33). Of this number, 57 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":"pkg/statistics/handle/bootstrap.go"},"region":{"startLine":186}}}],"partialFingerprints":{"codehealthFindingId/v1":"aacf7f76339b69b79bd7afba06c8219cae66ec99eb2cec17f5532f05bec15594"}},{"ruleId":"D2","level":"warning","message":{"text":"EC2Session.CreateSnapshots (cognitive 57): EC2Session.CreateSnapshots has cognitive complexity 57 (threshold 15). Drivers by points: if/else 41, loops 13, boolean chains 3 (nesting depth added 35). Of this number, 53 points are the body\u0027s own statements and 4 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":"br/pkg/aws/ebs.go"},"region":{"startLine":63}}}],"partialFingerprints":{"codehealthFindingId/v1":"2ba388e6b9dcce1dd580974ef342b435d07a20a3ef0a4ca118eff5b76acc7e96"}},{"ruleId":"D2","level":"warning","message":{"text":"TableMappingManager.MergeBaseDBReplace (cognitive 57): TableMappingManager.MergeBaseDBReplace has cognitive complexity 57 (threshold 15). Drivers by points: if/else 37, loops 18, boolean chains 2 (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":"br/pkg/stream/table_mapping.go"},"region":{"startLine":573}}}],"partialFingerprints":{"codehealthFindingId/v1":"010346b5d005bd9b8d5d0b1314003ded5f24a67caf8c773ab31788efa8045d5c"}},{"ruleId":"D2","level":"warning","message":{"text":"taskRegister.keepaliveLoop (cognitive 57): taskRegister.keepaliveLoop has cognitive complexity 57 (threshold 15). Drivers by points: if/else 33, match/switch 17, loops 5, jumps 2 (nesting depth added 38). Of this number, 54 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":"br/pkg/utils/register.go"},"region":{"startLine":191}}}],"partialFingerprints":{"codehealthFindingId/v1":"fdcb8a4d5828aaaeab3d36352309969e6e69a06804bbe8c57ad2b7a4eaedac56"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.buildListPartitionDefinitions (cognitive 57): ddl.buildListPartitionDefinitions has cognitive complexity 57 (threshold 15). Drivers by points: if/else 39, loops 17, boolean chains 1 (nesting depth added 36). 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/ddl/partition.go"},"region":{"startLine":1543}}}],"partialFingerprints":{"codehealthFindingId/v1":"d1e6629722b191342367bc00b92b33f64ca363ac97d686671d9423826e6ddd39"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.formatListPartitionValue (cognitive 57): ddl.formatListPartitionValue has cognitive complexity 57 (threshold 15). Drivers by points: if/else 47, loops 8, boolean chains 1, jumps 1 (nesting depth added 37). 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/ddl/partition.go"},"region":{"startLine":1975}}}],"partialFingerprints":{"codehealthFindingId/v1":"bbe925c7b3fda5cff92bccc2da2ccd3d76cd7d59d7a32cb95fe9b81e559d6d39"}},{"ruleId":"D2","level":"warning","message":{"text":"worker.onAddTablePartition (cognitive 57): worker.onAddTablePartition has cognitive complexity 57 (threshold 15). Drivers by points: if/else 47, loops 7, boolean chains 2, match/switch 1 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/partition.go"},"region":{"startLine":94}}}],"partialFingerprints":{"codehealthFindingId/v1":"33fb1d84aabcce9f8a98523682ccf8b6709778c60fadfad44112e9aa5930fbb0"}},{"ruleId":"D2","level":"warning","message":{"text":"selectResult.updateCopRuntimeStats (cognitive 57): selectResult.updateCopRuntimeStats has cognitive complexity 57 (threshold 15). Drivers by points: if/else 44, boolean chains 10, loops 3 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/distsql/select_result.go"},"region":{"startLine":635}}}],"partialFingerprints":{"codehealthFindingId/v1":"da24e51fc37499fd2027203188327ae92d93ca050d23f5735ce486cabd407168"}},{"ruleId":"D2","level":"warning","message":{"text":"baseJoinProbe.SetChunkForProbe (cognitive 57): baseJoinProbe.SetChunkForProbe has cognitive complexity 57 (threshold 15). Drivers by points: if/else 41, loops 12, boolean chains 4 (nesting depth added 17). Of this number, 56 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":"pkg/executor/join/base_join_probe.go"},"region":{"startLine":179}}}],"partialFingerprints":{"codehealthFindingId/v1":"1bc859a7f8073778d83e2915d9c1784fac9e02363ea09d559752ae662a9a27b0"}},{"ruleId":"D2","level":"warning","message":{"text":"NestedLoopApplyExec.Next (cognitive 57): NestedLoopApplyExec.Next has cognitive complexity 57 (threshold 15). Drivers by points: if/else 42, loops 9, boolean chains 6 (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/join/hash_join_v1.go"},"region":{"startLine":1347}}}],"partialFingerprints":{"codehealthFindingId/v1":"00e2e58061260d6255f854263f84a28f5ac25e57ccf87062132e4846ff59d107"}},{"ruleId":"D2","level":"warning","message":{"text":"addSubDateFunctionClass.getFunction (cognitive 57): addSubDateFunctionClass.getFunction has cognitive complexity 57 (threshold 15). Drivers by points: boolean chains 31, if/else 24, match/switch 2 (nesting depth added 5). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/builtin_time.go"},"region":{"startLine":3755}}}],"partialFingerprints":{"codehealthFindingId/v1":"5ba6ed95053c7b9a2d7655ed463889e1a8b7b8610eb7eebed274cbe741dcdec2"}},{"ruleId":"D2","level":"warning","message":{"text":"tidbBackend.execStmts (cognitive 57): tidbBackend.execStmts has cognitive complexity 57 (threshold 15). Drivers by points: if/else 53, loops 3, jumps 1 (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/lightning/backend/tidb/tidb.go"},"region":{"startLine":843}}}],"partialFingerprints":{"codehealthFindingId/v1":"f5a6c2745e80c5dc9f8c36c4c57368972d9126b8c18ebf6b11a8050adfe9e55c"}},{"ruleId":"D2","level":"warning","message":{"text":"s3store.NewS3Storage (cognitive 57): s3store.NewS3Storage has cognitive complexity 57 (threshold 15). Drivers by points: if/else 52, boolean chains 5 (nesting depth added 15). Of this number, 51 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":"pkg/objstore/s3store/store.go"},"region":{"startLine":58}}}],"partialFingerprints":{"codehealthFindingId/v1":"862b886c42a448bb59b4a43ea59de1a902a8974bae57e2512f7bd00cdc33d060"}},{"ruleId":"D2","level":"warning","message":{"text":"statistics.EnumRangeValues (cognitive 57): statistics.EnumRangeValues has cognitive complexity 57 (threshold 15). Drivers by points: if/else 42, loops 8, boolean chains 6, match/switch 1 (nesting depth added 25). 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/statistics/scalar.go"},"region":{"startLine":227}}}],"partialFingerprints":{"codehealthFindingId/v1":"6984c1126935ed8452e7a0a77116cb8b8dc724f47a98df317d535d0c8a166bf6"}},{"ruleId":"D2","level":"warning","message":{"text":"TableCommon.rebuildUpdateRecordIndices (cognitive 57): TableCommon.rebuildUpdateRecordIndices has cognitive complexity 57 (threshold 15). Drivers by points: if/else 44, loops 10, boolean chains 3 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/table/tables/tables.go"},"region":{"startLine":569}}}],"partialFingerprints":{"codehealthFindingId/v1":"d296c4211ce078c82a2b4d034ce8ecb732ff639ea32f3b80c8a218b68d6836cb"}},{"ruleId":"D2","level":"warning","message":{"text":"types.ChangeReverseResultByUpperLowerBound (cognitive 57): types.ChangeReverseResultByUpperLowerBound has cognitive complexity 57 (threshold 15). Drivers by points: if/else 54, match/switch 3 (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":"pkg/types/datum.go"},"region":{"startLine":2627}}}],"partialFingerprints":{"codehealthFindingId/v1":"95e60d486255df04fae89d331a955f5ceeec15914a0e5978e892939cc4a1d388"}},{"ruleId":"D2","level":"warning","message":{"text":"codec.HashGroupKey (cognitive 57): codec.HashGroupKey has cognitive complexity 57 (threshold 15). Drivers by points: if/else 40, loops 16, match/switch 1 (nesting depth added 30). The drivers above price the dispatch low by construction \u2014 a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full \u2014 so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/util/codec/codec.go"},"region":{"startLine":1791}}}],"partialFingerprints":{"codehealthFindingId/v1":"5478bf4cda155179b057320e1f4ea4358f971c65beebf5787c423ec5195445e6"}},{"ruleId":"D2","level":"warning","message":{"text":"AnalyzeColumnsExec.buildSamplingStats (cognitive 56): AnalyzeColumnsExec.buildSamplingStats has cognitive complexity 56 (threshold 15). Drivers by points: if/else 39, loops 16, boolean chains 1 (nesting depth added 20). Of this number, 44 points are the body\u0027s own statements and 12 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":"pkg/executor/analyze_col_sampling.go"},"region":{"startLine":193}}}],"partialFingerprints":{"codehealthFindingId/v1":"a2c8fa03f908715f9f62424c0258fa5f446e3d3885d2916d928f2d4dda442acb"}},{"ruleId":"D2","level":"warning","message":{"text":"intersectionProcessWorker.doIntersectionPerPartition (cognitive 56): intersectionProcessWorker.doIntersectionPerPartition has cognitive complexity 56 (threshold 15). Drivers by points: if/else 37, loops 10, match/switch 9 (nesting depth added 32). Of this number, 48 points are the body\u0027s own statements and 8 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":"pkg/executor/index_merge_reader.go"},"region":{"startLine":1433}}}],"partialFingerprints":{"codehealthFindingId/v1":"88b0fa93113074e5873fcbe666fa499f36960337c449df3c371c9c382a9d4e80"}},{"ruleId":"D2","level":"warning","message":{"text":"expression.addCollateAndCharsetAndFlagFromArgs (cognitive 56): expression.addCollateAndCharsetAndFlagFromArgs has cognitive complexity 56 (threshold 15). Drivers by points: if/else 40, boolean chains 8, loops 7, match/switch 1 (nesting depth added 26). The drivers above price the dispatch low by construction \u2014 a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full \u2014 so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/builtin_control.go"},"region":{"startLine":146}}}],"partialFingerprints":{"codehealthFindingId/v1":"c310456c499b00a4c92692a3f171401bea29f8bc450b3088d0e8370c20bf3e13"}},{"ruleId":"D2","level":"warning","message":{"text":"expression.evalOneVec (cognitive 56): expression.evalOneVec has cognitive complexity 56 (threshold 15). Drivers by points: if/else 43, loops 12, match/switch 1 (nesting depth added 34). 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":"pkg/expression/chunk_executor.go"},"region":{"startLine":109}}}],"partialFingerprints":{"codehealthFindingId/v1":"0107671a4d0cc1a248abb1687fdfa7edada94c82319bae730ce465ff3bf234e1"}},{"ruleId":"D2","level":"warning","message":{"text":"core.setupFineGrainedShuffleInternal (cognitive 56): core.setupFineGrainedShuffleInternal has cognitive complexity 56 (threshold 15). Drivers by points: if/else 31, loops 20, match/switch 4, boolean chains 1 (nesting depth added 37). 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":"pkg/planner/core/optimizer.go"},"region":{"startLine":862}}}],"partialFingerprints":{"codehealthFindingId/v1":"9379d1c7209a049175573d3b036cce01e4e2ce2b81edec3b782bb599020cf2d2"}},{"ruleId":"D2","level":"warning","message":{"text":"LogClient.RefreshMetaForTables (cognitive 55): LogClient.RefreshMetaForTables has cognitive complexity 55 (threshold 15). Drivers by points: if/else 45, loops 10 (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":"br/pkg/restore/log_client/client.go"},"region":{"startLine":2539}}}],"partialFingerprints":{"codehealthFindingId/v1":"ae8dd292c9858b69248d4834a27f1d108bff5540b161fd50f8c8a60b548c585a"}},{"ruleId":"D2","level":"warning","message":{"text":"TiFlashSystemTableRetriever.dataForTiFlashSystemTables (cognitive 55): TiFlashSystemTableRetriever.dataForTiFlashSystemTables has cognitive complexity 55 (threshold 15). Drivers by points: if/else 49, loops 5, boolean chains 1 (nesting depth added 26). Of this number, 51 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":"pkg/executor/infoschema_reader.go"},"region":{"startLine":3622}}}],"partialFingerprints":{"codehealthFindingId/v1":"8062cfe48703263390712fd0788987095583b98d5d64e2cee26ca5528d677eff"}},{"ruleId":"D2","level":"warning","message":{"text":"expression.simpleCanonicalizedHashCode (cognitive 55): expression.simpleCanonicalizedHashCode has cognitive complexity 55 (threshold 15). Drivers by points: loops 39, if/else 12, match/switch 4 (nesting depth added 32). 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":"pkg/expression/scalar_function.go"},"region":{"startLine":623}}}],"partialFingerprints":{"codehealthFindingId/v1":"11d9626b2495885f57d04680cac556b2c41499633f4c07164be927edb288dcaa"}},{"ruleId":"D2","level":"warning","message":{"text":"core.buildIntoAccessPath (cognitive 55): core.buildIntoAccessPath has cognitive complexity 55 (threshold 15). Drivers by points: if/else 42, boolean chains 8, loops 5 (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":"pkg/planner/core/indexmerge_unfinished_path.go"},"region":{"startLine":343}}}],"partialFingerprints":{"codehealthFindingId/v1":"573334e115a13d90bc8080d1beb71540716d0fbed2fb4fa5f55bbe3f4217e76d"}},{"ruleId":"D2","level":"warning","message":{"text":"preprocessor.Enter (cognitive 55): preprocessor.Enter has cognitive complexity 55 (threshold 15). Drivers by points: if/else 44, boolean chains 7, match/switch 4 (nesting depth added 24). 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":"pkg/planner/core/preprocess.go"},"region":{"startLine":259}}}],"partialFingerprints":{"codehealthFindingId/v1":"4217d3ddf325fc7bfcf2f0fbe4e8e2eb80d85b5893622c543db3a199a4821f34"}},{"ruleId":"D2","level":"warning","message":{"text":"preprocessor.checkCreateTableGrammar (cognitive 55): preprocessor.checkCreateTableGrammar has cognitive complexity 55 (threshold 15). Drivers by points: if/else 42, loops 6, match/switch 5, boolean chains 2 (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":"pkg/planner/core/preprocess.go"},"region":{"startLine":921}}}],"partialFingerprints":{"codehealthFindingId/v1":"adb12d7de6d483a4d6b75e0af53f3fba1df0ef61539b32ac8e70e43f986d2523"}},{"ruleId":"D2","level":"warning","message":{"text":"ranger.ExtractEqAndInCondition (cognitive 55): ranger.ExtractEqAndInCondition has cognitive complexity 55 (threshold 15). Drivers by points: if/else 46, loops 5, boolean chains 4 (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":"pkg/util/ranger/detacher.go"},"region":{"startLine":732}}}],"partialFingerprints":{"codehealthFindingId/v1":"6354393a6cae7d5833082fd2667df5246e873ba8eab0ed1e352e3ece75e0a24a"}},{"ruleId":"D2","level":"warning","message":{"text":"expression.evaluateExprWithNullInNullRejectCheck (cognitive 54): expression.evaluateExprWithNullInNullRejectCheck has cognitive complexity 54 (threshold 15). Drivers by points: if/else 38, loops 11, boolean chains 4, match/switch 1 (nesting depth added 34). 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":"pkg/expression/expression.go"},"region":{"startLine":993}}}],"partialFingerprints":{"codehealthFindingId/v1":"2c5b108132f692e81f1bc82d110883b7f3d2893b80ee4d2bee09082bf3a9abd4"}},{"ruleId":"D2","level":"warning","message":{"text":"Backend.doWrite (cognitive 54): Backend.doWrite has cognitive complexity 54 (threshold 15). Drivers by points: if/else 49, loops 4, boolean chains 1 (nesting depth added 18). Of this number, 39 points are the body\u0027s own statements and 15 belong to 4 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":"pkg/ingestor/ingestctrl/region_job.go"},"region":{"startLine":331}}}],"partialFingerprints":{"codehealthFindingId/v1":"ae91ce0e9fa6c4974fa23d71e0d1b37e38ffcc1b1d64638c3d8c74c9da6a07ea"}},{"ruleId":"D2","level":"warning","message":{"text":"worker.runTask (cognitive 54): worker.runTask has cognitive complexity 54 (threshold 15). Drivers by points: if/else 48, match/switch 5, loops 1 (nesting depth added 32). Of this number, 53 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":"pkg/lightning/duplicate/worker.go"},"region":{"startLine":59}}}],"partialFingerprints":{"codehealthFindingId/v1":"0408b97f2f7a07fa703dbd372a1c32fa8c597fa5ca8ff9a27114995787a24154"}},{"ruleId":"D2","level":"warning","message":{"text":"core.convertToIndexScan (cognitive 54): core.convertToIndexScan has cognitive complexity 54 (threshold 15). Drivers by points: if/else 37, boolean chains 12, loops 5 (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":"pkg/planner/core/find_best_task.go"},"region":{"startLine":2553}}}],"partialFingerprints":{"codehealthFindingId/v1":"d088741cfc757a744692dff4580db807965e5f0f0bc90cf26d439457c57fef8d"}},{"ruleId":"D2","level":"warning","message":{"text":"PlanBuilder.buildResultSetNode (cognitive 54): PlanBuilder.buildResultSetNode has cognitive complexity 54 (threshold 15). Drivers by points: if/else 38, loops 11, match/switch 3, boolean chains 2 (nesting depth added 32). 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":"pkg/planner/core/logical_plan_builder.go"},"region":{"startLine":434}}}],"partialFingerprints":{"codehealthFindingId/v1":"98be3800c9e9427acc05e19e74431725281e018c8ecd271211645c0f8b0fe2aa"}},{"ruleId":"D2","level":"warning","message":{"text":"columnStatsUsageCollector.collectFromPlan (cognitive 54): columnStatsUsageCollector.collectFromPlan has cognitive complexity 54 (threshold 15). Drivers by points: loops 34, if/else 16, match/switch 3, boolean chains 1 (nesting depth added 29). 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":"pkg/planner/core/rule/collect_column_stats_usage.go"},"region":{"startLine":264}}}],"partialFingerprints":{"codehealthFindingId/v1":"e2d548087f37e8988f2767a7cf3b5c783a716febbfb167562a3ea1334369f1ff"}},{"ruleId":"D2","level":"warning","message":{"text":"rule.MakePartitionByFnCol (cognitive 54): rule.MakePartitionByFnCol has cognitive complexity 54 (threshold 15). Drivers by points: if/else 39, match/switch 14, boolean chains 1 (nesting depth added 36). 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/planner/core/rule/rule_partition_processor.go"},"region":{"startLine":1106}}}],"partialFingerprints":{"codehealthFindingId/v1":"fdef51eafdfdcf95e10a0055f537849a46309700453c03c9b6d33450ec2c6f91"}},{"ruleId":"D2","level":"warning","message":{"text":"PartitionProcessor.resolveOptimizeHint (cognitive 54): PartitionProcessor.resolveOptimizeHint has cognitive complexity 54 (threshold 15). Drivers by points: if/else 35, loops 18, boolean chains 1 (nesting depth added 32). 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/planner/core/rule/rule_partition_processor.go"},"region":{"startLine":1791}}}],"partialFingerprints":{"codehealthFindingId/v1":"3d65639b6a97f9960bb708037dc4bd004a089c477b44bb703d69e31762ff6dde"}},{"ruleId":"D2","level":"warning","message":{"text":"main.cmdRun (cognitive 54): main.cmdRun has cognitive complexity 54 (threshold 15). Drivers by points: if/else 47, loops 7 (nesting depth added 25). 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/ut.go"},"region":{"startLine":225}}}],"partialFingerprints":{"codehealthFindingId/v1":"6c4145174c795a0fb239bd3ed4bff261c8b041a0b73b729d19b103a5cb613e86"}},{"ruleId":"D2","level":"warning","message":{"text":"FuncCallExpr.Restore (cognitive 54): FuncCallExpr.Restore has cognitive complexity 54 (threshold 15). Drivers by points: if/else 48, match/switch 3, loops 2, boolean chains 1 (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":"pkg/parser/ast/functions.go"},"region":{"startLine":413}}}],"partialFingerprints":{"codehealthFindingId/v1":"e5cf953972ecbd9296c8d7bb3ff1c400ba5cbdbdf74c454d70ac5016649f8986"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.buildFKInfo (cognitive 53): ddl.buildFKInfo has cognitive complexity 53 (threshold 15). Drivers by points: if/else 26, match/switch 16, loops 8, boolean chains 3 (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":"pkg/ddl/executor.go"},"region":{"startLine":5278}}}],"partialFingerprints":{"codehealthFindingId/v1":"c1a0ec35242ec1d242afa71b8979256a3222f04880da623090ee754c35f0458f"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.PollTiFlashRoutine (cognitive 53): ddl.PollTiFlashRoutine has cognitive complexity 53 (threshold 15). Drivers by points: if/else 43, match/switch 8, boolean chains 1, loops 1 (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/ddl_tiflash_api.go"},"region":{"startLine":638}}}],"partialFingerprints":{"codehealthFindingId/v1":"054eceeb69ebaabf480c339ec2b45e60e7dafc4e05a6c76e53354dcc7b903359"}},{"ruleId":"D2","level":"warning","message":{"text":"executorBuilder.buildUnionScanFromReader (cognitive 53): executorBuilder.buildUnionScanFromReader has cognitive complexity 53 (threshold 15). Drivers by points: if/else 35, loops 17, match/switch 1 (nesting depth added 30). 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/executor/builder.go"},"region":{"startLine":1507}}}],"partialFingerprints":{"codehealthFindingId/v1":"7af21b3199e9418c7a6acdd18e3e1093cf1083dd9e7c32ffc794fd006e80cc27"}},{"ruleId":"D2","level":"warning","message":{"text":"SimpleExec.executeSetPwd (cognitive 53): SimpleExec.executeSetPwd has cognitive complexity 53 (threshold 15). Drivers by points: if/else 45, boolean chains 7, match/switch 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":"pkg/executor/simple.go"},"region":{"startLine":2857}}}],"partialFingerprints":{"codehealthFindingId/v1":"4c77fab7012846d0cb0ad76cbad9f389d4d98196cbc3740fa4da8a120ce61618"}},{"ruleId":"D2","level":"warning","message":{"text":"UserPrivileges.ConnectionVerification (cognitive 53): UserPrivileges.ConnectionVerification has cognitive complexity 53 (threshold 15). Drivers by points: if/else 49, boolean chains 2, match/switch 2 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/privilege/privileges/privileges.go"},"region":{"startLine":631}}}],"partialFingerprints":{"codehealthFindingId/v1":"57d0c3f286b486ca2e5793faf6081dc7220f3a587e953d90d27a645e67f92b2d"}},{"ruleId":"D2","level":"warning","message":{"text":"topnStatsMergeWorker.Run (cognitive 53): topnStatsMergeWorker.Run has cognitive complexity 53 (threshold 15). Drivers by points: if/else 41, loops 10, boolean chains 2 (nesting depth added 38). 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/statistics/handle/globalstats/merge_worker.go"},"region":{"startLine":90}}}],"partialFingerprints":{"codehealthFindingId/v1":"91135bba8e05b00adc475f6e1aaac357c3199cb2bee9059d56045464053df0c4"}},{"ruleId":"D2","level":"warning","message":{"text":"QBHintHandler.handleViewHints (cognitive 53): QBHintHandler.handleViewHints has cognitive complexity 53 (threshold 15). Drivers by points: if/else 44, loops 7, boolean chains 2 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/util/hint/hint_query_block.go"},"region":{"startLine":140}}}],"partialFingerprints":{"codehealthFindingId/v1":"0ca4926ab3bd10e90bd5ac4a29acd0e0fc01c65d56d4fbb682dded5c2b9417e2"}},{"ruleId":"D2","level":"warning","message":{"text":"parquetfile.parseRawColumnValue (cognitive 52): parquetfile.parseRawColumnValue has cognitive complexity 52 (threshold 15). Drivers by points: if/else 50, boolean chains 1, match/switch 1 (nesting depth added 30). The drivers above price the dispatch low by construction \u2014 a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full \u2014 so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/dumpformat/parquetfile/column_value.go"},"region":{"startLine":36}}}],"partialFingerprints":{"codehealthFindingId/v1":"e880f97898ff102fb9225963e3b69d5491df28303ddaed00b6e82641ba9aca64"}},{"ruleId":"D2","level":"warning","message":{"text":"ExecStmt.handlePessimisticDML (cognitive 52): ExecStmt.handlePessimisticDML has cognitive complexity 52 (threshold 15). Drivers by points: if/else 49, boolean chains 2, loops 1 (nesting depth added 20). Of this number, 37 points are the body\u0027s own statements and 15 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":"pkg/executor/adapter.go"},"region":{"startLine":1163}}}],"partialFingerprints":{"codehealthFindingId/v1":"2d22a724191412d60181aa43797dd2d128dcaedf65ab21b011720464bf201b9d"}},{"ruleId":"D2","level":"warning","message":{"text":"SimpleExec.executeRevokeRole (cognitive 52): SimpleExec.executeRevokeRole has cognitive complexity 52 (threshold 15). Drivers by points: if/else 42, loops 8, 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":"pkg/executor/simple.go"},"region":{"startLine":698}}}],"partialFingerprints":{"codehealthFindingId/v1":"1fbed2cdc50d0cc85c1c9c07f0c3e1a9898d68dcc8601815d0691cbe915a364b"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinRegexpSubstrFuncSig.vecEvalString (cognitive 52): builtinRegexpSubstrFuncSig.vecEvalString has cognitive complexity 52 (threshold 15). Drivers by points: if/else 46, boolean chains 4, loops 2 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/builtin_regexp.go"},"region":{"startLine":482}}}],"partialFingerprints":{"codehealthFindingId/v1":"3b14da60c39d7d865344cf9ae22ec3db2853eca251d3a334d8c62766a9d3fa1a"}},{"ruleId":"D2","level":"warning","message":{"text":"PlanBuilder.resolveHavingAndOrderBy (cognitive 52): PlanBuilder.resolveHavingAndOrderBy has cognitive complexity 52 (threshold 15). Drivers by points: if/else 37, loops 14, boolean chains 1 (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/logical_plan_builder.go"},"region":{"startLine":2911}}}],"partialFingerprints":{"codehealthFindingId/v1":"d44243c7cfca90fdeb1b018dfe9d56a8358cbc2841ddd9d7fc989ed6ee34dc10"}},{"ruleId":"D2","level":"warning","message":{"text":"clientConn.readOptionalSSLRequestAndHandshakeResponse (cognitive 52): clientConn.readOptionalSSLRequestAndHandshakeResponse has cognitive complexity 52 (threshold 15). Drivers by points: if/else 49, boolean chains 2, match/switch 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/server/conn.go"},"region":{"startLine":580}}}],"partialFingerprints":{"codehealthFindingId/v1":"52b750e5bb8d5631e5576096afa66bb4d60b67182ed62b5c4384305e4e36fe94"}},{"ruleId":"D2","level":"warning","message":{"text":"BinaryJSON.extractTo (cognitive 52): BinaryJSON.extractTo has cognitive complexity 52 (threshold 15). Drivers by points: if/else 30, loops 12, boolean chains 7, match/switch 3 (nesting depth added 25). 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/types/json_binary_functions.go"},"region":{"startLine":292}}}],"partialFingerprints":{"codehealthFindingId/v1":"a5244db52eabe1b67307fa1de8dc8ab7eab519f259bd91e687811384a49b6eec"}},{"ruleId":"D2","level":"warning","message":{"text":"SnapFileImporter.batchDownloadNewestVersionSST (cognitive 51): SnapFileImporter.batchDownloadNewestVersionSST has cognitive complexity 51 (threshold 15). Drivers by points: if/else 34, loops 11, boolean chains 3, match/switch 3 (nesting depth added 29). Of this number, 32 points are the body\u0027s own statements and 19 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":"br/pkg/restore/snap_client/import.go"},"region":{"startLine":904}}}],"partialFingerprints":{"codehealthFindingId/v1":"f8148e324a5830972cc2cdabf21f325e3ec678b6fa33417988ed43b91848474f"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.checkModifyColumnWithForeignKeyConstraint (cognitive 51): ddl.checkModifyColumnWithForeignKeyConstraint has cognitive complexity 51 (threshold 15). Drivers by points: if/else 44, loops 6, boolean chains 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":"pkg/ddl/foreign_key.go"},"region":{"startLine":301}}}],"partialFingerprints":{"codehealthFindingId/v1":"3b254ed5fbf0b782044ead706dca50fc4efe4c327eae1f4a4e0f57ce6e263ccb"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.buildCheckSQLConditionForRangeColumnsPartition (cognitive 51): ddl.buildCheckSQLConditionForRangeColumnsPartition has cognitive complexity 51 (threshold 15). Drivers by points: if/else 40, loops 10, boolean chains 1 (nesting depth added 30). 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/ddl/partition.go"},"region":{"startLine":4510}}}],"partialFingerprints":{"codehealthFindingId/v1":"a71acb75257d432b136c5b683c2aa0aa7b472b4ffd29b765ee9832775d6e84fc"}},{"ruleId":"D2","level":"warning","message":{"text":"importScheduler.OnNextSubtasksBatch (cognitive 51): importScheduler.OnNextSubtasksBatch has cognitive complexity 51 (threshold 15). Drivers by points: if/else 48, boolean chains 2, match/switch 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":"pkg/dxf/importinto/scheduler.go"},"region":{"startLine":385}}}],"partialFingerprints":{"codehealthFindingId/v1":"ddf358c7d3d9fb091463b247d014bf561647eea6391ee50a8c9e24e6160ca2ed"}},{"ruleId":"D2","level":"warning","message":{"text":"CheckTableExec.Next (cognitive 51): CheckTableExec.Next has cognitive complexity 51 (threshold 15). Drivers by points: if/else 33, loops 10, boolean chains 4, match/switch 4 (nesting depth added 26). Of this number, 23 points are the body\u0027s own statements and 28 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/executor/check_table_index.go"},"region":{"startLine":142}}}],"partialFingerprints":{"codehealthFindingId/v1":"8f26b16c366c6e991dfe9dc6d4ce1a946b4995e29864c03730bfaa08ee96d46f"}},{"ruleId":"D2","level":"warning","message":{"text":"InsertValues.lazyAdjustAutoIncrementDatum (cognitive 51): InsertValues.lazyAdjustAutoIncrementDatum has cognitive complexity 51 (threshold 15). Drivers by points: if/else 38, loops 10, boolean chains 3 (nesting depth added 30). 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/executor/insert_common.go"},"region":{"startLine":869}}}],"partialFingerprints":{"codehealthFindingId/v1":"ca82a94b5e2a100b81c1633aee1660b0378e2a4406f91b991ce38e6b320f433f"}},{"ruleId":"D2","level":"warning","message":{"text":"baseJoinProbe.appendBuildRowToChunkInternal (cognitive 51): baseJoinProbe.appendBuildRowToChunkInternal has cognitive complexity 51 (threshold 15). Drivers by points: loops 25, if/else 24, boolean chains 2 (nesting depth added 25). 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":"pkg/executor/join/base_join_probe.go"},"region":{"startLine":589}}}],"partialFingerprints":{"codehealthFindingId/v1":"021113b3a5c89d0a127d34f425939eea35d0c50dd64cec27e1c2e6925eb08713"}},{"ruleId":"D2","level":"warning","message":{"text":"compareFunctionClass.refineArgs (cognitive 51): compareFunctionClass.refineArgs has cognitive complexity 51 (threshold 15). Drivers by points: if/else 34, boolean chains 17 (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/expression/builtin_compare.go"},"region":{"startLine":1778}}}],"partialFingerprints":{"codehealthFindingId/v1":"4f38bb1cd0dbf494d5d4692a7948d9f97e3ab210819ab68129cc976d8f2416e0"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinJSONSearchSig.vecEvalJSON (cognitive 51): builtinJSONSearchSig.vecEvalJSON has cognitive complexity 51 (threshold 15). Drivers by points: if/else 43, loops 6, boolean chains 2 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/builtin_json_vec.go"},"region":{"startLine":497}}}],"partialFingerprints":{"codehealthFindingId/v1":"41b7c960c2146ebf84a6d4b4103e0592ac86dfbf7355ac01a8c0981706f55168"}},{"ruleId":"D2","level":"warning","message":{"text":"core.exhaustPhysicalPlans4LogicalJoin (cognitive 51): core.exhaustPhysicalPlans4LogicalJoin has cognitive complexity 51 (threshold 15). Drivers by points: if/else 43, boolean chains 5, loops 3 (nesting depth added 23). Of this number, 41 points are the body\u0027s own statements and 10 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/planner/core/exhaust_physical_plans.go"},"region":{"startLine":2181}}}],"partialFingerprints":{"codehealthFindingId/v1":"90d297202f92d1b486fbcd9290c6a0398498a231ac65d9ef0f3956a6296ddc66"}},{"ruleId":"D2","level":"warning","message":{"text":"core.buildRangesForPointGet (cognitive 51): core.buildRangesForPointGet has cognitive complexity 51 (threshold 15). Drivers by points: if/else 45, loops 4, boolean chains 2 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/plan_cache_rebuild.go"},"region":{"startLine":256}}}],"partialFingerprints":{"codehealthFindingId/v1":"76da4d19d4120b25cc56155797b76dc6350d49048515299a54d1307343da2665"}},{"ruleId":"D2","level":"warning","message":{"text":"nonPreparedPlanCacheableChecker.Enter (cognitive 51): nonPreparedPlanCacheableChecker.Enter has cognitive complexity 51 (threshold 15). Drivers by points: if/else 41, loops 7, boolean chains 2, match/switch 1 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/plan_cacheable_checker.go"},"region":{"startLine":428}}}],"partialFingerprints":{"codehealthFindingId/v1":"b254520dfb8ef7302b8cb6635a54b5b4bd69847979480658d027d6478e51aaec"}},{"ruleId":"D2","level":"warning","message":{"text":"UserPrivileges.checkSSL (cognitive 51): UserPrivileges.checkSSL has cognitive complexity 51 (threshold 15). Drivers by points: if/else 43, loops 4, boolean chains 3, match/switch 1 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/privilege/privileges/privileges.go"},"region":{"startLine":795}}}],"partialFingerprints":{"codehealthFindingId/v1":"33e6b1d275423f6a1276292c4f4af9ac0cec58f49835465c70d5cff2aaca3f16"}},{"ruleId":"D2","level":"warning","message":{"text":"importer.genColumnData (cognitive 51): importer.genColumnData has cognitive complexity 51 (threshold 15). Drivers by points: if/else 50, match/switch 1 (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":"pkg/util/importer/db.go"},"region":{"startLine":96}}}],"partialFingerprints":{"codehealthFindingId/v1":"aa11f7baa3a94074c340e7e71ceb9d36868029fb6947e0fafbb6952b60f68d4a"}},{"ruleId":"D2","level":"warning","message":{"text":"TableOption.Restore (cognitive 51): TableOption.Restore has cognitive complexity 51 (threshold 15). Drivers by points: if/else 46, match/switch 3, loops 2 (nesting depth added 20). Of this number, 46 points are the body\u0027s own statements and 5 belong to 2 function literals inside it that branch. 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":"pkg/parser/ast/ddl.go"},"region":{"startLine":2889}}}],"partialFingerprints":{"codehealthFindingId/v1":"932632ff42ab12e7d920fc01410dfeadfd579990c06a5cca1eda7e501801e95c"}},{"ruleId":"D2","level":"warning","message":{"text":"SnapFileImporter.batchDownloadSST (cognitive 50): SnapFileImporter.batchDownloadSST has cognitive complexity 50 (threshold 15). Drivers by points: if/else 34, loops 11, match/switch 4, boolean chains 1 (nesting depth added 31). Of this number, 30 points are the body\u0027s own statements and 20 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":"br/pkg/restore/snap_client/import.go"},"region":{"startLine":781}}}],"partialFingerprints":{"codehealthFindingId/v1":"53e97aa69376e760537510e0490835d0069a2bc0469f31651493993061200c62"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.initJobReorgMetaFromVariables (cognitive 50): ddl.initJobReorgMetaFromVariables has cognitive complexity 50 (threshold 15). Drivers by points: if/else 38, boolean chains 6, match/switch 4, loops 2 (nesting depth added 22). Of this number, 48 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":"pkg/ddl/reorg_util.go"},"region":{"startLine":43}}}],"partialFingerprints":{"codehealthFindingId/v1":"c27c12d1260911b126e39feebebc741ad1c81bd02449fd359ad97b22563b0c2b"}},{"ruleId":"D2","level":"warning","message":{"text":"ddlCtx.writePhysicalTableRecord (cognitive 50): ddlCtx.writePhysicalTableRecord has cognitive complexity 50 (threshold 15). Drivers by points: if/else 40, match/switch 4, loops 3, boolean chains 2, jumps 1 (nesting depth added 22). Most of this is not in the body itself: 6 of the 50 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 1011, 1099, 1063, \u2026). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals\u0027 work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/backfilling.go"},"region":{"startLine":962}}}],"partialFingerprints":{"codehealthFindingId/v1":"533ca1fc5a44d90c4709d51b1268356827e557dc3571d01146c15063f35745f5"}},{"ruleId":"D2","level":"warning","message":{"text":"rangeFrameWindowProcessor.appendResult2Chunk (cognitive 50): rangeFrameWindowProcessor.appendResult2Chunk has cognitive complexity 50 (threshold 15). Drivers by points: if/else 40, loops 8, boolean chains 2 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/windows/window.go"},"region":{"startLine":444}}}],"partialFingerprints":{"codehealthFindingId/v1":"ca0beb8065919ba5f278cdd1dca740806f3f1518775213ea228948ff72633519"}},{"ruleId":"D2","level":"warning","message":{"text":"cardinality.getIndexRowCountForStatsV1 (cognitive 50): cardinality.getIndexRowCountForStatsV1 has cognitive complexity 50 (threshold 15). Drivers by points: if/else 44, loops 4, 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":"pkg/planner/cardinality/row_count_index.go"},"region":{"startLine":82}}}],"partialFingerprints":{"codehealthFindingId/v1":"5db9ccd651bb154795f6f53444c655b744080000a2db709bbf4a8891d8fca511"}},{"ruleId":"D2","level":"warning","message":{"text":"core.checkColFuncDepend (cognitive 50): core.checkColFuncDepend has cognitive complexity 50 (threshold 15). Drivers by points: if/else 43, loops 4, boolean chains 3 (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":"pkg/planner/core/logical_plan_builder.go"},"region":{"startLine":3580}}}],"partialFingerprints":{"codehealthFindingId/v1":"f5d8a7fa3c1f5c15df03949109bc2d998e75c57650f6a57d773919e014db7b73"}},{"ruleId":"D2","level":"warning","message":{"text":"cacheableChecker.Enter (cognitive 50): cacheableChecker.Enter has cognitive complexity 50 (threshold 15). Drivers by points: if/else 42, loops 4, boolean chains 3, match/switch 1 (nesting depth added 27). 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":"pkg/planner/core/plan_cacheable_checker.go"},"region":{"startLine":96}}}],"partialFingerprints":{"codehealthFindingId/v1":"3cbd928d2560883dae1aa0cd408a948aabc69d934e114cac58f1041b17889976"}},{"ruleId":"D2","level":"warning","message":{"text":"UnionIter.updateCur (cognitive 50): UnionIter.updateCur has cognitive complexity 50 (threshold 15). Drivers by points: if/else 47, boolean chains 2, loops 1 (nesting depth added 32). 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/store/driver/txn/union_iter.go"},"region":{"startLine":66}}}],"partialFingerprints":{"codehealthFindingId/v1":"086b0726629e9b6bad4e73591240ba6bad0e3e998fde054780237b377b8aea12"}},{"ruleId":"D2","level":"warning","message":{"text":"indexLookUpExec.fetchTableScans (cognitive 50): indexLookUpExec.fetchTableScans has cognitive complexity 50 (threshold 15). Drivers by points: if/else 39, loops 8, boolean chains 3 (nesting depth added 20). Of this number, 39 points are the body\u0027s own statements and 11 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/store/mockstore/unistore/cophandler/mpp_exec.go"},"region":{"startLine":529}}}],"partialFingerprints":{"codehealthFindingId/v1":"f46063dc374400ace92458dcd65b6f4e4ae79163c1c37d74c9b24e3657dc2404"}},{"ruleId":"D2","level":"warning","message":{"text":"Controller.estimateChunkCountIntoMetrics (cognitive 49): Controller.estimateChunkCountIntoMetrics has cognitive complexity 49 (threshold 15). Drivers by points: if/else 35, loops 13, boolean chains 1 (nesting depth added 32). 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":"lightning/pkg/importer/import.go"},"region":{"startLine":789}}}],"partialFingerprints":{"codehealthFindingId/v1":"2061f683795a046edade5aaa10912d1d19a69cc211f699783dd111bfdd64889b"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.onDropIndex (cognitive 49): ddl.onDropIndex has cognitive complexity 49 (threshold 15). Drivers by points: if/else 35, loops 11, boolean chains 2, match/switch 1 (nesting depth added 24). Of this number, 47 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":"pkg/ddl/index.go"},"region":{"startLine":2076}}}],"partialFingerprints":{"codehealthFindingId/v1":"3c5e1cebb4eaf4bd2e432007ad6ead5913ea49c1c7ebd2adb115480a10c397e1"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.convertReorgPartitionJob2RollbackJob (cognitive 49): ddl.convertReorgPartitionJob2RollbackJob has cognitive complexity 49 (threshold 15). Drivers by points: if/else 36, loops 10, boolean chains 3 (nesting depth added 25). 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/ddl/rollingback.go"},"region":{"startLine":405}}}],"partialFingerprints":{"codehealthFindingId/v1":"fae1029c8f04e7b3f1c2e9fafcab9cba122fa4c233ea5bbaad51eba196228df4"}},{"ruleId":"D2","level":"warning","message":{"text":"IndexLookUpExecutor.startIndexWorker (cognitive 49): IndexLookUpExecutor.startIndexWorker has cognitive complexity 49 (threshold 15). Drivers by points: if/else 36, loops 8, match/switch 4, boolean chains 1 (nesting depth added 21). Of this number, 18 points are the body\u0027s own statements and 31 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/distsql.go"},"region":{"startLine":822}}}],"partialFingerprints":{"codehealthFindingId/v1":"76083a04eb9d14cd1e431b430dca977cc4ddbc817ef67a6651ad771ea2bc590d"}},{"ruleId":"D2","level":"warning","message":{"text":"tidbTrxTableRetriever.retrieve (cognitive 49): tidbTrxTableRetriever.retrieve has cognitive complexity 49 (threshold 15). Drivers by points: if/else 34, loops 9, match/switch 4, boolean chains 2 (nesting depth added 24). Most of this is not in the body itself: 14 of the 49 points are its own statements and the rest belongs to one function literal inside it that branches (line 3125). 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":"pkg/executor/infoschema_reader.go"},"region":{"startLine":3081}}}],"partialFingerprints":{"codehealthFindingId/v1":"be9533cf755ebaa84ed258355ce5477ab20532da3291789c2018de590e61d75a"}},{"ruleId":"D2","level":"warning","message":{"text":"ShowExec.fetchShowStatsMeta (cognitive 49): ShowExec.fetchShowStatsMeta has cognitive complexity 49 (threshold 15). Drivers by points: if/else 35, loops 10, boolean chains 4 (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":"pkg/executor/show_stats.go"},"region":{"startLine":36}}}],"partialFingerprints":{"codehealthFindingId/v1":"a253a5970573faa0d49eaf4a3b965f4f3a0dec1516ac8751dfc32a2a7efe431e"}},{"ruleId":"D2","level":"warning","message":{"text":"propConstSolver.propagateColumnEQ (cognitive 49): propConstSolver.propagateColumnEQ has cognitive complexity 49 (threshold 15). Drivers by points: if/else 38, loops 7, boolean chains 4 (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":"pkg/expression/constant_propagation.go"},"region":{"startLine":401}}}],"partialFingerprints":{"codehealthFindingId/v1":"b96ee214b05ad9fd6ca623cbfc84025f209a9247bb9bfde32275033990e95270"}},{"ruleId":"D2","level":"warning","message":{"text":"core.enumeratePhysicalPlans4TaskHelper (cognitive 49): core.enumeratePhysicalPlans4TaskHelper has cognitive complexity 49 (threshold 15). Drivers by points: if/else 40, boolean chains 6, match/switch 2, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/find_best_task.go"},"region":{"startLine":155}}}],"partialFingerprints":{"codehealthFindingId/v1":"91a5cb8124961dddcf4c866c76ba844fbbde39f90f575f1b26a1110a320f27de"}},{"ruleId":"D2","level":"warning","message":{"text":"physicalop.tryToGetMppHashAggs (cognitive 49): physicalop.tryToGetMppHashAggs has cognitive complexity 49 (threshold 15). Drivers by points: if/else 36, boolean chains 9, loops 4 (nesting depth added 15). Of this number, 39 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":"pkg/planner/core/operator/physicalop/physical_hash_agg.go"},"region":{"startLine":114}}}],"partialFingerprints":{"codehealthFindingId/v1":"2c6f42546513901940594ef123b327cbc5b35ffd679d11c4cc800df52bcd0c12"}},{"ruleId":"D2","level":"warning","message":{"text":"PlanBuilder.buildAnalyzeFullSamplingTask (cognitive 49): PlanBuilder.buildAnalyzeFullSamplingTask has cognitive complexity 49 (threshold 15). Drivers by points: if/else 35, loops 11, boolean chains 3 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/planbuilder.go"},"region":{"startLine":2677}}}],"partialFingerprints":{"codehealthFindingId/v1":"3f8e4873fb4371a77f99f559f7343c59c935619152bbe98806f6c00bb240c112"}},{"ruleId":"D2","level":"warning","message":{"text":"preprocessor.checkLockClauseTables (cognitive 49): preprocessor.checkLockClauseTables has cognitive complexity 49 (threshold 15). Drivers by points: if/else 35, loops 8, boolean chains 6 (nesting depth added 25). 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/planner/core/preprocess.go"},"region":{"startLine":1912}}}],"partialFingerprints":{"codehealthFindingId/v1":"e6f8097c97101900fee524fd4ad5d66cdcc01ea6f098aac96315b34a4bd0c889"}},{"ruleId":"D2","level":"warning","message":{"text":"copr.checkAliveStore (cognitive 49): copr.checkAliveStore has cognitive complexity 49 (threshold 15). Drivers by points: if/else 34, loops 14, boolean chains 1 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/store/copr/batch_coprocessor.go"},"region":{"startLine":1105}}}],"partialFingerprints":{"codehealthFindingId/v1":"09beee2eafaf0d06be3b7ba1c5c42d288d749499f21aeca33084e1d2799a54b9"}},{"ruleId":"D2","level":"warning","message":{"text":"Server.handleBatchRequest (cognitive 49): Server.handleBatchRequest has cognitive complexity 49 (threshold 15). Drivers by points: if/else 48, match/switch 1 (nesting depth added 24). 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":"pkg/store/mockstore/unistore/tikv/server_batch.go"},"region":{"startLine":133}}}],"partialFingerprints":{"codehealthFindingId/v1":"23bc7f015aad61eec0c40a7725ec276e3f4629dd29561e5e1a3ce696d38abeac"}},{"ruleId":"D2","level":"warning","message":{"text":"TableSource.Restore (cognitive 49): TableSource.Restore has cognitive complexity 49 (threshold 15). Drivers by points: if/else 40, loops 4, boolean chains 3, match/switch 2 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/parser/ast/dml.go"},"region":{"startLine":556}}}],"partialFingerprints":{"codehealthFindingId/v1":"d96f9b286b30ac1c4e0716e2038ecc39bdfa0fb6d0b34c19eb097222cf9d6adc"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.checkIndexCondition (cognitive 48): ddl.checkIndexCondition has cognitive complexity 48 (threshold 15). Drivers by points: if/else 40, boolean chains 5, match/switch 3 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/index.go"},"region":{"startLine":4086}}}],"partialFingerprints":{"codehealthFindingId/v1":"85c827300e04501620b196dc0427a8a78bead306e7e2c1a965f1634f0d41d3a5"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.GetModifiableColumnJob (cognitive 48): ddl.GetModifiableColumnJob has cognitive complexity 48 (threshold 15). Drivers by points: if/else 42, boolean chains 6 (nesting depth added 8). 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":"pkg/ddl/modify_column.go"},"region":{"startLine":1838}}}],"partialFingerprints":{"codehealthFindingId/v1":"6508bc06204b0db19279082172a8a3b4ab19ba1d0853b4b14e0cfaed6b8ffcf8"}},{"ruleId":"D2","level":"warning","message":{"text":"baseJoinProbe.appendProbeRowToChunkInternal (cognitive 48): baseJoinProbe.appendProbeRowToChunkInternal has cognitive complexity 48 (threshold 15). Drivers by points: if/else 32, loops 15, boolean chains 1 (nesting depth added 29). Of this number, 41 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/executor/join/base_join_probe.go"},"region":{"startLine":677}}}],"partialFingerprints":{"codehealthFindingId/v1":"3de1f5be53336ec9b6fead17934c7259256fc36c988ad92b11ad17f9962c45a0"}},{"ruleId":"D2","level":"warning","message":{"text":"innerMergeWorker.doMergeJoin (cognitive 48): innerMergeWorker.doMergeJoin has cognitive complexity 48 (threshold 15). Drivers by points: if/else 32, boolean chains 7, jumps 3, loops 3, match/switch 3 (nesting depth added 19). Of this number, 43 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":"pkg/executor/join/index_lookup_merge_join.go"},"region":{"startLine":527}}}],"partialFingerprints":{"codehealthFindingId/v1":"0e333bb7af1c319c3d9a73cdde545d53d8408db76210d1be149216fc2dad656d"}},{"ruleId":"D2","level":"warning","message":{"text":"ShowExec.fetchAllTablePlacements (cognitive 48): ShowExec.fetchAllTablePlacements has cognitive complexity 48 (threshold 15). Drivers by points: if/else 35, loops 12, boolean chains 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":"pkg/executor/show_placement.go"},"region":{"startLine":358}}}],"partialFingerprints":{"codehealthFindingId/v1":"3d3701de8c2741a9d7229bdf4059e18ed63ef9f4c3428638301a8cad9f2fb30d"}},{"ruleId":"D2","level":"warning","message":{"text":"DDLJobRetriever.appendJobToChunk (cognitive 48): DDLJobRetriever.appendJobToChunk has cognitive complexity 48 (threshold 15). Drivers by points: if/else 40, loops 5, boolean chains 3 (nesting depth added 18). 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/executor/show_ddl_jobs.go"},"region":{"startLine":190}}}],"partialFingerprints":{"codehealthFindingId/v1":"ac96479e397748aa2ed9e348110963055152647851572507b83da0e599a26bc7"}},{"ruleId":"D2","level":"warning","message":{"text":"UpdateExec.updateRows (cognitive 48): UpdateExec.updateRows has cognitive complexity 48 (threshold 15). Drivers by points: if/else 43, loops 5 (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":"pkg/executor/update.go"},"region":{"startLine":392}}}],"partialFingerprints":{"codehealthFindingId/v1":"50fb5010ec633d4e24468adb25d9fe9d9a90a168874aff77faac1168a1879866"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinRegexpInStrFuncSig.evalInt (cognitive 48): builtinRegexpInStrFuncSig.evalInt has cognitive complexity 48 (threshold 15). Drivers by points: if/else 37, boolean chains 11 (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":"pkg/expression/builtin_regexp.go"},"region":{"startLine":699}}}],"partialFingerprints":{"codehealthFindingId/v1":"23a293429ff8712ace8cbfde1a7e66a73aa6b753dedef700a4e9c99910b542dd"}},{"ruleId":"D2","level":"warning","message":{"text":"mergeIter.next (cognitive 48): mergeIter.next has cognitive complexity 48 (threshold 15). Drivers by points: if/else 37, loops 8, match/switch 2, boolean chains 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":"pkg/ingestor/simplesst/iter.go"},"region":{"startLine":257}}}],"partialFingerprints":{"codehealthFindingId/v1":"09aadb9916894735d953879ca6b54a4713222900fa3c4305b682ae64b7830a9a"}},{"ruleId":"D2","level":"warning","message":{"text":"targetInfoGetter.FetchRemoteTableModels (cognitive 48): targetInfoGetter.FetchRemoteTableModels has cognitive complexity 48 (threshold 15). Drivers by points: if/else 27, loops 15, match/switch 6 (nesting depth added 30). Most of this is not in the body itself: 5 of the 48 points are its own statements and the rest belongs to one function literal inside it that branches (line 199). 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":"pkg/lightning/backend/tidb/tidb.go"},"region":{"startLine":182}}}],"partialFingerprints":{"codehealthFindingId/v1":"aa2717e213360a68a5286cfecb84e82da250b830689becaaf709ee60b11eee41"}},{"ruleId":"D2","level":"warning","message":{"text":"FlatPhysicalPlan.flattenRecursively (cognitive 48): FlatPhysicalPlan.flattenRecursively has cognitive complexity 48 (threshold 15). Drivers by points: if/else 33, boolean chains 6, loops 6, match/switch 3 (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/planner/core/flat_plan.go"},"region":{"startLine":259}}}],"partialFingerprints":{"codehealthFindingId/v1":"9bf7ade659b9d30c766e34aba08c4369d725c31d9db921ae4463b27315e8fe0b"}},{"ruleId":"D2","level":"warning","message":{"text":"OuterJoinEliminator.doOptimize (cognitive 48): OuterJoinEliminator.doOptimize has cognitive complexity 48 (threshold 15). Drivers by points: loops 27, if/else 20, match/switch 1 (nesting depth added 24). 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":"pkg/planner/core/rule_join_elimination.go"},"region":{"startLine":302}}}],"partialFingerprints":{"codehealthFindingId/v1":"7fba6df1f70a0080786980fbd4180d8b48f18f5565a299e0997562d7608dd03e"}},{"ruleId":"D2","level":"warning","message":{"text":"Server.startHTTPServer (cognitive 48): Server.startHTTPServer has cognitive complexity 48 (threshold 15). Drivers by points: if/else 44, boolean chains 2, loops 1, match/switch 1 (nesting depth added 9). Most of this is not in the body itself: 12 of the 48 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 464, 372, 439, \u2026). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals\u0027 work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/server/http_status.go"},"region":{"startLine":235}}}],"partialFingerprints":{"codehealthFindingId/v1":"67eb688a2adf794bcd20dbbaed8fd10d4baa337d0c4927dc93d58fdb4c269068"}},{"ruleId":"D2","level":"warning","message":{"text":"builder.buildFromBinOp (cognitive 48): builder.buildFromBinOp has cognitive complexity 48 (threshold 15). Drivers by points: if/else 36, boolean chains 6, match/switch 6 (nesting depth added 18). Of this number, 25 points are the body\u0027s own statements and 23 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/util/ranger/points.go"},"region":{"startLine":278}}}],"partialFingerprints":{"codehealthFindingId/v1":"db2154a1ac7074d6799828d1f3f51f11ebffdc4404dd129d5e621e88c80c37d9"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.createTable (cognitive 47): ddl.createTable has cognitive complexity 47 (threshold 15). Drivers by points: if/else 44, boolean chains 1, loops 1, match/switch 1 (nesting depth added 24). Of this number, 45 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":"pkg/ddl/create_table.go"},"region":{"startLine":59}}}],"partialFingerprints":{"codehealthFindingId/v1":"4bcadac345adac347629f8de62dd10f35bffc379fc96b514357e2b09c5a976ce"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.buildRangePartitionDefinitions (cognitive 47): ddl.buildRangePartitionDefinitions has cognitive complexity 47 (threshold 15). Drivers by points: if/else 44, loops 3 (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":"pkg/ddl/partition.go"},"region":{"startLine":1638}}}],"partialFingerprints":{"codehealthFindingId/v1":"efba10a23ef1bb9ecf8b8e2ed103f339281215995c003598313fbada72b15095"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.getReorgInfo (cognitive 47): ddl.getReorgInfo has cognitive complexity 47 (threshold 15). Drivers by points: if/else 42, loops 3, boolean chains 2 (nesting depth added 26). Of this number, 35 points are the body\u0027s own statements and 12 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":"pkg/ddl/reorg.go"},"region":{"startLine":911}}}],"partialFingerprints":{"codehealthFindingId/v1":"861477c9e3d376b8f102d2747ed170b590a5a3799c7f5d0b1d1bc6886607fa1b"}},{"ruleId":"D2","level":"warning","message":{"text":"executorBuilder.buildBRIE (cognitive 47): executorBuilder.buildBRIE has cognitive complexity 47 (threshold 15). Drivers by points: if/else 20, match/switch 18, loops 9 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/brie.go"},"region":{"startLine":249}}}],"partialFingerprints":{"codehealthFindingId/v1":"19d040fddd887eed1a15cc808c29aa315a3ca9bb1f35df91beec6b21b6ddceed"}},{"ruleId":"D2","level":"warning","message":{"text":"DeleteExec.deleteSingleTableByChunk (cognitive 47): DeleteExec.deleteSingleTableByChunk has cognitive complexity 47 (threshold 15). Drivers by points: if/else 38, loops 6, boolean chains 3 (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":"pkg/executor/delete.go"},"region":{"startLine":93}}}],"partialFingerprints":{"codehealthFindingId/v1":"b26c046b680d5e9f22b89145a93eec9535c7db495f83244a0e9bda2fa8feb208"}},{"ruleId":"D2","level":"warning","message":{"text":"slowQueryRetriever.getAllFiles (cognitive 47): slowQueryRetriever.getAllFiles has cognitive complexity 47 (threshold 15). Drivers by points: if/else 37, loops 9, boolean chains 1 (nesting depth added 19). Of this number, 16 points are the body\u0027s own statements and 31 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":"pkg/executor/slow_query.go"},"region":{"startLine":1247}}}],"partialFingerprints":{"codehealthFindingId/v1":"ebf1c660bff3b08d3587648cee167dccb2b68ac8a6c70460b251e1a5a569904f"}},{"ruleId":"D2","level":"warning","message":{"text":"core.generateANDIndexMerge4NormalIndex (cognitive 47): core.generateANDIndexMerge4NormalIndex has cognitive complexity 47 (threshold 15). Drivers by points: if/else 33, loops 13, boolean chains 1 (nesting depth added 23). Of this number, 45 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":"pkg/planner/core/indexmerge_path.go"},"region":{"startLine":273}}}],"partialFingerprints":{"codehealthFindingId/v1":"39683f33ec0eac2de26d809015935151a86902c5d16d55836da16f5040305f53"}},{"ruleId":"D2","level":"warning","message":{"text":"core.initUnfinishedPathsFromExpr (cognitive 47): core.initUnfinishedPathsFromExpr has cognitive complexity 47 (threshold 15). Drivers by points: if/else 29, loops 10, boolean chains 8 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/indexmerge_unfinished_path.go"},"region":{"startLine":156}}}],"partialFingerprints":{"codehealthFindingId/v1":"efe04c0fc8b9daea97f4dc6c611bda70abac389dd227023de4571c2860f20dcb"}},{"ruleId":"D2","level":"warning","message":{"text":"core.attach2TaskForMpp4PhysicalHashJoin (cognitive 47): core.attach2TaskForMpp4PhysicalHashJoin has cognitive complexity 47 (threshold 15). Drivers by points: if/else 35, loops 8, boolean chains 4 (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":"pkg/planner/core/task.go"},"region":{"startLine":432}}}],"partialFingerprints":{"codehealthFindingId/v1":"7e5d567ec636e6e29462125999b47bbee8976aa1b501324ca23469c4910b0a0e"}},{"ruleId":"D2","level":"warning","message":{"text":"expressionRewriter.Enter (cognitive 47): expressionRewriter.Enter has cognitive complexity 47 (threshold 15). Drivers by points: if/else 40, match/switch 4, loops 2, boolean chains 1 (nesting depth added 23). Of this number, 26 points are the body\u0027s own statements and 21 belong to 4 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":"pkg/planner/core/expression_rewriter.go"},"region":{"startLine":535}}}],"partialFingerprints":{"codehealthFindingId/v1":"dadff64393590a788fdaa0bdb004ae8b23d51bedfb13ff144f4d6742598c6e0a"}},{"ruleId":"D2","level":"warning","message":{"text":"expressionRewriter.inToExpression (cognitive 47): expressionRewriter.inToExpression has cognitive complexity 47 (threshold 15). Drivers by points: if/else 39, loops 6, boolean chains 2 (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":"pkg/planner/core/expression_rewriter.go"},"region":{"startLine":2183}}}],"partialFingerprints":{"codehealthFindingId/v1":"160cb20dee3bd85bccd11104494302e97468a5dae78b086414ae3157be1e49ad"}},{"ruleId":"D2","level":"warning","message":{"text":"PhysicalHashJoin.explainInfo (cognitive 47): PhysicalHashJoin.explainInfo has cognitive complexity 47 (threshold 15). Drivers by points: if/else 36, loops 11 (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":"pkg/planner/core/operator/physicalop/physical_hash_join.go"},"region":{"startLine":221}}}],"partialFingerprints":{"codehealthFindingId/v1":"cc2d55f3adc352839da1e8379837e441e80805a92d17d12465dbac7530aca383"}},{"ruleId":"D2","level":"warning","message":{"text":"PhysicalTableScan.OperatorInfo (cognitive 47): PhysicalTableScan.OperatorInfo has cognitive complexity 47 (threshold 15). Drivers by points: if/else 37, loops 8, boolean chains 2 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/operator/physicalop/physical_table_scan.go"},"region":{"startLine":460}}}],"partialFingerprints":{"codehealthFindingId/v1":"a95f029997da73dc8c88b57d8ad7b644e3a6da0783a4dfe7730f832790443df5"}},{"ruleId":"D2","level":"warning","message":{"text":"PlanBuilder.groupWindowFuncs (cognitive 47): PlanBuilder.groupWindowFuncs has cognitive complexity 47 (threshold 15). Drivers by points: if/else 41, loops 6 (nesting depth added 30). 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/planner/core/logical_plan_builder.go"},"region":{"startLine":7314}}}],"partialFingerprints":{"codehealthFindingId/v1":"e3b7975dc2b0e4ade12ab377dd7e3fc2ec01f07453db67681de56f5595f7d318"}},{"ruleId":"D2","level":"warning","message":{"text":"PlanBuilder.buildImportInto (cognitive 47): PlanBuilder.buildImportInto has cognitive complexity 47 (threshold 15). Drivers by points: if/else 39, boolean chains 4, 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":"pkg/planner/core/planbuilder.go"},"region":{"startLine":4723}}}],"partialFingerprints":{"codehealthFindingId/v1":"743bf02e1005ca65e61cab8aaa1ea788f8801750753d9b670f8e665c2d08a9ff"}},{"ruleId":"D2","level":"warning","message":{"text":"rule.minCmp (cognitive 47): rule.minCmp has cognitive complexity 47 (threshold 15). Drivers by points: if/else 42, match/switch 3, boolean chains 1, loops 1 (nesting depth added 28). Most of this is not in the body itself: 0 of the 47 points are its own statements and the rest belongs to one function literal inside it that branches (line 1207). 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":"pkg/planner/core/rule/rule_partition_processor.go"},"region":{"startLine":1206}}}],"partialFingerprints":{"codehealthFindingId/v1":"88323c7da2773a9fe016ecc56f0b16691793d39a511efef9c7d161bd5a3dfe10"}},{"ruleId":"D2","level":"warning","message":{"text":"autoanalyze.RandomPickOneTableAndTryAutoAnalyze (cognitive 47): autoanalyze.RandomPickOneTableAndTryAutoAnalyze has cognitive complexity 47 (threshold 15). Drivers by points: if/else 38, loops 9 (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":"pkg/statistics/handle/autoanalyze/autoanalyze.go"},"region":{"startLine":411}}}],"partialFingerprints":{"codehealthFindingId/v1":"0fc013cf24e8bdbccd80dda377c35e6abbae238a4753c0e453179224fd948255"}},{"ruleId":"D2","level":"warning","message":{"text":"copIterator.Next (cognitive 47): copIterator.Next has cognitive complexity 47 (threshold 15). Drivers by points: if/else 39, loops 5, boolean chains 3 (nesting depth added 21). Of this number, 38 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":"pkg/store/copr/coprocessor.go"},"region":{"startLine":1416}}}],"partialFingerprints":{"codehealthFindingId/v1":"5aefda864957b4fb6938c027bfcc02d352fe099521a0cdf78f16781fd9233cb4"}},{"ruleId":"D2","level":"warning","message":{"text":"MVCCStore.prewritePessimistic (cognitive 47): MVCCStore.prewritePessimistic has cognitive complexity 47 (threshold 15). Drivers by points: if/else 39, boolean chains 6, loops 2 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/store/mockstore/unistore/tikv/mvcc.go"},"region":{"startLine":850}}}],"partialFingerprints":{"codehealthFindingId/v1":"3dc96702c2de8cddb2f58997889efea7420deb1a48f33d2a2afb89644efa979c"}},{"ruleId":"D2","level":"warning","message":{"text":"TableCommon.updateRecord (cognitive 47): TableCommon.updateRecord has cognitive complexity 47 (threshold 15). Drivers by points: if/else 45, boolean chains 1, loops 1 (nesting depth added 20). Of this number, 44 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":"pkg/table/tables/tables.go"},"region":{"startLine":445}}}],"partialFingerprints":{"codehealthFindingId/v1":"2c8b56a06f687cf6867261fc9d35792774f9330398eb5bd4552a776de98a8d87"}},{"ruleId":"D2","level":"warning","message":{"text":"types.parseSingleTimeValue (cognitive 47): types.parseSingleTimeValue has cognitive complexity 47 (threshold 15). Drivers by points: if/else 35, boolean chains 11, 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":"pkg/types/time.go"},"region":{"startLine":2334}}}],"partialFingerprints":{"codehealthFindingId/v1":"e939280abbfa78bb3839916393cdd9f4e853f3678d53199613b2c4f359f9f071"}},{"ruleId":"D2","level":"warning","message":{"text":"DeleteStmt.Restore (cognitive 47): DeleteStmt.Restore has cognitive complexity 47 (threshold 15). Drivers by points: if/else 45, loops 2 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/parser/ast/dml.go"},"region":{"startLine":2693}}}],"partialFingerprints":{"codehealthFindingId/v1":"ba5e7ced987b5bcad5fa1a31f9d4b4646914135e8acf0c3c6f90f276cfd977c6"}},{"ruleId":"D2","level":"warning","message":{"text":"Schemas.BackupSchemas (cognitive 46): Schemas.BackupSchemas has cognitive complexity 46 (threshold 15). Drivers by points: if/else 43, boolean chains 3 (nesting depth added 22). Most of this is not in the body itself: 4 of the 46 points are its own statements and the rest belongs to one function literal inside it that branches (line 104). 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":"br/pkg/backup/schema.go"},"region":{"startLine":80}}}],"partialFingerprints":{"codehealthFindingId/v1":"e8c64cb385fcdeca82160e6bc930580094d01d9f4f5d89170fecd9a317f6844c"}},{"ruleId":"D2","level":"warning","message":{"text":"worker.onTruncateTable (cognitive 46): worker.onTruncateTable has cognitive complexity 46 (threshold 15). Drivers by points: if/else 43, loops 2, boolean chains 1 (nesting depth added 12). Of this number, 44 points are the body\u0027s own statements and 2 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":"pkg/ddl/table.go"},"region":{"startLine":455}}}],"partialFingerprints":{"codehealthFindingId/v1":"8a01ee33b3d95735cbf91f6f159191bffd03136d1c8f3fd0c7a31ed5ea1f4eb3"}},{"ruleId":"D2","level":"warning","message":{"text":"indexMergeProcessWorker.fetchLoopUnion (cognitive 46): indexMergeProcessWorker.fetchLoopUnion has cognitive complexity 46 (threshold 15). Drivers by points: if/else 28, match/switch 12, loops 5, boolean chains 1 (nesting depth added 26). Of this number, 41 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":"pkg/executor/index_merge_reader.go"},"region":{"startLine":1245}}}],"partialFingerprints":{"codehealthFindingId/v1":"9313de78fe2f6d2c2cb63d929949d040f5f9a04335011bb890f3ae7c5d13311d"}},{"ruleId":"D2","level":"warning","message":{"text":"ProbeWorkerV1.join2Chunk (cognitive 46): ProbeWorkerV1.join2Chunk has cognitive complexity 46 (threshold 15). Drivers by points: if/else 39, loops 5, boolean chains 2 (nesting depth added 22). Of this number, 45 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":"pkg/executor/join/hash_join_v1.go"},"region":{"startLine":841}}}],"partialFingerprints":{"codehealthFindingId/v1":"630a45a31b0a8e54ad2c17e618ad371046cb39778d313f1d9cebb554f9c69016"}},{"ruleId":"D2","level":"warning","message":{"text":"indexHashJoinInnerWorker.doJoinInOrder (cognitive 46): indexHashJoinInnerWorker.doJoinInOrder has cognitive complexity 46 (threshold 15). Drivers by points: if/else 23, loops 12, match/switch 8, boolean chains 3 (nesting depth added 27). Of this number, 38 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":"pkg/executor/join/index_lookup_hash_join.go"},"region":{"startLine":918}}}],"partialFingerprints":{"codehealthFindingId/v1":"bc37330b3995446c8e7442addd60269d64748e62db5af2f8e32932292588b962"}},{"ruleId":"D2","level":"warning","message":{"text":"TableReaderExecutor.Open (cognitive 46): TableReaderExecutor.Open has cognitive complexity 46 (threshold 15). Drivers by points: if/else 39, loops 5, boolean chains 2 (nesting depth added 18). 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/executor/table_reader.go"},"region":{"startLine":232}}}],"partialFingerprints":{"codehealthFindingId/v1":"3779bf1733a64ab8069b250243603fb2cbd7965074d3589fd86434044e5b454d"}},{"ruleId":"D2","level":"warning","message":{"text":"rowFrameWindowProcessor.appendResult2Chunk (cognitive 46): rowFrameWindowProcessor.appendResult2Chunk has cognitive complexity 46 (threshold 15). Drivers by points: if/else 36, loops 8, boolean chains 2 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/windows/window.go"},"region":{"startLine":295}}}],"partialFingerprints":{"codehealthFindingId/v1":"a55bf652808f8c5d7258f26c50dc6351f40a8a7785dc4305bd33dc401d907eb3"}},{"ruleId":"D2","level":"warning","message":{"text":"expression.buildFTSBooleanModeILikeExpression (cognitive 46): expression.buildFTSBooleanModeILikeExpression has cognitive complexity 46 (threshold 15). Drivers by points: if/else 32, loops 12, boolean chains 2 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/fts_to_like.go"},"region":{"startLine":218}}}],"partialFingerprints":{"codehealthFindingId/v1":"1ed9fd038889e00f0436a8f72b693480bd559ca1749b831b1d3036099a875c11"}},{"ruleId":"D2","level":"warning","message":{"text":"compareFunctionClass.refineArgsByUnsignedFlag (cognitive 46): compareFunctionClass.refineArgsByUnsignedFlag has cognitive complexity 46 (threshold 15). Drivers by points: if/else 33, boolean chains 9, loops 2, match/switch 2 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/builtin_compare.go"},"region":{"startLine":1919}}}],"partialFingerprints":{"codehealthFindingId/v1":"f5b481765140d0c21d561ae46ef25f0c17246591df9c63c937b8e8df7e507adf"}},{"ruleId":"D2","level":"warning","message":{"text":"core.adjust3StagePhaseAgg (cognitive 46): core.adjust3StagePhaseAgg has cognitive complexity 46 (threshold 15). Drivers by points: if/else 30, loops 15, 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":"pkg/planner/core/task.go"},"region":{"startLine":1849}}}],"partialFingerprints":{"codehealthFindingId/v1":"91135275a34449c4996a547522bcbafcf63f95dd41fc747c6e39070393d3e717"}},{"ruleId":"D2","level":"warning","message":{"text":"PlanBuilder.buildJoin (cognitive 46): PlanBuilder.buildJoin has cognitive complexity 46 (threshold 15). Drivers by points: if/else 35, boolean chains 8, loops 2, match/switch 1 (nesting depth added 8). 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":"pkg/planner/core/logical_plan_builder.go"},"region":{"startLine":736}}}],"partialFingerprints":{"codehealthFindingId/v1":"e83779f51930defa8933ac9f64d6ea406c412f010398da861b68128c0c54f365"}},{"ruleId":"D2","level":"warning","message":{"text":"autoAdmin.heuristicCoveredIndexes (cognitive 46): autoAdmin.heuristicCoveredIndexes has cognitive complexity 46 (threshold 15). Drivers by points: if/else 31, loops 12, boolean chains 3 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/indexadvisor/algorithm.go"},"region":{"startLine":185}}}],"partialFingerprints":{"codehealthFindingId/v1":"d1ab37d2c6033c9455a835fcf2b4ef50d5ab11ad7a16915654fdb2fcc44a36ea"}},{"ruleId":"D2","level":"warning","message":{"text":"autoAdmin.heuristicMergeIndexes (cognitive 46): autoAdmin.heuristicMergeIndexes has cognitive complexity 46 (threshold 15). Drivers by points: if/else 36, loops 9, boolean chains 1 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/indexadvisor/algorithm.go"},"region":{"startLine":269}}}],"partialFingerprints":{"codehealthFindingId/v1":"8da81948312838d9713175d5e736ad1402f6373beba30a2ba8940385c54c3689"}},{"ruleId":"D2","level":"warning","message":{"text":"copr.buildBatchCopTasksConsistentHashForPD (cognitive 46): copr.buildBatchCopTasksConsistentHashForPD has cognitive complexity 46 (threshold 15). Drivers by points: if/else 33, loops 13 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/store/copr/batch_coprocessor.go"},"region":{"startLine":1601}}}],"partialFingerprints":{"codehealthFindingId/v1":"ebc96447f91552af632282cdaac604a2acd3d4c391f46ad4c283731a6289356f"}},{"ruleId":"D2","level":"warning","message":{"text":"copIteratorWorker.handleCopResponse (cognitive 46): copIteratorWorker.handleCopResponse has cognitive complexity 46 (threshold 15). Drivers by points: if/else 44, boolean chains 2 (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":"pkg/store/copr/coprocessor.go"},"region":{"startLine":2134}}}],"partialFingerprints":{"codehealthFindingId/v1":"ade6587bd60047a7956d5a4b12f598241cc2fcebb8492fa2ec0a17dadb80b3db"}},{"ruleId":"D2","level":"warning","message":{"text":"copIteratorWorker.handleBatchCopResponse (cognitive 46): copIteratorWorker.handleBatchCopResponse has cognitive complexity 46 (threshold 15). Drivers by points: if/else 41, loops 4, boolean chains 1 (nesting depth added 22). Of this number, 43 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":"pkg/store/copr/coprocessor.go"},"region":{"startLine":2339}}}],"partialFingerprints":{"codehealthFindingId/v1":"80d8e8e61214d5043e10827d55a9535b2ca36fde4b096a61b83ce88e99dafecb"}},{"ruleId":"D2","level":"warning","message":{"text":"types.floatStrToIntStr (cognitive 46): types.floatStrToIntStr has cognitive complexity 46 (threshold 15). Drivers by points: if/else 35, boolean chains 8, match/switch 2, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/types/convert.go"},"region":{"startLine":456}}}],"partialFingerprints":{"codehealthFindingId/v1":"294f58fdbcf4abf167da62102d59bd6133e26828d840ab2d9e9e2b2c939f0c3d"}},{"ruleId":"D2","level":"warning","message":{"text":"MemArbitrator.handleMemRisk (cognitive 46): MemArbitrator.handleMemRisk has cognitive complexity 46 (threshold 15). Drivers by points: if/else 37, loops 7, boolean chains 2 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/util/memory/arbitrator.go"},"region":{"startLine":2790}}}],"partialFingerprints":{"codehealthFindingId/v1":"b566116b6cd2e183f631c69f0034c3f3291a3e29b6b95069adc3c6aac1bca641"}},{"ruleId":"D2","level":"warning","message":{"text":"ColumnOption.Restore (cognitive 46): ColumnOption.Restore has cognitive complexity 46 (threshold 15). Drivers by points: if/else 45, match/switch 1 (nesting depth added 22). Of this number, 40 points are the body\u0027s own statements and 6 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":"pkg/parser/ast/ddl.go"},"region":{"startLine":572}}}],"partialFingerprints":{"codehealthFindingId/v1":"c2efc87b9f61f44a87c1743c70996e5c6e6c9f4c99b82ebb88edb26abb7da89a"}},{"ruleId":"D2","level":"warning","message":{"text":"MetaDataClient.waitCheckpointEvent (cognitive 45): MetaDataClient.waitCheckpointEvent has cognitive complexity 45 (threshold 15). Drivers by points: if/else 38, loops 5, match/switch 2 (nesting depth added 28). Of this number, 43 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":"br/pkg/streamhelper/advancer_cliext.go"},"region":{"startLine":413}}}],"partialFingerprints":{"codehealthFindingId/v1":"476c14fe79ee4a6c2dc034319ef0ec3c359d3bc422c586cf3d535c8c07c31dd2"}},{"ruleId":"D2","level":"warning","message":{"text":"task.RunBackupEBS (cognitive 45): task.RunBackupEBS has cognitive complexity 45 (threshold 15). Drivers by points: if/else 39, match/switch 3, loops 2, boolean chains 1 (nesting depth added 13). Of this number, 40 points are the body\u0027s own statements and 5 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":"br/pkg/task/backup_ebs.go"},"region":{"startLine":77}}}],"partialFingerprints":{"codehealthFindingId/v1":"4ca6ad695a3d92f4f69b6a2d98e4367b34fc38dec8c8bf434b5ad044646e807a"}},{"ruleId":"D2","level":"warning","message":{"text":"task.RunStreamRestore (cognitive 45): task.RunStreamRestore has cognitive complexity 45 (threshold 15). Drivers by points: if/else 42, boolean chains 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":"br/pkg/task/stream.go"},"region":{"startLine":1370}}}],"partialFingerprints":{"codehealthFindingId/v1":"d4c6a530aabab14d717182c7f726fffc93fa1d9f4aae49616a6d3bfab0300e65"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.CreateNewColumn (cognitive 45): ddl.CreateNewColumn has cognitive complexity 45 (threshold 15). Drivers by points: if/else 37, loops 4, match/switch 4 (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":"pkg/ddl/add_column.go"},"region":{"startLine":213}}}],"partialFingerprints":{"codehealthFindingId/v1":"2d12782a88ec47d6e7ec7a712b6e2a19aba2c4915b8faadc51583a9fb6a9b0ef"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.generatePartitionDefinitionsFromInterval (cognitive 45): ddl.generatePartitionDefinitionsFromInterval has cognitive complexity 45 (threshold 15). Drivers by points: if/else 39, boolean chains 3, match/switch 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":"pkg/ddl/partition.go"},"region":{"startLine":1083}}}],"partialFingerprints":{"codehealthFindingId/v1":"a38921fbaddb8ab9d881e9b96e6fb9ababab87d2af1cd739a86c80ba38d63c18"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.checkExchangePartitionRecordValidation (cognitive 45): ddl.checkExchangePartitionRecordValidation has cognitive complexity 45 (threshold 15). Drivers by points: if/else 42, boolean chains 1, loops 1, match/switch 1 (nesting depth added 17). Of this number, 39 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":"pkg/ddl/partition.go"},"region":{"startLine":4305}}}],"partialFingerprints":{"codehealthFindingId/v1":"3ebd31990f5e76689da740c280baef0145663671829f10cdd379d09c97d5ed15"}},{"ruleId":"D2","level":"warning","message":{"text":"worker.onFlashbackCluster (cognitive 45): worker.onFlashbackCluster has cognitive complexity 45 (threshold 15). Drivers by points: if/else 37, loops 6, boolean chains 1, match/switch 1 (nesting depth added 21). Of this number, 44 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":"pkg/ddl/cluster.go"},"region":{"startLine":670}}}],"partialFingerprints":{"codehealthFindingId/v1":"c22560945ca437934547d7f3188358e09e84a5fde7af93e78ae7a003f5ec9b0e"}},{"ruleId":"D2","level":"warning","message":{"text":"worker.onTruncateTablePartition (cognitive 45): worker.onTruncateTablePartition has cognitive complexity 45 (threshold 15). Drivers by points: if/else 41, loops 2, boolean chains 1, match/switch 1 (nesting depth added 19). Of this number, 38 points are the body\u0027s own statements and 7 belong to 4 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":"pkg/ddl/partition.go"},"region":{"startLine":2568}}}],"partialFingerprints":{"codehealthFindingId/v1":"42bedb76db791b3b4d332b91d30fb11ae2617692cd933ff66c6a046227e484f3"}},{"ruleId":"D2","level":"warning","message":{"text":"parquetfile.NewParser (cognitive 45): parquetfile.NewParser has cognitive complexity 45 (threshold 15). Drivers by points: if/else 33, match/switch 10, boolean chains 1, loops 1 (nesting depth added 23). Of this number, 44 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":"pkg/dumpformat/parquetfile/parser.go"},"region":{"startLine":639}}}],"partialFingerprints":{"codehealthFindingId/v1":"2a0d06eb5a1acfeaf9a3df52e00b93ce6b6f2e1693a8e1e70d083f0e075b1855"}},{"ruleId":"D2","level":"warning","message":{"text":"cteProducer.computeRecursivePart (cognitive 45): cteProducer.computeRecursivePart has cognitive complexity 45 (threshold 15). Drivers by points: if/else 40, boolean chains 4, loops 1 (nesting depth added 23). Of this number, 34 points are the body\u0027s own statements and 11 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":"pkg/executor/cte.go"},"region":{"startLine":427}}}],"partialFingerprints":{"codehealthFindingId/v1":"155040cbfc6d264d24110a2d6217cffb611b3eb12d0ed779ba5581f1c9b73a22"}},{"ruleId":"D2","level":"warning","message":{"text":"core.buildRangeForTableScan (cognitive 45): core.buildRangeForTableScan has cognitive complexity 45 (threshold 15). Drivers by points: if/else 42, loops 2, boolean chains 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/plan_cache_rebuild.go"},"region":{"startLine":183}}}],"partialFingerprints":{"codehealthFindingId/v1":"04f5e17a8cde682e82095290b90f530f101d17e380554e1d9c6603a1932f1b08"}},{"ruleId":"D2","level":"warning","message":{"text":"core.checkTblIndexForPointPlan (cognitive 45): core.checkTblIndexForPointPlan has cognitive complexity 45 (threshold 15). Drivers by points: if/else 35, boolean chains 9, 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":"pkg/planner/core/point_get_plan.go"},"region":{"startLine":600}}}],"partialFingerprints":{"codehealthFindingId/v1":"a806afd76c3a650c03913d9ecf881bf0636a111fdb82b0c1ad27906e3a8b2f2b"}},{"ruleId":"D2","level":"warning","message":{"text":"storage.columnStatsFromStorage (cognitive 45): storage.columnStatsFromStorage has cognitive complexity 45 (threshold 15). Drivers by points: if/else 35, boolean chains 9, 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":"pkg/statistics/handle/storage/read.go"},"region":{"startLine":336}}}],"partialFingerprints":{"codehealthFindingId/v1":"388346285d70802830b529fbcacd523d5b570482831de15cb83be6c8f4a165be"}},{"ruleId":"D2","level":"warning","message":{"text":"ranger.convertPointInPlace (cognitive 45): ranger.convertPointInPlace has cognitive complexity 45 (threshold 15). Drivers by points: if/else 38, boolean chains 6, 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":"pkg/util/ranger/ranger.go"},"region":{"startLine":177}}}],"partialFingerprints":{"codehealthFindingId/v1":"5c3c884732810a0497c5981db91bce34431fee2d807d2e47ba0c81ad652f57e0"}},{"ruleId":"D2","level":"warning","message":{"text":"backup.BuildBackupSchemas (cognitive 44): backup.BuildBackupSchemas has cognitive complexity 44 (threshold 15). Drivers by points: if/else 37, loops 3, boolean chains 2, match/switch 2 (nesting depth added 23). Most of this is not in the body itself: 11 of the 44 points are its own statements and the rest belongs to one function literal inside it that branches (line 875). 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":"br/pkg/backup/client.go"},"region":{"startLine":847}}}],"partialFingerprints":{"codehealthFindingId/v1":"7776bd1bfd12f54ab93c6bb77268bc602d9ec7b4b2d476ac8586081b3ee995ed"}},{"ruleId":"D2","level":"warning","message":{"text":"LogFileManager.ReadFilteredEntriesFromFiles (cognitive 44): LogFileManager.ReadFilteredEntriesFromFiles has cognitive complexity 44 (threshold 15). Drivers by points: if/else 39, boolean chains 3, loops 2 (nesting depth added 19). Of this number, 42 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":"br/pkg/restore/log_client/log_file_manager.go"},"region":{"startLine":480}}}],"partialFingerprints":{"codehealthFindingId/v1":"0e44c5129d5672a9fecab1de724d6a077d3613cc44423930e53587f20dee2a65"}},{"ruleId":"D2","level":"warning","message":{"text":"Config.ParseFromFlags (cognitive 44): Config.ParseFromFlags has cognitive complexity 44 (threshold 15). Drivers by points: if/else 43, boolean chains 1 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"br/pkg/task/common.go"},"region":{"startLine":648}}}],"partialFingerprints":{"codehealthFindingId/v1":"ab508077f8c5348de0ade16b4e593c501a6376d0b310f5567f9bca4183cd0dfe"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.SendFlashbackToVersionRPC (cognitive 44): ddl.SendFlashbackToVersionRPC has cognitive complexity 44 (threshold 15). Drivers by points: if/else 38, boolean chains 3, match/switch 2, loops 1 (nesting depth added 25). 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/ddl/cluster.go"},"region":{"startLine":548}}}],"partialFingerprints":{"codehealthFindingId/v1":"b8ecb05b1ac503e0c358f8d5a10c846a78becd92fd4b94c33ff37408a430ae81"}},{"ruleId":"D2","level":"warning","message":{"text":"Executor.parseCalibrateDuration (cognitive 44): Executor.parseCalibrateDuration has cognitive complexity 44 (threshold 15). Drivers by points: if/else 40, loops 2, match/switch 2 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/internal/calibrateresource/calibrate_resource.go"},"region":{"startLine":148}}}],"partialFingerprints":{"codehealthFindingId/v1":"38e52c34480e09995501263923c12468c9965ccb6e2c394c98d48eefe6017ad5"}},{"ruleId":"D2","level":"warning","message":{"text":"aggregation.ExplainAggFunc (cognitive 44): aggregation.ExplainAggFunc has cognitive complexity 44 (threshold 15). Drivers by points: if/else 38, loops 5, boolean chains 1 (nesting depth added 25). Of this number, 43 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":"pkg/expression/aggregation/explain.go"},"region":{"startLine":27}}}],"partialFingerprints":{"codehealthFindingId/v1":"080f90e381e5f45e86b614da3647cfc1ba950be3ac99745975a9ca5e010021dc"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinRegexpReplaceFuncSig.evalString (cognitive 44): builtinRegexpReplaceFuncSig.evalString has cognitive complexity 44 (threshold 15). Drivers by points: if/else 36, boolean chains 8 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/builtin_regexp.go"},"region":{"startLine":1174}}}],"partialFingerprints":{"codehealthFindingId/v1":"cad02f6f775853f4deccbafdb7381ae9b90c33035ddde7d8a39a650cef7627e8"}},{"ruleId":"D2","level":"warning","message":{"text":"mdLoaderSetup.setup (cognitive 44): mdLoaderSetup.setup has cognitive complexity 44 (threshold 15). Drivers by points: if/else 27, loops 11, boolean chains 4, match/switch 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/lightning/mydump/loader.go"},"region":{"startLine":452}}}],"partialFingerprints":{"codehealthFindingId/v1":"0480e9a53aa1b1cb5d63eaafc97ee8a85829b6b8c81ed4f0cd779aa9696558e2"}},{"ruleId":"D2","level":"warning","message":{"text":"ChunkParser.ReadRow (cognitive 44): ChunkParser.ReadRow has cognitive complexity 44 (threshold 15). Drivers by points: if/else 28, match/switch 14, boolean chains 1, loops 1 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/lightning/mydump/parser.go"},"region":{"startLine":389}}}],"partialFingerprints":{"codehealthFindingId/v1":"159c2b9f6eeeb93e524825944e6920911a2d02f2dce8cee65584ee7bb045820c"}},{"ruleId":"D2","level":"warning","message":{"text":"cardinality.GetSelectivityByFilter (cognitive 44): cardinality.GetSelectivityByFilter has cognitive complexity 44 (threshold 15). Drivers by points: if/else 34, loops 7, boolean chains 3 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/cardinality/selectivity.go"},"region":{"startLine":902}}}],"partialFingerprints":{"codehealthFindingId/v1":"7794983dcf9c695ef09a3fe3789c5e7bbcf3d9c74747c11be8498a33002682e6"}},{"ruleId":"D2","level":"warning","message":{"text":"core.convertToIndexMergeScan (cognitive 44): core.convertToIndexMergeScan has cognitive complexity 44 (threshold 15). Drivers by points: if/else 35, boolean chains 7, loops 2 (nesting depth added 12). Of this number, 40 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":"pkg/planner/core/find_best_task.go"},"region":{"startLine":2316}}}],"partialFingerprints":{"codehealthFindingId/v1":"290bdeae187af1c05733528b89b43781b9414e67e5fd7e4ae4278ad4045a55e7"}},{"ruleId":"D2","level":"warning","message":{"text":"expressionRewriter.handleCompareSubquery (cognitive 44): expressionRewriter.handleCompareSubquery has cognitive complexity 44 (threshold 15). Drivers by points: if/else 31, boolean chains 10, loops 2, match/switch 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/expression_rewriter.go"},"region":{"startLine":822}}}],"partialFingerprints":{"codehealthFindingId/v1":"3e09f15740e5fa395146c07695479964151881e2dba5096030690c97c0945513"}},{"ruleId":"D2","level":"warning","message":{"text":"FullTextIndexResolverRejectRemaining.visit (cognitive 44): FullTextIndexResolverRejectRemaining.visit has cognitive complexity 44 (threshold 15). Drivers by points: if/else 31, loops 11, boolean chains 1, match/switch 1 (nesting depth added 25). 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/planner/core/fts_resolve_index.go"},"region":{"startLine":375}}}],"partialFingerprints":{"codehealthFindingId/v1":"f30a7421840dc563cbfcb597aa4ad2e62585231ab73266be9e7c68cf6b11b03f"}},{"ruleId":"D2","level":"warning","message":{"text":"rule.scoreIndexPath (cognitive 44): rule.scoreIndexPath has cognitive complexity 44 (threshold 15). Drivers by points: if/else 34, loops 6, boolean chains 4 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/rule/rule_prune_indexes.go"},"region":{"startLine":459}}}],"partialFingerprints":{"codehealthFindingId/v1":"54dc40a1a6ec58c3ffffc220db784baaab4fbd38358f1ccecc0a8508766e4c0f"}},{"ruleId":"D2","level":"warning","message":{"text":"AccessPath.SplitCorColAccessCondFromFilters (cognitive 44): AccessPath.SplitCorColAccessCondFromFilters has cognitive complexity 44 (threshold 15). Drivers by points: if/else 30, loops 12, 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":"pkg/planner/util/path.go"},"region":{"startLine":250}}}],"partialFingerprints":{"codehealthFindingId/v1":"ee3757761e4f10c17db4a9027202f94eb8f449448600048aa00a3dbb9e420b97"}},{"ruleId":"D2","level":"warning","message":{"text":"session.retry (cognitive 44): session.retry has cognitive complexity 44 (threshold 15). Drivers by points: if/else 41, loops 3 (nesting depth added 24). Of this number, 35 points are the body\u0027s own statements and 9 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":"pkg/session/session.go"},"region":{"startLine":1164}}}],"partialFingerprints":{"codehealthFindingId/v1":"6ab6babd09fbbb3a411a180d98ddbfed0dd8f5eb5a6301e5b0f8b33b926343dd"}},{"ruleId":"D2","level":"warning","message":{"text":"AnalysisPriorityQueue.fetchAllTablesAndBuildAnalysisJobs (cognitive 44): AnalysisPriorityQueue.fetchAllTablesAndBuildAnalysisJobs has cognitive complexity 44 (threshold 15). Drivers by points: if/else 36, loops 7, boolean chains 1 (nesting depth added 22). Most of this is not in the body itself: 0 of the 44 points are its own statements and the rest belongs to one function literal inside it that branches (line 529). 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":"pkg/statistics/handle/autoanalyze/priorityqueue/queue.go"},"region":{"startLine":528}}}],"partialFingerprints":{"codehealthFindingId/v1":"7326651754922932f98536293177d451d2056cc820d5667c81bd42ab4a576f37"}},{"ruleId":"D2","level":"warning","message":{"text":"indentFormatter.format (cognitive 44): indentFormatter.format has cognitive complexity 44 (threshold 15). Drivers by points: if/else 16, match/switch 15, loops 11, boolean chains 2 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/util/format/format.go"},"region":{"startLine":86}}}],"partialFingerprints":{"codehealthFindingId/v1":"a9fbca8d9c4864fb748c8f5a2f64b11b787d775228d5b252f5017fec17f641ff"}},{"ruleId":"D2","level":"warning","message":{"text":"resourcegrouptag.GetFirstKeyFromRequest (cognitive 44): resourcegrouptag.GetFirstKeyFromRequest has cognitive complexity 44 (threshold 15). Drivers by points: if/else 37, boolean chains 6, match/switch 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":"pkg/util/resourcegrouptag/resource_group_tag.go"},"region":{"startLine":52}}}],"partialFingerprints":{"codehealthFindingId/v1":"2af07037c75ec6d7adbe60692b183e8c5cb48dd6f0f8a4c6339c71a87481a165"}},{"ruleId":"D2","level":"warning","message":{"text":"IndexOption.Restore (cognitive 44): IndexOption.Restore has cognitive complexity 44 (threshold 15). Drivers by points: if/else 41, match/switch 2, boolean chains 1 (nesting depth added 16). Of this number, 37 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/parser/ast/ddl.go"},"region":{"startLine":781}}}],"partialFingerprints":{"codehealthFindingId/v1":"523c22dbc1d61146b3ab364604a91034f81b8910d358cc05bd5ba3091b0e8cf3"}},{"ruleId":"D2","level":"warning","message":{"text":"indentFormatter.format (cognitive 44): indentFormatter.format has cognitive complexity 44 (threshold 15). Drivers by points: if/else 16, match/switch 15, loops 11, boolean chains 2 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/parser/format/format.go"},"region":{"startLine":86}}}],"partialFingerprints":{"codehealthFindingId/v1":"d4245452b1e3258807bb21b06ee77c4b32801e2220618b2f21f26854e55f216f"}},{"ruleId":"D2","level":"warning","message":{"text":"snapclient.CheckSysTableCompatibility (cognitive 43): snapclient.CheckSysTableCompatibility has cognitive complexity 43 (threshold 15). Drivers by points: if/else 25, loops 12, boolean chains 6 (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":"br/pkg/restore/snap_client/systable_restore.go"},"region":{"startLine":596}}}],"partialFingerprints":{"codehealthFindingId/v1":"038721f589ccb01150a60b9e1647af55d3c0a5df90b5f3ec922dc15df77bcf9d"}},{"ruleId":"D2","level":"warning","message":{"text":"export.WriteInsert (cognitive 43): export.WriteInsert has cognitive complexity 43 (threshold 15). Drivers by points: if/else 33, loops 4, match/switch 4, boolean chains 2 (nesting depth added 20). Of this number, 41 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":"dumpling/export/writer_util.go"},"region":{"startLine":150}}}],"partialFingerprints":{"codehealthFindingId/v1":"add690b58f4532c3f5844f0eb18d2491707b48bb2750bb4893ed56c32d4d6a1b"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.getNextPartitionInfo (cognitive 43): ddl.getNextPartitionInfo has cognitive complexity 43 (threshold 15). Drivers by points: if/else 38, loops 4, boolean chains 1 (nesting depth added 21). Of this number, 42 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":"pkg/ddl/index.go"},"region":{"startLine":3554}}}],"partialFingerprints":{"codehealthFindingId/v1":"ebe0726e140dcee1693398d0cca4e80b42e43b75380caf1631d99be9d57279a5"}},{"ruleId":"D2","level":"warning","message":{"text":"DDLNotifier.processEvents (cognitive 43): DDLNotifier.processEvents has cognitive complexity 43 (threshold 15). Drivers by points: if/else 37, loops 6 (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":"pkg/ddl/notifier/subscribe.go"},"region":{"startLine":185}}}],"partialFingerprints":{"codehealthFindingId/v1":"033b47534376e33f32b214d2695aa9f2eddc65c07eafeaac135c928cd4101b9d"}},{"ruleId":"D2","level":"warning","message":{"text":"AnalyzeExec.Next (cognitive 43): AnalyzeExec.Next has cognitive complexity 43 (threshold 15). Drivers by points: if/else 24, loops 14, jumps 2, match/switch 2, boolean chains 1 (nesting depth added 11). Of this number, 34 points are the body\u0027s own statements and 9 belong to 4 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":"pkg/executor/analyze.go"},"region":{"startLine":300}}}],"partialFingerprints":{"codehealthFindingId/v1":"b7620937e187350051e047c28dea921adbd8586336952c1f98b34733c57c62eb"}},{"ruleId":"D2","level":"warning","message":{"text":"memoryDebugModeHandler.run (cognitive 43): memoryDebugModeHandler.run has cognitive complexity 43 (threshold 15). Drivers by points: if/else 33, loops 6, boolean chains 2, match/switch 2 (nesting depth added 27). Of this number, 39 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":"pkg/executor/explain.go"},"region":{"startLine":255}}}],"partialFingerprints":{"codehealthFindingId/v1":"31751d5b0d996a7e75e196273325f5242dc1f44e8123ed892cd0bbdb7ac91be7"}},{"ruleId":"D2","level":"warning","message":{"text":"MetricsSummaryByLabelRetriever.retrieve (cognitive 43): MetricsSummaryByLabelRetriever.retrieve has cognitive complexity 43 (threshold 15). Drivers by points: if/else 29, loops 11, boolean chains 3 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/metrics_reader.go"},"region":{"startLine":273}}}],"partialFingerprints":{"codehealthFindingId/v1":"5cccaab9767f2006d2dac16ef05c6de650912d1408caf31cb24c242732cd7803"}},{"ruleId":"D2","level":"warning","message":{"text":"ShowExec.fetchShowAffinity (cognitive 43): ShowExec.fetchShowAffinity has cognitive complexity 43 (threshold 15). Drivers by points: if/else 21, loops 13, match/switch 6, boolean chains 3 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/show_affinity.go"},"region":{"startLine":31}}}],"partialFingerprints":{"codehealthFindingId/v1":"8582dec62bd337acaa0d6ed3383ab3b2b385f5de2e2007c3a31861816b395885"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinInIntSig.evalInt (cognitive 43): builtinInIntSig.evalInt has cognitive complexity 43 (threshold 15). Drivers by points: if/else 31, boolean chains 9, loops 3 (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":"pkg/expression/builtin_other.go"},"region":{"startLine":274}}}],"partialFingerprints":{"codehealthFindingId/v1":"aa27b379a55bf7784f3a9c15cd0162a2bb877b4d14955759c14ee72dca049260"}},{"ruleId":"D2","level":"warning","message":{"text":"core.hasNormalPreferTask (cognitive 43): core.hasNormalPreferTask has cognitive complexity 43 (threshold 15). Drivers by points: if/else 43 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/exhaust_physical_plans.go"},"region":{"startLine":1556}}}],"partialFingerprints":{"codehealthFindingId/v1":"b7f9199249d369e1865ad7c19f0e5ae87a22fac4364fb4596347aa59422c4d49"}},{"ruleId":"D2","level":"warning","message":{"text":"clientConn.checkAuthPlugin (cognitive 43): clientConn.checkAuthPlugin has cognitive complexity 43 (threshold 15). Drivers by points: if/else 41, boolean chains 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/server/conn.go"},"region":{"startLine":939}}}],"partialFingerprints":{"codehealthFindingId/v1":"6bb50a81c7e609c21531ac17505f294875f70b393bc20ead3daaf00569e9be3c"}},{"ruleId":"D2","level":"warning","message":{"text":"clientConn.handleQuery (cognitive 43): clientConn.handleQuery has cognitive complexity 43 (threshold 15). Drivers by points: if/else 34, loops 4, match/switch 3, boolean chains 2 (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":"pkg/server/conn.go"},"region":{"startLine":1857}}}],"partialFingerprints":{"codehealthFindingId/v1":"d5a22eb365889a738ef37969d93372f309cdf4fd7ab59fec8920ff009d641a37"}},{"ruleId":"D2","level":"warning","message":{"text":"session.upgradeToVer282 (cognitive 43): session.upgradeToVer282 has cognitive complexity 43 (threshold 15). Drivers by points: if/else 35, loops 6, boolean chains 2 (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":"pkg/session/upgrade_def.go"},"region":{"startLine":2169}}}],"partialFingerprints":{"codehealthFindingId/v1":"e2c4a5a6302fc91f1b1cfde3d5c728fb5abad93e344a51a285ef5debb79cc56f"}},{"ruleId":"D2","level":"warning","message":{"text":"SampleBuilder.CollectColumnStats (cognitive 43): SampleBuilder.CollectColumnStats has cognitive complexity 43 (threshold 15). Drivers by points: if/else 32, loops 9, boolean chains 2 (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":"pkg/statistics/sample.go"},"region":{"startLine":221}}}],"partialFingerprints":{"codehealthFindingId/v1":"72ba318635db76872f0e0ef4849a93cffb9520c209fcd54706753e6384dcc260"}},{"ruleId":"D2","level":"warning","message":{"text":"tables.DecodeRawRowData (cognitive 43): tables.DecodeRawRowData has cognitive complexity 43 (threshold 15). Drivers by points: if/else 38, boolean chains 3, loops 2 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/table/tables/tables.go"},"region":{"startLine":1083}}}],"partialFingerprints":{"codehealthFindingId/v1":"77bd7178546ba304c62e5cdd11aabbf054450a8c1e5b82af4a37e7d18a75d515"}},{"ruleId":"D2","level":"warning","message":{"text":"JobManager.triggerTTLJob (cognitive 43): JobManager.triggerTTLJob has cognitive complexity 43 (threshold 15). Drivers by points: if/else 29, loops 8, boolean chains 2, jumps 2, match/switch 2 (nesting depth added 15). Most of this is not in the body itself: 15 of the 43 points are its own statements and the rest belongs to one function literal inside it that branches (line 429). 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":"pkg/ttl/ttlworker/job_manager.go"},"region":{"startLine":352}}}],"partialFingerprints":{"codehealthFindingId/v1":"bbfe906768dab06305876c5711cd501cfa0d87948e7d1528a3fa0af19580717c"}},{"ruleId":"D2","level":"warning","message":{"text":"MyDecimal.Shift (cognitive 43): MyDecimal.Shift has cognitive complexity 43 (threshold 15). Drivers by points: if/else 25, loops 16, boolean chains 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/types/mydecimal.go"},"region":{"startLine":555}}}],"partialFingerprints":{"codehealthFindingId/v1":"d379b0036ca2a3b56ae4af4aac41117fd9458c7359eb603880ec98eb63af1714"}},{"ruleId":"D2","level":"warning","message":{"text":"SelectStmt.Accept (cognitive 43): SelectStmt.Accept has cognitive complexity 43 (threshold 15). Drivers by points: if/else 37, loops 6 (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":"pkg/parser/ast/dml.go"},"region":{"startLine":1564}}}],"partialFingerprints":{"codehealthFindingId/v1":"ea14e2f57cc4096dcceb0bef16b05e4b75e957eb311804e10b1aac7672b8e4d0"}},{"ruleId":"D2","level":"warning","message":{"text":"Dumper.Dump (cognitive 42): Dumper.Dump has cognitive complexity 42 (threshold 15). Drivers by points: if/else 39, boolean chains 3 (nesting depth added 9). Of this number, 32 points are the body\u0027s own statements and 10 belong to 5 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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":"dumpling/export/dump.go"},"region":{"startLine":150}}}],"partialFingerprints":{"codehealthFindingId/v1":"9ab161aecf67f8c10c2529f45cdadbcb86aec4f67867324d8df176b3e5a21fef"}},{"ruleId":"D2","level":"warning","message":{"text":"Config.Load (cognitive 42): Config.Load has cognitive complexity 42 (threshold 15). Drivers by points: if/else 25, boolean chains 12, loops 5 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/config/config.go"},"region":{"startLine":1599}}}],"partialFingerprints":{"codehealthFindingId/v1":"3f5c743e20a2da2fb765187456c4485781f1c8beed6152506b41646c22ebc598"}},{"ruleId":"D2","level":"warning","message":{"text":"worker.executeDistTask (cognitive 42): worker.executeDistTask has cognitive complexity 42 (threshold 15). Drivers by points: if/else 37, boolean chains 2, match/switch 2, loops 1 (nesting depth added 18). Of this number, 17 points are the body\u0027s own statements and 25 belong to 4 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":"pkg/ddl/index.go"},"region":{"startLine":3153}}}],"partialFingerprints":{"codehealthFindingId/v1":"c65f2a9677986c1917b678cdcb357224248e25f92cf1667355c8eb008cca770c"}},{"ruleId":"D2","level":"warning","message":{"text":"placement.NewBundleFromConstraintsOptions (cognitive 42): placement.NewBundleFromConstraintsOptions has cognitive complexity 42 (threshold 15). Drivers by points: if/else 30, loops 10, boolean chains 2 (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":"pkg/ddl/placement/bundle.go"},"region":{"startLine":49}}}],"partialFingerprints":{"codehealthFindingId/v1":"884f19e73f57b9c79fe369793d6af2cd4f09d38937db4d796f64693473086441"}},{"ruleId":"D2","level":"warning","message":{"text":"DDLExec.Next (cognitive 42): DDLExec.Next has cognitive complexity 42 (threshold 15). Drivers by points: if/else 32, loops 5, boolean chains 3, match/switch 2 (nesting depth added 18). 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/executor/ddl.go"},"region":{"startLine":96}}}],"partialFingerprints":{"codehealthFindingId/v1":"ae8ae53436981e920d963ca1a3551d7d1244f9ffb99e1dcf75284ac6fba5e1a1"}},{"ruleId":"D2","level":"warning","message":{"text":"querywatch.setWatchOption (cognitive 42): querywatch.setWatchOption has cognitive complexity 42 (threshold 15). Drivers by points: if/else 38, match/switch 4 (nesting depth added 25). 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":"pkg/executor/internal/querywatch/query_watch.go"},"region":{"startLine":38}}}],"partialFingerprints":{"codehealthFindingId/v1":"1991d651f800c65bd3ab3bb9bf2d64a0f458c56715adf8738f512597c9d62cc9"}},{"ruleId":"D2","level":"warning","message":{"text":"join.setupJoinKeys (cognitive 42): join.setupJoinKeys has cognitive complexity 42 (threshold 15). Drivers by points: if/else 37, loops 4, boolean chains 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/executor/join/join_table_meta.go"},"region":{"startLine":260}}}],"partialFingerprints":{"codehealthFindingId/v1":"405473761bb2d787ee02cb3ee268d3e434e8893fd9774ee8626c5de9aa402e4d"}},{"ruleId":"D2","level":"warning","message":{"text":"ShowExec.fetchShowStatsBuckets (cognitive 42): ShowExec.fetchShowStatsBuckets has cognitive complexity 42 (threshold 15). Drivers by points: if/else 29, loops 12, boolean chains 1 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/show_stats.go"},"region":{"startLine":285}}}],"partialFingerprints":{"codehealthFindingId/v1":"0fe40a8a260c68663c8251fb9a7ef67829dd035eef8f09fabb811824b3cce1a0"}},{"ruleId":"D2","level":"warning","message":{"text":"ShowExec.fetchShowStatsTopN (cognitive 42): ShowExec.fetchShowStatsTopN has cognitive complexity 42 (threshold 15). Drivers by points: if/else 29, loops 12, boolean chains 1 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/show_stats.go"},"region":{"startLine":348}}}],"partialFingerprints":{"codehealthFindingId/v1":"5d5c7e77d63820e36574ce744263185baeac34daf7453a64eedcd018d1c232a4"}},{"ruleId":"D2","level":"warning","message":{"text":"SimpleExec.executeRenameUser (cognitive 42): SimpleExec.executeRenameUser has cognitive complexity 42 (threshold 15). Drivers by points: if/else 40, loops 2 (nesting depth added 18). 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/executor/simple.go"},"region":{"startLine":2372}}}],"partialFingerprints":{"codehealthFindingId/v1":"a2f341bba34dfe90914708d93478ca9d30f3c934f4a6e83a77b3baa96375e489"}},{"ruleId":"D2","level":"warning","message":{"text":"SimpleExec.executeRefreshStatsOnCurrentInstance (cognitive 42): SimpleExec.executeRefreshStatsOnCurrentInstance has cognitive complexity 42 (threshold 15). Drivers by points: if/else 32, loops 6, match/switch 3, boolean chains 1 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/simple.go"},"region":{"startLine":3234}}}],"partialFingerprints":{"codehealthFindingId/v1":"c1cc82e2f75034aa1fbde7ae57645b62b60d507fb2e38992009f3d9004bc4b3a"}},{"ruleId":"D2","level":"warning","message":{"text":"expression.extractEquivalenceColumns (cognitive 42): expression.extractEquivalenceColumns has cognitive complexity 42 (threshold 15). Drivers by points: if/else 34, boolean chains 7, match/switch 1 (nesting depth added 24). 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":"pkg/expression/util.go"},"region":{"startLine":337}}}],"partialFingerprints":{"codehealthFindingId/v1":"7622bb65bed8a09f6bb56ce79ac1cc38904e1c607496aba87ef50e23b796f165"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinBenchmarkSig.evalInt (cognitive 42): builtinBenchmarkSig.evalInt has cognitive complexity 42 (threshold 15). Drivers by points: if/else 26, loops 14, boolean chains 1, match/switch 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":"pkg/expression/builtin_info.go"},"region":{"startLine":682}}}],"partialFingerprints":{"codehealthFindingId/v1":"98b8453bd86db01a02ae8197641652a3e6ab7a071220a206cf229bdbcb4a7613"}},{"ruleId":"D2","level":"warning","message":{"text":"core.NonPreparedPlanCacheableWithCtx (cognitive 42): core.NonPreparedPlanCacheableWithCtx has cognitive complexity 42 (threshold 15). Drivers by points: if/else 39, boolean chains 2, match/switch 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/plan_cacheable_checker.go"},"region":{"startLine":235}}}],"partialFingerprints":{"codehealthFindingId/v1":"b7bb8f75a8784f074328e858cdf101cde3218770f511ecf98501e1090e9d859f"}},{"ruleId":"D2","level":"warning","message":{"text":"tidbCodecFuncHelper.decodeRecordKey (cognitive 42): tidbCodecFuncHelper.decodeRecordKey has cognitive complexity 42 (threshold 15). Drivers by points: if/else 31, loops 9, boolean chains 2 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/expression_codec_fn.go"},"region":{"startLine":291}}}],"partialFingerprints":{"codehealthFindingId/v1":"72e5f86ac6c5e79af2e930e741e3fd7345c122c8530b6a34e8d5b93ee117f015"}},{"ruleId":"D2","level":"warning","message":{"text":"expressionRewriter.handleExistSubquery (cognitive 42): expressionRewriter.handleExistSubquery has cognitive complexity 42 (threshold 15). Drivers by points: if/else 32, boolean chains 8, loops 2 (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":"pkg/planner/core/expression_rewriter.go"},"region":{"startLine":1136}}}],"partialFingerprints":{"codehealthFindingId/v1":"799e31e24fd72337746daad80c6772e9a338f021a89bdade80e26448d367e539"}},{"ruleId":"D2","level":"warning","message":{"text":"joinOrderDP.optimizeWithDetector (cognitive 42): joinOrderDP.optimizeWithDetector has cognitive complexity 42 (threshold 15). Drivers by points: if/else 33, boolean chains 5, loops 4 (nesting depth added 18). 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/planner/core/joinorder/join_order.go"},"region":{"startLine":383}}}],"partialFingerprints":{"codehealthFindingId/v1":"c52e61cb983173d3d85fe7fefafc228d5b857148287d87e76d155913077f7750"}},{"ruleId":"D2","level":"warning","message":{"text":"physicalop.BuildIndexMergeTableScan (cognitive 42): physicalop.BuildIndexMergeTableScan has cognitive complexity 42 (threshold 15). Drivers by points: if/else 36, boolean chains 4, loops 2 (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":"pkg/planner/core/operator/physicalop/physical_table_scan.go"},"region":{"startLine":865}}}],"partialFingerprints":{"codehealthFindingId/v1":"708865ece5ff723026b9b62d90c0118d567346c262c1b01b26e74da808e68ae5"}},{"ruleId":"D2","level":"warning","message":{"text":"PointGetPlan.PrunePartitions (cognitive 42): PointGetPlan.PrunePartitions has cognitive complexity 42 (threshold 15). Drivers by points: if/else 28, boolean chains 8, loops 6 (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":"pkg/planner/core/operator/physicalop/physical_batch_point_get.go"},"region":{"startLine":351}}}],"partialFingerprints":{"codehealthFindingId/v1":"8b489c042dfd9a90eebc24228c7884bd33a28949a7d016208494d8cc336325f2"}},{"ruleId":"D2","level":"warning","message":{"text":"PlanBuilder.checkOnlyFullGroupByWithGroupClause (cognitive 42): PlanBuilder.checkOnlyFullGroupByWithGroupClause has cognitive complexity 42 (threshold 15). Drivers by points: if/else 35, loops 5, match/switch 2 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/logical_plan_builder.go"},"region":{"startLine":3787}}}],"partialFingerprints":{"codehealthFindingId/v1":"82e61c4d470b752eafc15a335586faddaa8be29052aa3cb67bcc3cf348e0d5b1"}},{"ruleId":"D2","level":"warning","message":{"text":"clientConn.writeChunks (cognitive 42): clientConn.writeChunks has cognitive complexity 42 (threshold 15). Drivers by points: if/else 36, loops 3, match/switch 2, boolean chains 1 (nesting depth added 22). Of this number, 30 points are the body\u0027s own statements and 12 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":"pkg/server/conn.go"},"region":{"startLine":2531}}}],"partialFingerprints":{"codehealthFindingId/v1":"c7e93dfa52d48fcc42bd371060cd13ccfd90fae67560a338f8e41ea5b6f4eac1"}},{"ruleId":"D2","level":"warning","message":{"text":"RegionCache.SplitKeyRangesByBuckets (cognitive 42): RegionCache.SplitKeyRangesByBuckets has cognitive complexity 42 (threshold 15). Drivers by points: if/else 31, loops 6, boolean chains 5 (nesting depth added 16). Of this number, 33 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":"pkg/store/copr/region_cache.go"},"region":{"startLine":779}}}],"partialFingerprints":{"codehealthFindingId/v1":"58925492d3c59f09e8942801c11453a8d251e025bcf8986403723ec7a9f3423f"}},{"ruleId":"D2","level":"warning","message":{"text":"plancodec.printAccessObject (cognitive 42): plancodec.printAccessObject has cognitive complexity 42 (threshold 15). Drivers by points: if/else 31, loops 7, boolean chains 2, match/switch 2 (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":"pkg/util/plancodec/binary_plan_decode.go"},"region":{"startLine":317}}}],"partialFingerprints":{"codehealthFindingId/v1":"7ffc8653e00abb5359ec69c37a330d55896c6fe41966f01633f1d9eee13868a6"}},{"ruleId":"D2","level":"warning","message":{"text":"CreateTableStmt.Restore (cognitive 42): CreateTableStmt.Restore has cognitive complexity 42 (threshold 15). Drivers by points: if/else 32, loops 6, match/switch 3, boolean chains 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":"pkg/parser/ast/ddl.go"},"region":{"startLine":1211}}}],"partialFingerprints":{"codehealthFindingId/v1":"522e3ce4a880232766b503885f1b92468d87ccf1ab9ce250d3ad8a9a626e21d2"}},{"ruleId":"D2","level":"warning","message":{"text":"TableMappingManager.ReplaceTemporaryIDs (cognitive 41): TableMappingManager.ReplaceTemporaryIDs has cognitive complexity 41 (threshold 15). Drivers by points: if/else 27, loops 14 (nesting depth added 21). Of this number, 35 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":"br/pkg/stream/table_mapping.go"},"region":{"startLine":654}}}],"partialFingerprints":{"codehealthFindingId/v1":"405ec324e249b73b4d37ee7f28d3635fe7db07823d151214efc17fce626b3655"}},{"ruleId":"D2","level":"warning","message":{"text":"task.processLogBackupTableHistory (cognitive 41): task.processLogBackupTableHistory has cognitive complexity 41 (threshold 15). Drivers by points: if/else 33, boolean chains 4, loops 4 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"br/pkg/task/restore.go"},"region":{"startLine":2210}}}],"partialFingerprints":{"codehealthFindingId/v1":"45e1a918b4f17d588ec542dd434570d119bf715f18916de0222e156713f5f99a"}},{"ruleId":"D2","level":"warning","message":{"text":"MySQLCheckpointsDB.Update (cognitive 41): MySQLCheckpointsDB.Update has cognitive complexity 41 (threshold 15). Drivers by points: if/else 35, loops 6 (nesting depth added 23). Most of this is not in the body itself: 0 of the 41 points are its own statements and the rest belongs to one function literal inside it that branches (line 1057). 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":"lightning/pkg/checkpoints/checkpoints.go"},"region":{"startLine":1049}}}],"partialFingerprints":{"codehealthFindingId/v1":"6e91f7b867fe64b26e536b596582ec22512193b3d6db370ff33885b4abcaf9e8"}},{"ruleId":"D2","level":"warning","message":{"text":"bindinfo.breadthFirstPlanSearch (cognitive 41): bindinfo.breadthFirstPlanSearch has cognitive complexity 41 (threshold 15). Drivers by points: if/else 25, loops 15, boolean chains 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/bindinfo/binding_plan_generation.go"},"region":{"startLine":303}}}],"partialFingerprints":{"codehealthFindingId/v1":"e767d2704f2af29280f40599fd4d4ee14c34a871dcd3263bdd55303a06669669"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.checkReorgPartitionDefs (cognitive 41): ddl.checkReorgPartitionDefs has cognitive complexity 41 (threshold 15). Drivers by points: if/else 40, match/switch 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/executor.go"},"region":{"startLine":2687}}}],"partialFingerprints":{"codehealthFindingId/v1":"ecffbf51681ba9e6442ce3edb31eae9b174c199e59a3bec7a3c036aa00230a6d"}},{"ruleId":"D2","level":"warning","message":{"text":"worker.runOneJobStep (cognitive 41): worker.runOneJobStep has cognitive complexity 41 (threshold 15). Drivers by points: if/else 24, match/switch 10, boolean chains 4, loops 3 (nesting depth added 19). Of this number, 19 points are the body\u0027s own statements and 22 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/ddl/job_worker.go"},"region":{"startLine":837}}}],"partialFingerprints":{"codehealthFindingId/v1":"cc5d08b2bfb38e2aad244c9518e18d82d6aa33c7595bf62369d2bc096da4562c"}},{"ruleId":"D2","level":"warning","message":{"text":"worker.onDropTableOrView (cognitive 41): worker.onDropTableOrView has cognitive complexity 41 (threshold 15). Drivers by points: if/else 39, boolean chains 1, match/switch 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/table.go"},"region":{"startLine":62}}}],"partialFingerprints":{"codehealthFindingId/v1":"afa27cc8d1fec94841ca7664ab35fc2c07310c158b3ff8e2b1cb43bc4a826249"}},{"ruleId":"D2","level":"warning","message":{"text":"LoadDataController.InitDataFiles (cognitive 41): LoadDataController.InitDataFiles has cognitive complexity 41 (threshold 15). Drivers by points: if/else 37, loops 3, boolean chains 1 (nesting depth added 16). Of this number, 37 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":"pkg/executor/importer/import.go"},"region":{"startLine":1464}}}],"partialFingerprints":{"codehealthFindingId/v1":"8ac88e007fdc022fd9c95f78d7c70ce3a1f2e360517a4b662a13338a0dd5d10d"}},{"ruleId":"D2","level":"warning","message":{"text":"indexMergeProcessWorker.fetchLoopUnionWithOrderBy (cognitive 41): indexMergeProcessWorker.fetchLoopUnionWithOrderBy has cognitive complexity 41 (threshold 15). Drivers by points: if/else 24, loops 8, match/switch 7, boolean chains 2 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/index_merge_reader.go"},"region":{"startLine":1111}}}],"partialFingerprints":{"codehealthFindingId/v1":"9c28b1ee45c17b5174eae1c10b1cfcccbb5fb9489a87d6c620938f6e6a4c2498"}},{"ruleId":"D2","level":"warning","message":{"text":"ShowExec.fetchShowVariables (cognitive 41): ShowExec.fetchShowVariables has cognitive complexity 41 (threshold 15). Drivers by points: if/else 31, boolean chains 7, loops 3 (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/executor/show.go"},"region":{"startLine":942}}}],"partialFingerprints":{"codehealthFindingId/v1":"fb58bcc7259f417a56297e43c76f29c68327529d5ac53936c7f7b2145abcfd92"}},{"ruleId":"D2","level":"warning","message":{"text":"windows.Build (cognitive 41): windows.Build has cognitive complexity 41 (threshold 15). Drivers by points: if/else 33, loops 5, boolean chains 3 (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/executor/windows/builder.go"},"region":{"startLine":45}}}],"partialFingerprints":{"codehealthFindingId/v1":"f42520904cc2cf9ed4a57449563ce2195f71bed156c8fc5cd68bd7f4220cb5fc"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinArithmeticMinusIntSig.overflowCheck (cognitive 41): builtinArithmeticMinusIntSig.overflowCheck has cognitive complexity 41 (threshold 15). Drivers by points: if/else 36, boolean chains 5 (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/expression/builtin_arithmetic.go"},"region":{"startLine":491}}}],"partialFingerprints":{"codehealthFindingId/v1":"744de830d52bf11c2621aa8bbe0c3c53d120aacb8b5e6d2a80d54a5a6547297e"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinTiDBDecodeSQLDigestsSig.evalString (cognitive 41): builtinTiDBDecodeSQLDigestsSig.evalString has cognitive complexity 41 (threshold 15). Drivers by points: if/else 35, boolean chains 4, loops 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/builtin_info.go"},"region":{"startLine":1266}}}],"partialFingerprints":{"codehealthFindingId/v1":"61cd3980e197dc6facf4937b727f777d305fa5e5480e89eac815bad746a956bc"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinJSONArrayInsertSig.vecEvalJSON (cognitive 41): builtinJSONArrayInsertSig.vecEvalJSON has cognitive complexity 41 (threshold 15). Drivers by points: if/else 37, loops 4 (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":"pkg/expression/builtin_json_vec.go"},"region":{"startLine":696}}}],"partialFingerprints":{"codehealthFindingId/v1":"c92e26db8be7760c17032e0e8a4a5032f0f56f89d96765640e52bab51ca1bd04"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinRegexpSubstrFuncSig.evalString (cognitive 41): builtinRegexpSubstrFuncSig.evalString has cognitive complexity 41 (threshold 15). Drivers by points: if/else 34, boolean chains 7 (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":"pkg/expression/builtin_regexp.go"},"region":{"startLine":404}}}],"partialFingerprints":{"codehealthFindingId/v1":"16795d1d418e08070a5426c56966a1a2a45da85b5d52dd415588523f62638573"}},{"ruleId":"D2","level":"warning","message":{"text":"Loader.fetchSchemasWithTables (cognitive 41): Loader.fetchSchemasWithTables has cognitive complexity 41 (threshold 15). Drivers by points: if/else 28, loops 10, boolean chains 3 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/infoschema/issyncer/loader.go"},"region":{"startLine":492}}}],"partialFingerprints":{"codehealthFindingId/v1":"f8d408aa4fc90a34d8af6e71664d4c99956402d250396e13edd4f6e3b7c8535d"}},{"ruleId":"D2","level":"warning","message":{"text":"regionJobBaseWorker.runJob (cognitive 41): regionJobBaseWorker.runJob has cognitive complexity 41 (threshold 15). Drivers by points: if/else 39, boolean chains 1, loops 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ingestor/ingestctrl/job_worker.go"},"region":{"startLine":171}}}],"partialFingerprints":{"codehealthFindingId/v1":"6dace52e0d9f19c6797806b26395731918e6631fedd06a40361512fb3615c553"}},{"ruleId":"D2","level":"warning","message":{"text":"core.getHashJoins (cognitive 41): core.getHashJoins has cognitive complexity 41 (threshold 15). Drivers by points: if/else 30, boolean chains 9, loops 1, match/switch 1 (nesting depth added 13). Of this number, 40 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":"pkg/planner/core/exhaust_physical_plans.go"},"region":{"startLine":110}}}],"partialFingerprints":{"codehealthFindingId/v1":"f1e398e6d9f7379b816080e3c1b46decf415974eb5d9dd3ced592843307e0815"}},{"ruleId":"D2","level":"warning","message":{"text":"core.findBestTask (cognitive 41): core.findBestTask has cognitive complexity 41 (threshold 15). Drivers by points: if/else 32, boolean chains 7, jumps 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":"pkg/planner/core/find_best_task.go"},"region":{"startLine":604}}}],"partialFingerprints":{"codehealthFindingId/v1":"5f7a29cb2050743e78318b55570a6bd0833533e9b9b97e47a7327248599aaaa5"}},{"ruleId":"D2","level":"warning","message":{"text":"core.getPlanCostVer24PhysicalTableScan (cognitive 41): core.getPlanCostVer24PhysicalTableScan has cognitive complexity 41 (threshold 15). Drivers by points: if/else 32, boolean chains 7, loops 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/plan_cost_ver2.go"},"region":{"startLine":159}}}],"partialFingerprints":{"codehealthFindingId/v1":"23bce74007adfbe1eb53b27c364e46f9e51559b4350b4f22c0bf91d7b14677a4"}},{"ruleId":"D2","level":"warning","message":{"text":"joinorder.extractJoinGroup (cognitive 41): joinorder.extractJoinGroup has cognitive complexity 41 (threshold 15). Drivers by points: if/else 29, boolean chains 12 (nesting depth added 8). Of this number, 39 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":"pkg/planner/core/joinorder/join_order.go"},"region":{"startLine":94}}}],"partialFingerprints":{"codehealthFindingId/v1":"413751c91a2f5929a66e52de2adad8596de5899b20449720b87435fcbf5e94ac"}},{"ruleId":"D2","level":"warning","message":{"text":"joinorder.BuildLeadingTreeFromList (cognitive 41): joinorder.BuildLeadingTreeFromList has cognitive complexity 41 (threshold 15). Drivers by points: if/else 37, match/switch 2, boolean chains 1, loops 1 (nesting depth added 25). 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/planner/core/joinorder/util.go"},"region":{"startLine":98}}}],"partialFingerprints":{"codehealthFindingId/v1":"ad397eb732476ba256d6379aacacd6231ff5fd9e0cb2f281287baa0fad2b9eb1"}},{"ruleId":"D2","level":"warning","message":{"text":"logicalop.CanPushToCopImpl (cognitive 41): logicalop.CanPushToCopImpl has cognitive complexity 41 (threshold 15). Drivers by points: if/else 28, boolean chains 7, loops 4, match/switch 2 (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":"pkg/planner/core/operator/logicalop/logical_plans_misc.go"},"region":{"startLine":227}}}],"partialFingerprints":{"codehealthFindingId/v1":"8953d26ff0e4ea81f2fdb89dd7c08e5a28d7c9457ce6635800389a36b133be50"}},{"ruleId":"D2","level":"warning","message":{"text":"LogicalJoin.SetPreferredJoinTypeAndOrder (cognitive 41): LogicalJoin.SetPreferredJoinTypeAndOrder has cognitive complexity 41 (threshold 15). Drivers by points: if/else 38, boolean chains 3 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/operator/logicalop/logical_join.go"},"region":{"startLine":1542}}}],"partialFingerprints":{"codehealthFindingId/v1":"161045c4578798d18093c793f1f48a2e66c3bf1e94add847091d78c7fcb58bbe"}},{"ruleId":"D2","level":"warning","message":{"text":"planner.Optimize (cognitive 41): planner.Optimize has cognitive complexity 41 (threshold 15). Drivers by points: if/else 35, boolean chains 4, loops 2 (nesting depth added 22). Most of this is not in the body itself: 8 of the 41 points are its own statements and the rest belongs to one function literal inside it that branches (line 156). 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":"pkg/planner/optimize.go"},"region":{"startLine":141}}}],"partialFingerprints":{"codehealthFindingId/v1":"1b9216492f4b4ebf5b131cbe13d45e905aa1dfd9a193d1ca4b4ebdde6b4a287e"}},{"ruleId":"D2","level":"warning","message":{"text":"session.updateTelemetryMetric (cognitive 41): session.updateTelemetryMetric has cognitive complexity 41 (threshold 15). Drivers by points: if/else 40, 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":"pkg/session/session.go"},"region":{"startLine":5488}}}],"partialFingerprints":{"codehealthFindingId/v1":"1147fee2076f5deaca9f1dfb8ad2044c9839c1cb1c439cf9bd885e46d6665d1b"}},{"ruleId":"D2","level":"warning","message":{"text":"tables.corruptMutations (cognitive 41): tables.corruptMutations has cognitive complexity 41 (threshold 15). Drivers by points: if/else 38, match/switch 2, loops 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":"pkg/table/tables/mutation_checker.go"},"region":{"startLine":490}}}],"partialFingerprints":{"codehealthFindingId/v1":"312b3058a48fe4bdf153c0bdd428a8e4bad16859ae0ce0767d9234075a5a3d83"}},{"ruleId":"D2","level":"warning","message":{"text":"staticTestHelper.assertDeepClonedEqual (cognitive 41): staticTestHelper.assertDeepClonedEqual has cognitive complexity 41 (threshold 15). Drivers by points: if/else 24, loops 10, boolean chains 6, match/switch 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":"pkg/util/deeptest/statictesthelper.go"},"region":{"startLine":130}}}],"partialFingerprints":{"codehealthFindingId/v1":"4b2a356454e95c68ed4a07ab505a3e6366082d63a531f365ffca72892b4b59fe"}},{"ruleId":"D2","level":"warning","message":{"text":"main.setGlobalVars (cognitive 40): main.setGlobalVars has cognitive complexity 40 (threshold 15). Drivers by points: if/else 19, match/switch 15, boolean chains 3, loops 3 (nesting depth added 15). Of this number, 38 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. 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":"cmd/tidb-server/main.go"},"region":{"startLine":1027}}}],"partialFingerprints":{"codehealthFindingId/v1":"83ffead5951a56b7a47ec1d9ca77ef0a3407d495f9890cf7ef92605df09be9a0"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.buildIndexColumns (cognitive 40): ddl.buildIndexColumns has cognitive complexity 40 (threshold 15). Drivers by points: if/else 30, boolean chains 9, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/index.go"},"region":{"startLine":116}}}],"partialFingerprints":{"codehealthFindingId/v1":"5caaa7d1605139ce33bdf312a409b40903ee1cc786f0f733e3a4493ece45a309"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.AppendPartitionDefs (cognitive 40): ddl.AppendPartitionDefs has cognitive complexity 40 (threshold 15). Drivers by points: if/else 25, loops 14, boolean chains 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/partition.go"},"region":{"startLine":5196}}}],"partialFingerprints":{"codehealthFindingId/v1":"3c9fe1d13486847dd1c34e1dcb41e63129e915cc113a8eddce3bc7b56f08b8ce"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.BuildStorageClassForPartitions (cognitive 40): ddl.BuildStorageClassForPartitions has cognitive complexity 40 (threshold 15). Drivers by points: if/else 33, loops 4, jumps 3 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/storage_class.go"},"region":{"startLine":390}}}],"partialFingerprints":{"codehealthFindingId/v1":"a2315f17b8dd42582373db6bf8559beb5acc5692b13d4ce4f62e94246c5f83d0"}},{"ruleId":"D2","level":"warning","message":{"text":"executor.splitByColon (cognitive 40): executor.splitByColon has cognitive complexity 40 (threshold 15). Drivers by points: if/else 23, loops 11, boolean chains 6 (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":"pkg/executor/slow_query.go"},"region":{"startLine":858}}}],"partialFingerprints":{"codehealthFindingId/v1":"19ce27570d810a749a3e2f26f9b082464189399b3b1764c639def2e5ababbacb"}},{"ruleId":"D2","level":"warning","message":{"text":"indexWorker.extractTaskHandles (cognitive 40): indexWorker.extractTaskHandles has cognitive complexity 40 (threshold 15). Drivers by points: if/else 36, loops 3, boolean chains 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/distsql.go"},"region":{"startLine":1729}}}],"partialFingerprints":{"codehealthFindingId/v1":"6b2437747bbd60c83c8d0cd4fd08753abca11b4772450091b65918022d6fe91f"}},{"ruleId":"D2","level":"warning","message":{"text":"internal.sizeOf (cognitive 40): internal.sizeOf has cognitive complexity 40 (threshold 15). Drivers by points: if/else 27, loops 10, match/switch 3 (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":"pkg/infoschema/internal/sizer.go"},"region":{"startLine":33}}}],"partialFingerprints":{"codehealthFindingId/v1":"d0e3faef71fd5d04e96cda7f7e35152cc1193042cdd7ac99724502c6e941fc2e"}},{"ruleId":"D2","level":"warning","message":{"text":"Backend.generateAndSendJob (cognitive 40): Backend.generateAndSendJob has cognitive complexity 40 (threshold 15). Drivers by points: loops 17, if/else 15, match/switch 8 (nesting depth added 28). Most of this is not in the body itself: 2 of the 40 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 1206, 1254). 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":"pkg/ingestor/ingestctrl/local.go"},"region":{"startLine":1189}}}],"partialFingerprints":{"codehealthFindingId/v1":"4f003dd812330964ff74dbccc51b5374f66aba3e18070d7cf43e643393b07e2c"}},{"ruleId":"D2","level":"warning","message":{"text":"Optimizer.implGroup (cognitive 40): Optimizer.implGroup has cognitive complexity 40 (threshold 15). Drivers by points: if/else 30, loops 7, boolean chains 3 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/cascades/old/optimize.go"},"region":{"startLine":268}}}],"partialFingerprints":{"codehealthFindingId/v1":"02b70a22e68349409095d150a102e70c2d5b8eed74783d62a36615a51785eb15"}},{"ruleId":"D2","level":"warning","message":{"text":"core.generateMVIndexMergePartialPaths4And (cognitive 40): core.generateMVIndexMergePartialPaths4And has cognitive complexity 40 (threshold 15). Drivers by points: if/else 26, loops 13, boolean chains 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/indexmerge_path.go"},"region":{"startLine":410}}}],"partialFingerprints":{"codehealthFindingId/v1":"0d9f5d8c6a9bfb277b91eec22c251da5a674fa01ccfc4f39d15034740c571518"}},{"ruleId":"D2","level":"warning","message":{"text":"core.rebuildRange (cognitive 40): core.rebuildRange has cognitive complexity 40 (threshold 15). Drivers by points: if/else 33, loops 6, match/switch 1 (nesting depth added 21). The drivers above price the dispatch low by construction \u2014 a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full \u2014 so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/plan_cache_rebuild.go"},"region":{"startLine":76}}}],"partialFingerprints":{"codehealthFindingId/v1":"33a8dd729b009680004575097b6e5949801c77f7a16d66dfb51322c054236945"}},{"ruleId":"D2","level":"warning","message":{"text":"core.attach2Task4PhysicalLimit (cognitive 40): core.attach2Task4PhysicalLimit has cognitive complexity 40 (threshold 15). Drivers by points: if/else 31, loops 6, boolean chains 3 (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":"pkg/planner/core/task.go"},"region":{"startLine":619}}}],"partialFingerprints":{"codehealthFindingId/v1":"7a53e50541f0020951b0cc68cbb94005c712710d29358b6c9c3fbb2081e7a3d4"}},{"ruleId":"D2","level":"warning","message":{"text":"gbyResolver.Leave (cognitive 40): gbyResolver.Leave has cognitive complexity 40 (threshold 15). Drivers by points: if/else 35, boolean chains 4, match/switch 1 (nesting depth added 21). The drivers above price the dispatch low by construction \u2014 a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full \u2014 so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/logical_plan_builder.go"},"region":{"startLine":3407}}}],"partialFingerprints":{"codehealthFindingId/v1":"59141d6665708fe9ea42b5e540e97277c9e65e44a049ea16417a69750ce906d0"}},{"ruleId":"D2","level":"warning","message":{"text":"PlanBuilder.buildSetOpr (cognitive 40): PlanBuilder.buildSetOpr has cognitive complexity 40 (threshold 15). Drivers by points: if/else 28, loops 6, boolean chains 3, match/switch 3 (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/planner/core/logical_plan_builder.go"},"region":{"startLine":2114}}}],"partialFingerprints":{"codehealthFindingId/v1":"afca286548b0cdf9cacddd8af0ca3a7f680b36b6718ef0ff767c9911fdd31b86"}},{"ruleId":"D2","level":"warning","message":{"text":"types.CompareBinaryJSON (cognitive 40): types.CompareBinaryJSON has cognitive complexity 40 (threshold 15). Drivers by points: if/else 22, match/switch 11, loops 6, boolean chains 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/types/json_binary_functions.go"},"region":{"startLine":793}}}],"partialFingerprints":{"codehealthFindingId/v1":"dc31e6e45ee078fa73121b7e1d61959af9cfce2eb719b4db645b01c15b6d7751"}},{"ruleId":"D2","level":"warning","message":{"text":"types.DecimalMul (cognitive 40): types.DecimalMul has cognitive complexity 40 (threshold 15). Drivers by points: if/else 29, loops 10, boolean chains 1 (nesting depth added 18). 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/types/mydecimal.go"},"region":{"startLine":2052}}}],"partialFingerprints":{"codehealthFindingId/v1":"37ffe1e49a948ca1cea3fe7745744e876101744619962c3cad1a5061dabee0b1"}},{"ruleId":"D2","level":"warning","message":{"text":"MyDecimal.WriteBin (cognitive 40): MyDecimal.WriteBin has cognitive complexity 40 (threshold 15). Drivers by points: if/else 23, boolean chains 10, loops 7 (nesting depth added 8). 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":"pkg/types/mydecimal.go"},"region":{"startLine":1295}}}],"partialFingerprints":{"codehealthFindingId/v1":"6c3ec15b93b127d25a003a0c871f054313949676344783c2f6dcf4a2d925067c"}},{"ruleId":"D2","level":"warning","message":{"text":"MemArbitrator.killTopnEntry (cognitive 40): MemArbitrator.killTopnEntry has cognitive complexity 40 (threshold 15). Drivers by points: if/else 31, loops 8, 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":"pkg/util/memory/arbitrator.go"},"region":{"startLine":2904}}}],"partialFingerprints":{"codehealthFindingId/v1":"2165183d150e00d73924e8ea84b5436af585bed30664cd49b28b96fb866da5e9"}},{"ruleId":"D2","level":"warning","message":{"text":"mysql.formatWithStyle (cognitive 40): mysql.formatWithStyle has cognitive complexity 40 (threshold 15). Drivers by points: if/else 30, boolean chains 7, 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":"pkg/parser/mysql/locale_format.go"},"region":{"startLine":196}}}],"partialFingerprints":{"codehealthFindingId/v1":"3b9d2f772cf421899b884764667ed51a06f8c51074adfa8f25ac3bb9f39868d3"}},{"ruleId":"D2","level":"warning","message":{"text":"split.SplitPoint (cognitive 39): split.SplitPoint has cognitive complexity 39 (threshold 15). Drivers by points: if/else 35, boolean chains 2, loops 2 (nesting depth added 18). Most of this is not in the body itself: 4 of the 39 points are its own statements and the rest belongs to one function literal inside it that branches (line 251). 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":"br/pkg/restore/split/splitter.go"},"region":{"startLine":220}}}],"partialFingerprints":{"codehealthFindingId/v1":"98fce30e03873eab06831c23879426041b74d3975c2bf84a87aabc1418f9fcc2"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.checkTableDefCompatible (cognitive 39): ddl.checkTableDefCompatible has cognitive complexity 39 (threshold 15). Drivers by points: if/else 28, loops 6, boolean chains 5 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/executor.go"},"region":{"startLine":3060}}}],"partialFingerprints":{"codehealthFindingId/v1":"8b0560ece2f3f6750b7999be7a5b28c17e5b12811665f459c3610f30c9adbbfe"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.getPartitionIntervalFromTable (cognitive 39): ddl.getPartitionIntervalFromTable has cognitive complexity 39 (threshold 15). Drivers by points: if/else 36, boolean chains 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":"pkg/ddl/partition.go"},"region":{"startLine":831}}}],"partialFingerprints":{"codehealthFindingId/v1":"275cf7acaac8d2ac3b7b6e7ae97b9ac1af808f476ecc68bc613ff12e5a667e5a"}},{"ruleId":"D2","level":"warning","message":{"text":"worker.onDropColumn (cognitive 39): worker.onDropColumn has cognitive complexity 39 (threshold 15). Drivers by points: if/else 33, loops 3, boolean chains 2, match/switch 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/ddl/column.go"},"region":{"startLine":142}}}],"partialFingerprints":{"codehealthFindingId/v1":"876010bdc3a8a305660326f70dc84b63cb03c6d770af014fb1509bb4d28fc9a8"}},{"ruleId":"D2","level":"warning","message":{"text":"jobsubmit.assignGIDsForJobs (cognitive 39): jobsubmit.assignGIDsForJobs has cognitive complexity 39 (threshold 15). Drivers by points: if/else 28, loops 9, match/switch 2 (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":"pkg/ddl/jobsubmit/submit.go"},"region":{"startLine":287}}}],"partialFingerprints":{"codehealthFindingId/v1":"30fdb492d6d2fc99178572606e08bbd9e21597741369bb75d7e45a315b8a5d39"}},{"ruleId":"D2","level":"warning","message":{"text":"executor.addUnchangedKeysForLockByRow (cognitive 39): executor.addUnchangedKeysForLockByRow has cognitive complexity 39 (threshold 15). Drivers by points: if/else 31, boolean chains 6, loops 2 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/write.go"},"region":{"startLine":366}}}],"partialFingerprints":{"codehealthFindingId/v1":"0bcb2cd32315ad7c5eebbc5bf7889ff9b36fc889b90c31ec3a013df8f160ca5f"}},{"ruleId":"D2","level":"warning","message":{"text":"tableWorker.compareData (cognitive 39): tableWorker.compareData has cognitive complexity 39 (threshold 15). Drivers by points: if/else 25, loops 11, match/switch 2, boolean chains 1 (nesting depth added 21). Of this number, 34 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":"pkg/executor/distsql.go"},"region":{"startLine":2014}}}],"partialFingerprints":{"codehealthFindingId/v1":"41a1b33cb369cc4425230f072364ccd4098cf21790930102b074b993908e821d"}},{"ruleId":"D2","level":"warning","message":{"text":"memtableRetriever.setDataForTiKVRegionStatus (cognitive 39): memtableRetriever.setDataForTiKVRegionStatus has cognitive complexity 39 (threshold 15). Drivers by points: if/else 31, loops 6, boolean chains 2 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/infoschema_reader.go"},"region":{"startLine":2095}}}],"partialFingerprints":{"codehealthFindingId/v1":"e64e16314d5cbfe0c988356c383c92a8af369e7d882aefaf17579bda9added0e"}},{"ruleId":"D2","level":"warning","message":{"text":"ShowExec.fetchShowIndex (cognitive 39): ShowExec.fetchShowIndex has cognitive complexity 39 (threshold 15). Drivers by points: if/else 32, loops 5, boolean chains 2 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/show.go"},"region":{"startLine":788}}}],"partialFingerprints":{"codehealthFindingId/v1":"3d3259cd7b749ce9fb9c9df475910a340294474aefd2b66aa28803b69c20bdbe"}},{"ruleId":"D2","level":"warning","message":{"text":"ShuffleExec.Close (cognitive 39): ShuffleExec.Close has cognitive complexity 39 (threshold 15). Drivers by points: if/else 26, loops 9, boolean chains 4 (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":"pkg/executor/shuffle.go"},"region":{"startLine":152}}}],"partialFingerprints":{"codehealthFindingId/v1":"a185d51eec04ce2299d5355ac296168c85df851397bd1f157e74f102c9ca4d96"}},{"ruleId":"D2","level":"warning","message":{"text":"parallelSortSpillHelper.spillImpl (cognitive 39): parallelSortSpillHelper.spillImpl has cognitive complexity 39 (threshold 15). Drivers by points: if/else 29, match/switch 4, jumps 3, loops 2, boolean chains 1 (nesting depth added 19). Of this number, 28 points are the body\u0027s own statements and 11 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":"pkg/executor/sortexec/parallel_sort_spill_helper.go"},"region":{"startLine":197}}}],"partialFingerprints":{"codehealthFindingId/v1":"117307c4a75c486e3043e8789a41a35ee41abe13c4a8cc622f7c906ac273e3ea"}},{"ruleId":"D2","level":"warning","message":{"text":"PipelinedWindowExec.Next (cognitive 39): PipelinedWindowExec.Next has cognitive complexity 39 (threshold 15). Drivers by points: if/else 35, boolean chains 3, loops 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/windows/pipelined_window.go"},"region":{"startLine":117}}}],"partialFingerprints":{"codehealthFindingId/v1":"cf9ba4a8771f1e682a07bfe6054be614e2ee66270cee1f8ce3f62b21e1632e33"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinCastJSONAsTimeSig.vecEvalTime (cognitive 39): builtinCastJSONAsTimeSig.vecEvalTime has cognitive complexity 39 (threshold 15). Drivers by points: if/else 36, match/switch 2, loops 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/builtin_cast_vec.go"},"region":{"startLine":479}}}],"partialFingerprints":{"codehealthFindingId/v1":"d08987560ebd61e265cac199d15866eebd0bc9b67c5b259227728c2068ae0660"}},{"ruleId":"D2","level":"warning","message":{"text":"simplesst.newMergePropBaseIter (cognitive 39): simplesst.newMergePropBaseIter has cognitive complexity 39 (threshold 15). Drivers by points: if/else 22, match/switch 9, loops 7, boolean chains 1 (nesting depth added 21). Most of this is not in the body itself: 5 of the 39 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 664, 723, 713). 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":"pkg/ingestor/simplesst/iter.go"},"region":{"startLine":630}}}],"partialFingerprints":{"codehealthFindingId/v1":"c7bcbc23f37712f4c96407424826fe80a570e06ed91e94f8435a6e45b3900b05"}},{"ruleId":"D2","level":"warning","message":{"text":"DBStore.adjust (cognitive 39): DBStore.adjust has cognitive complexity 39 (threshold 15). Drivers by points: if/else 31, boolean chains 4, loops 3, 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":"pkg/lightning/config/config.go"},"region":{"startLine":162}}}],"partialFingerprints":{"codehealthFindingId/v1":"7a68c627c7a9dcddf79ad68789490dc31721dca28ceb6cbd848ee7504d6df529"}},{"ruleId":"D2","level":"warning","message":{"text":"core.getTaskPlanCost (cognitive 39): core.getTaskPlanCost has cognitive complexity 39 (threshold 15). Drivers by points: if/else 27, loops 8, boolean chains 3, match/switch 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/find_best_task.go"},"region":{"startLine":498}}}],"partialFingerprints":{"codehealthFindingId/v1":"ab93d59aee4463c18378bc28b325ecac8336b0a14c201cf3a58f6c3e68876f8c"}},{"ruleId":"D2","level":"warning","message":{"text":"core.compareCandidates (cognitive 39): core.compareCandidates has cognitive complexity 39 (threshold 15). Drivers by points: if/else 23, boolean chains 16 (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":"pkg/planner/core/find_best_task.go"},"region":{"startLine":854}}}],"partialFingerprints":{"codehealthFindingId/v1":"ec37b72132eb3efffb0402143ebbcfdfde8d81e9a45c664da35c0ecd407527c6"}},{"ruleId":"D2","level":"warning","message":{"text":"core.tryWhereIn2BatchPointGet (cognitive 39): core.tryWhereIn2BatchPointGet has cognitive complexity 39 (threshold 15). Drivers by points: if/else 26, boolean chains 6, loops 6, match/switch 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":"pkg/planner/core/point_get_plan.go"},"region":{"startLine":409}}}],"partialFingerprints":{"codehealthFindingId/v1":"b94625bb767f5b07526d7c853f232ef86d6c0761aed19fb09fc32c7e6d95ac3e"}},{"ruleId":"D2","level":"warning","message":{"text":"joinorder.greedyConnectJoinNodes (cognitive 39): joinorder.greedyConnectJoinNodes has cognitive complexity 39 (threshold 15). Drivers by points: if/else 32, loops 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":"pkg/planner/core/joinorder/join_order.go"},"region":{"startLine":733}}}],"partialFingerprints":{"codehealthFindingId/v1":"053cc56f5cfe78a63b62e1a09b181d019904872ea646a42f5b8f99a8e9e9f2bd"}},{"ruleId":"D2","level":"warning","message":{"text":"rule.collectSyncIndices (cognitive 39): rule.collectSyncIndices has cognitive complexity 39 (threshold 15). Drivers by points: if/else 35, loops 3, 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":"pkg/planner/core/rule/rule_collect_plan_stats.go"},"region":{"startLine":475}}}],"partialFingerprints":{"codehealthFindingId/v1":"576c64793da69bea99b756a68dbf33ce6418ff46868d56a5fcdf6ebe4f346a9f"}},{"ruleId":"D2","level":"warning","message":{"text":"parse.HandshakeResponseBody (cognitive 39): parse.HandshakeResponseBody has cognitive complexity 39 (threshold 15). Drivers by points: if/else 39 (nesting depth added 18). Of this number, 38 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":"pkg/server/internal/parse/parse.go"},"region":{"startLine":76}}}],"partialFingerprints":{"codehealthFindingId/v1":"9a37aec0ec10a2f1104283e5d159d983ab7d9aa86719890dbc0f335be01a5749"}},{"ruleId":"D2","level":"warning","message":{"text":"Server.startNetworkListener (cognitive 39): Server.startNetworkListener has cognitive complexity 39 (threshold 15). Drivers by points: if/else 37, boolean chains 1, 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":"pkg/server/server.go"},"region":{"startLine":561}}}],"partialFingerprints":{"codehealthFindingId/v1":"15274ff3967d52827be8d8c6b1f5a4faf4738fe3c5d29728eb7d3d022494d435"}},{"ruleId":"D2","level":"warning","message":{"text":"session.selectShardColumn (cognitive 39): session.selectShardColumn has cognitive complexity 39 (threshold 15). Drivers by points: if/else 34, loops 3, boolean chains 2 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/session/nontransactional.go"},"region":{"startLine":605}}}],"partialFingerprints":{"codehealthFindingId/v1":"b28576b88c8537bb2e73e676a61aa578bf8da446fc0ed313c38db7f923e44043"}},{"ruleId":"D2","level":"warning","message":{"text":"statistics.BuildHistAndTopN (cognitive 39): statistics.BuildHistAndTopN has cognitive complexity 39 (threshold 15). Drivers by points: if/else 28, boolean chains 8, loops 3 (nesting depth added 8). Of this number, 36 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":"pkg/statistics/builder.go"},"region":{"startLine":363}}}],"partialFingerprints":{"codehealthFindingId/v1":"3422413a4ccd0e886546ff5f2f49ed7d2b4fa9f2383bda492632c2c6b2143362"}},{"ruleId":"D2","level":"warning","message":{"text":"storage.indexStatsFromStorage (cognitive 39): storage.indexStatsFromStorage has cognitive complexity 39 (threshold 15). Drivers by points: if/else 33, boolean chains 5, 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/statistics/handle/storage/read.go"},"region":{"startLine":247}}}],"partialFingerprints":{"codehealthFindingId/v1":"27d16c3fde96ebb2d8e87c55e85b36911865da5b98c544bead87d0f22ce80e84"}},{"ruleId":"D2","level":"warning","message":{"text":"GCWorker.resolveLocks (cognitive 39): GCWorker.resolveLocks has cognitive complexity 39 (threshold 15). Drivers by points: if/else 30, loops 5, boolean chains 4 (nesting depth added 15). Of this number, 38 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":"pkg/store/gcworker/gc_worker.go"},"region":{"startLine":1250}}}],"partialFingerprints":{"codehealthFindingId/v1":"1a21b1801f5a7fa6e2d789a9d0e893626a1b63d292df86efe647466dc01d71b1"}},{"ruleId":"D2","level":"warning","message":{"text":"MVCCStore.Flush (cognitive 39): MVCCStore.Flush has cognitive complexity 39 (threshold 15). Drivers by points: if/else 36, loops 3 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/store/mockstore/unistore/tikv/mvcc.go"},"region":{"startLine":986}}}],"partialFingerprints":{"codehealthFindingId/v1":"640061588699f1c6f3936507cb5c4a67c31fe6c29d8baf85317520b3ea9b3d51"}},{"ruleId":"D2","level":"warning","message":{"text":"ExecDetails.ToZapFields (cognitive 39): ExecDetails.ToZapFields has cognitive complexity 39 (threshold 15). Drivers by points: if/else 37, boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/util/execdetails/execdetails.go"},"region":{"startLine":358}}}],"partialFingerprints":{"codehealthFindingId/v1":"6d59a79f2e85fe62238be99822222db6952916665b4626874a931a7ae92f1888"}},{"ruleId":"D2","level":"warning","message":{"text":"builder.newBuildFromPatternLike (cognitive 39): builder.newBuildFromPatternLike has cognitive complexity 39 (threshold 15). Drivers by points: if/else 36, loops 2, 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":"pkg/util/ranger/points.go"},"region":{"startLine":718}}}],"partialFingerprints":{"codehealthFindingId/v1":"629b69cda596ff033f31f0fc71f6cd58dc8fbb387410d8741d4013fa2d12dc55"}},{"ruleId":"D2","level":"warning","message":{"text":"stmtsummary.addInfo (cognitive 39): stmtsummary.addInfo has cognitive complexity 39 (threshold 15). Drivers by points: if/else 37, loops 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":"pkg/util/stmtsummary/evicted.go"},"region":{"startLine":222}}}],"partialFingerprints":{"codehealthFindingId/v1":"c25d582b45cc590b9ea20edc2deec5d1d5a1676f79f2ef7960c4b3ec42f57477"}},{"ruleId":"D2","level":"warning","message":{"text":"StmtRecord.Merge (cognitive 39): StmtRecord.Merge has cognitive complexity 39 (threshold 15). Drivers by points: if/else 37, loops 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":"pkg/util/stmtsummary/v2/record.go"},"region":{"startLine":472}}}],"partialFingerprints":{"codehealthFindingId/v1":"d99949ed475f72e4ae0bfb230b2ceaef2dc608415c5920388ba5964f2a79520d"}},{"ruleId":"D2","level":"warning","message":{"text":"trieSelector.insert (cognitive 39): trieSelector.insert has cognitive complexity 39 (threshold 15). Drivers by points: if/else 28, loops 5, match/switch 5, boolean chains 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/util/table-rule-selector/trie_selector.go"},"region":{"startLine":302}}}],"partialFingerprints":{"codehealthFindingId/v1":"e28a6cacd5d5899c262a078199714a2845c37c2584507391905ea6a3d8d26291"}},{"ruleId":"D2","level":"warning","message":{"text":"AnalyzeTableStmt.Restore (cognitive 39): AnalyzeTableStmt.Restore has cognitive complexity 39 (threshold 15). Drivers by points: if/else 28, loops 10, 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":"pkg/parser/ast/stats.go"},"region":{"startLine":104}}}],"partialFingerprints":{"codehealthFindingId/v1":"b3e5f6039126fadd04c1024c56efa1363f593490072c1a2e8ef6217b2db672f0"}},{"ruleId":"D2","level":"warning","message":{"text":"snapclient.SortAndValidateFileRanges (cognitive 38): snapclient.SortAndValidateFileRanges has cognitive complexity 38 (threshold 15). Drivers by points: if/else 31, loops 5, boolean chains 2 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"br/pkg/restore/snap_client/tikv_sender.go"},"region":{"startLine":106}}}],"partialFingerprints":{"codehealthFindingId/v1":"f70e1066c568e513ef2e5f0277c1b26b6354b208f6050a959d646c9ba57eb1ad"}},{"ruleId":"D2","level":"warning","message":{"text":"SnapFileImporter.downloadRawKVSST (cognitive 38): SnapFileImporter.downloadRawKVSST has cognitive complexity 38 (threshold 15). Drivers by points: if/else 30, loops 6, boolean chains 2 (nesting depth added 24). Of this number, 26 points are the body\u0027s own statements and 12 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"br/pkg/restore/snap_client/import.go"},"region":{"startLine":1131}}}],"partialFingerprints":{"codehealthFindingId/v1":"95dbcc2615a1e5d1a5d4ab1b4ca5b10bbad090bfa94e61882e5313683f5c0014"}},{"ruleId":"D2","level":"warning","message":{"text":"spans.ValuedSetEquals (cognitive 38): spans.ValuedSetEquals has cognitive complexity 38 (threshold 15). Drivers by points: if/else 30, boolean chains 5, loops 3 (nesting depth added 19). Of this number, 36 points are the body\u0027s own statements and 2 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":"br/pkg/streamhelper/spans/utils.go"},"region":{"startLine":84}}}],"partialFingerprints":{"codehealthFindingId/v1":"c03aa33fb999bd8afae6cff9f58396849dd558c0a650d69ed70928b4b24f251f"}},{"ruleId":"D2","level":"warning","message":{"text":"etcdconfig.run (cognitive 38): etcdconfig.run has cognitive complexity 38 (threshold 15). Drivers by points: if/else 32, loops 6 (nesting depth added 25). Most of this is not in the body itself: 5 of the 38 points are its own statements and the rest belongs to one function literal inside it that branches (line 47). 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":"build/linter/etcdconfig/analyzer.go"},"region":{"startLine":39}}}],"partialFingerprints":{"codehealthFindingId/v1":"1520aa503d84c719a4cfc84e0fb6112a804f96264fb8e69882fef365c244a003"}},{"ruleId":"D2","level":"warning","message":{"text":"FileCheckpointsDB.DestroyErrorCheckpoint (cognitive 38): FileCheckpointsDB.DestroyErrorCheckpoint has cognitive complexity 38 (threshold 15). Drivers by points: if/else 28, loops 10 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lightning/pkg/checkpoints/checkpoints.go"},"region":{"startLine":2005}}}],"partialFingerprints":{"codehealthFindingId/v1":"ddf3600757f101a496ba366022547364f25081db1c0553819b2158edfcbec45e"}},{"ruleId":"D2","level":"warning","message":{"text":"bindinfo.extractSelectIndexHints (cognitive 38): bindinfo.extractSelectIndexHints has cognitive complexity 38 (threshold 15). Drivers by points: if/else 31, boolean chains 4, loops 3 (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/bindinfo/binding_plan_generation.go"},"region":{"startLine":920}}}],"partialFingerprints":{"codehealthFindingId/v1":"f1081789b1cae732c8d344aee76ed349375b722385e451a9b8264ca99fdfa5b7"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.handleTableOptions (cognitive 38): ddl.handleTableOptions has cognitive complexity 38 (threshold 15). Drivers by points: if/else 34, match/switch 2, boolean chains 1, 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":"pkg/ddl/create_table.go"},"region":{"startLine":942}}}],"partialFingerprints":{"codehealthFindingId/v1":"de3ae7d763238e773b87695f6db143e9d6a1d01e190f0c013636f3a198b25f12"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.expectedDeleteRangeCnt (cognitive 38): ddl.expectedDeleteRangeCnt has cognitive complexity 38 (threshold 15). Drivers by points: if/else 33, loops 4, match/switch 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":"pkg/ddl/sanity_check.go"},"region":{"startLine":80}}}],"partialFingerprints":{"codehealthFindingId/v1":"8ab442caf3a5129ec31f0ea6b5e2247c76b304e4832555305dc5a0788a55049d"}},{"ruleId":"D2","level":"warning","message":{"text":"mergeIndexWorker.BackfillData (cognitive 38): mergeIndexWorker.BackfillData has cognitive complexity 38 (threshold 15). Drivers by points: if/else 34, loops 3, boolean chains 1 (nesting depth added 21). Most of this is not in the body itself: 15 of the 38 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 186, 265). 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":"pkg/ddl/index_merge_tmp.go"},"region":{"startLine":166}}}],"partialFingerprints":{"codehealthFindingId/v1":"8fbb9340e4a542fffe13165025466f59ac71b536ff864f7b1f18e3b9d8f1dce1"}},{"ruleId":"D2","level":"warning","message":{"text":"reorgPartitionWorker.BackfillData (cognitive 38): reorgPartitionWorker.BackfillData has cognitive complexity 38 (threshold 15). Drivers by points: if/else 30, loops 6, boolean chains 2 (nesting depth added 20). Most of this is not in the body itself: 0 of the 38 points are its own statements and the rest belongs to one function literal inside it that branches (line 3900). 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":"pkg/ddl/partition.go"},"region":{"startLine":3897}}}],"partialFingerprints":{"codehealthFindingId/v1":"a94df4b0a3ee7756b1f38a5e0aa166ac624aa3c21d785270a0807ddccbbe5810"}},{"ruleId":"D2","level":"warning","message":{"text":"IndexMergeReaderExecutor.buildPartialWorkerKVRanges (cognitive 38): IndexMergeReaderExecutor.buildPartialWorkerKVRanges has cognitive complexity 38 (threshold 15). Drivers by points: if/else 26, loops 9, match/switch 2, boolean chains 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/index_merge_reader.go"},"region":{"startLine":245}}}],"partialFingerprints":{"codehealthFindingId/v1":"686bc654aa582ba94940de2b56b77b42989fc8290520695d3fc51a26c6845798"}},{"ruleId":"D2","level":"warning","message":{"text":"InsertExec.batchUpdateDupRows (cognitive 38): InsertExec.batchUpdateDupRows has cognitive complexity 38 (threshold 15). Drivers by points: if/else 35, loops 3 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/insert.go"},"region":{"startLine":226}}}],"partialFingerprints":{"codehealthFindingId/v1":"86702f9a81d9122ea99fce57c9a2f0e888ce82bf9a0bfcfefb610fcb11430dff"}},{"ruleId":"D2","level":"warning","message":{"text":"InsertValues.fillRow (cognitive 38): InsertValues.fillRow has cognitive complexity 38 (threshold 15). Drivers by points: if/else 29, loops 5, boolean chains 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":"pkg/executor/insert_common.go"},"region":{"startLine":705}}}],"partialFingerprints":{"codehealthFindingId/v1":"22c591bf808646b7be6f53f055f8a46b5048506267bac66b8a135320f0be1710"}},{"ruleId":"D2","level":"warning","message":{"text":"SelectIntoExec.dumpToOutfile (cognitive 38): SelectIntoExec.dumpToOutfile has cognitive complexity 38 (threshold 15). Drivers by points: if/else 23, boolean chains 6, match/switch 6, loops 3 (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":"pkg/executor/select_into.go"},"region":{"startLine":124}}}],"partialFingerprints":{"codehealthFindingId/v1":"6f79ea5f18f06986dc589f10998158c4d995caaaf4e4cc5569b9b869399598f6"}},{"ruleId":"D2","level":"warning","message":{"text":"ShowExec.fetchShowStatsHealthy (cognitive 38): ShowExec.fetchShowStatsHealthy has cognitive complexity 38 (threshold 15). Drivers by points: if/else 26, loops 10, boolean chains 2 (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":"pkg/executor/show_stats.go"},"region":{"startLine":468}}}],"partialFingerprints":{"codehealthFindingId/v1":"0393deac2c60008144f90f0aeea54d9b017f32a9165c63365c0234bf9e0bb9a8"}},{"ruleId":"D2","level":"warning","message":{"text":"SimpleExec.executeFlushStatsDeltaOnCurrentInstance (cognitive 38): SimpleExec.executeFlushStatsDeltaOnCurrentInstance has cognitive complexity 38 (threshold 15). Drivers by points: if/else 28, loops 6, match/switch 3, 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":"pkg/executor/simple.go"},"region":{"startLine":3370}}}],"partialFingerprints":{"codehealthFindingId/v1":"7ddb671b538ed6e99e586d737f7fc547f8199a8a51fb648b785be609556efe30"}},{"ruleId":"D2","level":"warning","message":{"text":"objstore.NewGCSStorage (cognitive 38): objstore.NewGCSStorage has cognitive complexity 38 (threshold 15). Drivers by points: if/else 34, boolean chains 2, jumps 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/objstore/gcs.go"},"region":{"startLine":440}}}],"partialFingerprints":{"codehealthFindingId/v1":"b3dc90213639d09d0715fa2169a78be8dfc8700b84a46b0e48f271d411d0075d"}},{"ruleId":"D2","level":"warning","message":{"text":"cardinality.expBackoffEstimation (cognitive 38): cardinality.expBackoffEstimation has cognitive complexity 38 (threshold 15). Drivers by points: if/else 28, boolean chains 5, loops 5 (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":"pkg/planner/cardinality/row_count_index.go"},"region":{"startLine":450}}}],"partialFingerprints":{"codehealthFindingId/v1":"7eaa76d0b7238dbb040991c851a83fc8234a9043b47fa64b4cc5318f5dcb31ad"}},{"ruleId":"D2","level":"warning","message":{"text":"cardinality.AdjustRowCountForAppendedHandleColumns (cognitive 38): cardinality.AdjustRowCountForAppendedHandleColumns has cognitive complexity 38 (threshold 15). Drivers by points: if/else 21, loops 10, boolean chains 7 (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":"pkg/planner/cardinality/row_count_index.go"},"region":{"startLine":591}}}],"partialFingerprints":{"codehealthFindingId/v1":"dfec70262c9ee803d8fcc63bc97d57b08962cffa858caa0f4b62b43c8661303d"}},{"ruleId":"D2","level":"warning","message":{"text":"core.indexJoinPathBuild (cognitive 38): core.indexJoinPathBuild has cognitive complexity 38 (threshold 15). Drivers by points: if/else 34, boolean chains 4 (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":"pkg/planner/core/index_join_path.go"},"region":{"startLine":168}}}],"partialFingerprints":{"codehealthFindingId/v1":"0be99866de56b5d5a7877f71a7d4a27ca1342207bb0733fb58d98bc4beeffd5d"}},{"ruleId":"D2","level":"warning","message":{"text":"core.checkAutoIncrementOp (cognitive 38): core.checkAutoIncrementOp has cognitive complexity 38 (threshold 15). Drivers by points: if/else 33, loops 4, boolean chains 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/preprocess.go"},"region":{"startLine":754}}}],"partialFingerprints":{"codehealthFindingId/v1":"cfc34ad13638f3b096a391570ec333e3b2af7a5809314da1d45d1a364f5332be"}},{"ruleId":"D2","level":"warning","message":{"text":"extractHelper.extractTimeRange (cognitive 38): extractHelper.extractTimeRange has cognitive complexity 38 (threshold 15). Drivers by points: if/else 27, match/switch 9, boolean chains 1, loops 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/memtable_predicate_extractor.go"},"region":{"startLine":528}}}],"partialFingerprints":{"codehealthFindingId/v1":"a2e1d5957f2c797c0cb4aa8d1f112335e25d275cc01d81051931d0bba1fa6c92"}},{"ruleId":"D2","level":"warning","message":{"text":"PhysicalProperty.HashCode (cognitive 38): PhysicalProperty.HashCode has cognitive complexity 38 (threshold 15). Drivers by points: if/else 26, loops 12 (nesting depth added 11). 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":"pkg/planner/property/physical_property.go"},"region":{"startLine":617}}}],"partialFingerprints":{"codehealthFindingId/v1":"d263ae378a412bb5af74f5a97862814a1ab0d372f167bc3dbc520d2791b8a18b"}},{"ruleId":"D2","level":"warning","message":{"text":"session.runStmt (cognitive 38): session.runStmt has cognitive complexity 38 (threshold 15). Drivers by points: if/else 35, boolean chains 3 (nesting depth added 12). Of this number, 32 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":"pkg/session/session.go"},"region":{"startLine":2941}}}],"partialFingerprints":{"codehealthFindingId/v1":"89c92553ded544f73a90e9e02deb7ceff3a18f763d8c5d9bc814befc5cd5e034"}},{"ruleId":"D2","level":"warning","message":{"text":"globalstats.MergePartTopN2GlobalTopN (cognitive 38): globalstats.MergePartTopN2GlobalTopN has cognitive complexity 38 (threshold 15). Drivers by points: if/else 29, loops 7, boolean chains 2 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/statistics/handle/globalstats/topn.go"},"region":{"startLine":136}}}],"partialFingerprints":{"codehealthFindingId/v1":"c77ea7544d13ba05afcebb5ba0561c3badbbc761de1c593acf4d2b7a3ac166ef"}},{"ruleId":"D2","level":"warning","message":{"text":"RowSampleBuilder.Collect (cognitive 38): RowSampleBuilder.Collect has cognitive complexity 38 (threshold 15). Drivers by points: if/else 26, loops 11, boolean chains 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/statistics/row_sampler.go"},"region":{"startLine":162}}}],"partialFingerprints":{"codehealthFindingId/v1":"bff5bbf5c1d8493fcd907ab802d438e70e44c367dc90605a2e9119dbf589cd7c"}},{"ruleId":"D2","level":"warning","message":{"text":"aggExec.processAllRows (cognitive 38): aggExec.processAllRows has cognitive complexity 38 (threshold 15). Drivers by points: if/else 27, loops 9, boolean chains 2 (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":"pkg/store/mockstore/unistore/cophandler/mpp_exec.go"},"region":{"startLine":1380}}}],"partialFingerprints":{"codehealthFindingId/v1":"3f9fbc14fc7f4ae8c73fa32f6098fe891713654e5721d2eb7b5c82eac93ad6fb"}},{"ruleId":"D2","level":"warning","message":{"text":"table.FillVirtualColumnValue (cognitive 38): table.FillVirtualColumnValue has cognitive complexity 38 (threshold 15). Drivers by points: if/else 28, match/switch 4, boolean chains 3, loops 3 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/table/column.go"},"region":{"startLine":770}}}],"partialFingerprints":{"codehealthFindingId/v1":"68eb4495ab52c1131879ba28b60a61f432b3181fcc50e6a6af296b9ae92d01a2"}},{"ruleId":"D2","level":"warning","message":{"text":"ttlScanTask.doScanWithSession (cognitive 38): ttlScanTask.doScanWithSession has cognitive complexity 38 (threshold 15). Drivers by points: if/else 27, match/switch 8, loops 2, boolean chains 1 (nesting depth added 17). Of this number, 34 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":"pkg/ttl/ttlworker/scan.go"},"region":{"startLine":139}}}],"partialFingerprints":{"codehealthFindingId/v1":"7fcf8ce909b8885fea9b9a841311193bccab1a3676a11ccecb8ad424d6b8a208"}},{"ruleId":"D2","level":"warning","message":{"text":"MemArbitrator.updateMemMagnification (cognitive 38): MemArbitrator.updateMemMagnification has cognitive complexity 38 (threshold 15). Drivers by points: if/else 31, boolean chains 5, loops 2 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/util/memory/arbitrator.go"},"region":{"startLine":2413}}}],"partialFingerprints":{"codehealthFindingId/v1":"cb59891c455c48ee3d2e65115da63651159daef0cbf19b4d1399ae22f40661c6"}},{"ruleId":"D2","level":"warning","message":{"text":"task.RunRestoreAbort (cognitive 37): task.RunRestoreAbort has cognitive complexity 37 (threshold 15). Drivers by points: if/else 35, boolean chains 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"br/pkg/task/restore.go"},"region":{"startLine":2845}}}],"partialFingerprints":{"codehealthFindingId/v1":"d69200d89e8047a5df4fc8a64d715ce3dd6cca2df4cf4015e1b5b06626f7ef34"}},{"ruleId":"D2","level":"warning","message":{"text":"task.buildKeyRangesFromSchemasReplace (cognitive 37): task.buildKeyRangesFromSchemasReplace has cognitive complexity 37 (threshold 15). Drivers by points: if/else 28, loops 7, boolean chains 2 (nesting depth added 15). Of this number, 34 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":"br/pkg/task/stream.go"},"region":{"startLine":2595}}}],"partialFingerprints":{"codehealthFindingId/v1":"f5214eb8dd54ae445f9b186010b3e2d657529f5ed2646e8b435fe67420f1964e"}},{"ruleId":"D2","level":"warning","message":{"text":"executor.DropTablePartition (cognitive 37): executor.DropTablePartition has cognitive complexity 37 (threshold 15). Drivers by points: if/else 27, loops 6, boolean chains 4 (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":"pkg/ddl/executor.go"},"region":{"startLine":2909}}}],"partialFingerprints":{"codehealthFindingId/v1":"be0dfd73af566261c1f0b416582c653d0024cad0cacc4c6ed829ccb3f502a6f9"}},{"ruleId":"D2","level":"warning","message":{"text":"worker.onRecoverSchema (cognitive 37): worker.onRecoverSchema has cognitive complexity 37 (threshold 15). Drivers by points: if/else 31, loops 5, match/switch 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":"pkg/ddl/schema.go"},"region":{"startLine":264}}}],"partialFingerprints":{"codehealthFindingId/v1":"6a1d2a57c4bd8c4a62b7996ff5a15f672efba23e7052a8d45d015521aade7e35"}},{"ruleId":"D2","level":"warning","message":{"text":"jobsubmit.SubmitBatch (cognitive 37): jobsubmit.SubmitBatch has cognitive complexity 37 (threshold 15). Drivers by points: if/else 27, boolean chains 5, loops 5 (nesting depth added 15). Of this number, 36 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":"pkg/ddl/jobsubmit/submit.go"},"region":{"startLine":53}}}],"partialFingerprints":{"codehealthFindingId/v1":"1bee61464f0748bf7e4d416d7ed56b7b626d5d5abf7d0747e69dae76fb2d7710"}},{"ruleId":"D2","level":"warning","message":{"text":"Domain.checkReplicaRead (cognitive 37): Domain.checkReplicaRead has cognitive complexity 37 (threshold 15). Drivers by points: if/else 27, loops 6, boolean chains 4 (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":"pkg/domain/domain.go"},"region":{"startLine":1002}}}],"partialFingerprints":{"codehealthFindingId/v1":"326cd528975330d0f1b2f94ecba3c7ab51da21ff5156b71b74693a9791b13fea"}},{"ruleId":"D2","level":"warning","message":{"text":"MockDataSource.GenColDatums (cognitive 37): MockDataSource.GenColDatums has cognitive complexity 37 (threshold 15). Drivers by points: if/else 24, loops 11, match/switch 2 (nesting depth added 18). Of this number, 35 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":"pkg/executor/internal/testutil/testutil.go"},"region":{"startLine":72}}}],"partialFingerprints":{"codehealthFindingId/v1":"b870201089f83a2fbc1849cb80bcc2b5ffdc33d75812e83aec7afbe905986365"}},{"ruleId":"D2","level":"warning","message":{"text":"innerWorker.constructLookupContent (cognitive 37): innerWorker.constructLookupContent has cognitive complexity 37 (threshold 15). Drivers by points: if/else 29, loops 8 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/join/index_lookup_join.go"},"region":{"startLine":582}}}],"partialFingerprints":{"codehealthFindingId/v1":"bc831ca3f4759fe07290678ffe6b80c0d53afc2d2d74fb053d500cbdfb64d74e"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinBenchmarkSig.vecEvalInt (cognitive 37): builtinBenchmarkSig.vecEvalInt has cognitive complexity 37 (threshold 15). Drivers by points: if/else 22, loops 14, match/switch 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/builtin_info_vec.go"},"region":{"startLine":267}}}],"partialFingerprints":{"codehealthFindingId/v1":"5119ef35d828de22bbe2a38d77af3203085bc4616be4690e791bb905fe01d4ec"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinJSONContainsSig.vecEvalInt (cognitive 37): builtinJSONContainsSig.vecEvalInt has cognitive complexity 37 (threshold 15). Drivers by points: if/else 33, loops 4 (nesting depth added 18). 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/expression/builtin_json_vec.go"},"region":{"startLine":334}}}],"partialFingerprints":{"codehealthFindingId/v1":"cf3815d9408bb12f74434d984d6992cc74945eaadd81ef23089d5fb0ce7dd324"}},{"ruleId":"D2","level":"warning","message":{"text":"core.VisitInfo4PrivCheck (cognitive 37): core.VisitInfo4PrivCheck has cognitive complexity 37 (threshold 15). Drivers by points: if/else 28, loops 8, match/switch 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":"pkg/planner/core/optimizer.go"},"region":{"startLine":214}}}],"partialFingerprints":{"codehealthFindingId/v1":"7cf4a181b1bf45f5821ec38fccffe9afe20ce788a914122753fefd0e9cb69a10"}},{"ruleId":"D2","level":"warning","message":{"text":"mppTaskGenerator.untwistPlanAndRemoveUnionAll (cognitive 37): mppTaskGenerator.untwistPlanAndRemoveUnionAll has cognitive complexity 37 (threshold 15). Drivers by points: if/else 30, loops 6, match/switch 1 (nesting depth added 21). The drivers above price the dispatch low by construction \u2014 a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full \u2014 so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/operator/physicalop/fragment.go"},"region":{"startLine":420}}}],"partialFingerprints":{"codehealthFindingId/v1":"9b2f2ea130da31c9f3410ce261d99f97eba5c9a7ab296b0649de66492d67294a"}},{"ruleId":"D2","level":"warning","message":{"text":"PlanBuilder.buildPhysicalIndexLookUpReaders (cognitive 37): PlanBuilder.buildPhysicalIndexLookUpReaders has cognitive complexity 37 (threshold 15). Drivers by points: if/else 27, boolean chains 6, loops 4 (nesting depth added 18). 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/planner/core/planbuilder.go"},"region":{"startLine":1954}}}],"partialFingerprints":{"codehealthFindingId/v1":"6167908f36073b2a0d5a99705bf214ca1747aea8c265a3a09d52e5d075deac57"}},{"ruleId":"D2","level":"warning","message":{"text":"rule.mergeInAndNotEQLists (cognitive 37): rule.mergeInAndNotEQLists has cognitive complexity 37 (threshold 15). Drivers by points: if/else 31, loops 4, boolean chains 2 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/rule/rule_predicate_simplification.go"},"region":{"startLine":233}}}],"partialFingerprints":{"codehealthFindingId/v1":"9c8cbc57b8b2bcc252c3eb7d72f6cfc5efb0e0ca8b90323606e029c9c54b2baa"}},{"ruleId":"D2","level":"warning","message":{"text":"session.checkPlacementPolicyBeforeCommit (cognitive 37): session.checkPlacementPolicyBeforeCommit has cognitive complexity 37 (threshold 15). Drivers by points: if/else 34, loops 2, boolean chains 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/session/session.go"},"region":{"startLine":5351}}}],"partialFingerprints":{"codehealthFindingId/v1":"7d895068c2eaedfc86b724b22c6fafe91cb8e14a1003125a7b6bd9cb7a902253"}},{"ruleId":"D2","level":"warning","message":{"text":"copIteratorWorker.handleTaskOnce (cognitive 37): copIteratorWorker.handleTaskOnce has cognitive complexity 37 (threshold 15). Drivers by points: if/else 30, boolean chains 5, loops 2 (nesting depth added 5). Of this number, 35 points are the body\u0027s own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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":"pkg/store/copr/coprocessor.go"},"region":{"startLine":1723}}}],"partialFingerprints":{"codehealthFindingId/v1":"8f16a247159349d420e3ab057eb4b01bf3eeae5811babcc5be6cf6b940990ea7"}},{"ruleId":"D2","level":"warning","message":{"text":"cophandler.mppExecute (cognitive 37): cophandler.mppExecute has cognitive complexity 37 (threshold 15). Drivers by points: if/else 28, loops 8, boolean chains 1 (nesting depth added 20). Of this number, 36 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":"pkg/store/mockstore/unistore/cophandler/cop_handler.go"},"region":{"startLine":245}}}],"partialFingerprints":{"codehealthFindingId/v1":"d143dd90de043299631c3b7be160925339112a06e32ec014aebefeb2cd4dd220"}},{"ruleId":"D2","level":"warning","message":{"text":"hookWorker.triggerEvent (cognitive 37): hookWorker.triggerEvent has cognitive complexity 37 (threshold 15). Drivers by points: if/else 36, boolean chains 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/timer/runtime/worker.go"},"region":{"startLine":275}}}],"partialFingerprints":{"codehealthFindingId/v1":"f6dc0dd0230019a401db610d466af8bd82ce2418b0e5d09b09add4fa650568e5"}},{"ruleId":"D2","level":"warning","message":{"text":"ranger.RangeSingleColToString (cognitive 37): ranger.RangeSingleColToString has cognitive complexity 37 (threshold 15). Drivers by points: if/else 30, boolean chains 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":"pkg/util/ranger/ranger.go"},"region":{"startLine":901}}}],"partialFingerprints":{"codehealthFindingId/v1":"46a44d1a63fce87f77fca4e4006d80ada690caed5025eba3304a4d6753cebdb3"}},{"ruleId":"D2","level":"warning","message":{"text":"builder.buildFromIn (cognitive 37): builder.buildFromIn has cognitive complexity 37 (threshold 15). Drivers by points: if/else 30, match/switch 3, boolean chains 2, loops 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/util/ranger/points.go"},"region":{"startLine":620}}}],"partialFingerprints":{"codehealthFindingId/v1":"b686e9bf527c67d1abfee16e4d2b65f83223b650277916dc5e5a9444e20f0449"}},{"ruleId":"D2","level":"warning","message":{"text":"Watcher.pollEvents (cognitive 37): Watcher.pollEvents has cognitive complexity 37 (threshold 15). Drivers by points: if/else 15, match/switch 14, loops 7, boolean chains 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/util/watcher/watcher.go"},"region":{"startLine":188}}}],"partialFingerprints":{"codehealthFindingId/v1":"6813add695ae61ffb2b4d3747aac1dca8beb674f1753d367783e8ddd5ee36c82"}},{"ruleId":"D2","level":"warning","message":{"text":"AlterTableSpec.Accept (cognitive 37): AlterTableSpec.Accept has cognitive complexity 37 (threshold 15). Drivers by points: if/else 33, loops 4 (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":"pkg/parser/ast/ddl.go"},"region":{"startLine":4217}}}],"partialFingerprints":{"codehealthFindingId/v1":"687c5d958bf95f2276a89a2cbadb222c7a05d5548ad6a8ae9f231027e91a7a5d"}},{"ruleId":"D2","level":"warning","message":{"text":"LoadDataStmt.Restore (cognitive 37): LoadDataStmt.Restore has cognitive complexity 37 (threshold 15). Drivers by points: if/else 30, loops 6, match/switch 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":"pkg/parser/ast/dml.go"},"region":{"startLine":2010}}}],"partialFingerprints":{"codehealthFindingId/v1":"e619fdb5de14d10a89a4c38294699b74b4b4352be60e550fd43b0f3dd732c185"}},{"ruleId":"D2","level":"warning","message":{"text":"BackupConfig.ParseFromFlags (cognitive 36): BackupConfig.ParseFromFlags has cognitive complexity 36 (threshold 15). Drivers by points: if/else 36 (nesting depth added 8). 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":"br/pkg/task/backup.go"},"region":{"startLine":167}}}],"partialFingerprints":{"codehealthFindingId/v1":"ba3bd8225fe403c2da460488ac0afa8a7b6a427586016e6f52c744db73aa4074"}},{"ruleId":"D2","level":"warning","message":{"text":"export.recordGlobalMetaData (cognitive 36): export.recordGlobalMetaData has cognitive complexity 36 (threshold 15). Drivers by points: if/else 28, match/switch 4, boolean chains 2, loops 2 (nesting depth added 10). Of this number, 23 points are the body\u0027s own statements and 13 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":"dumpling/export/metadata.go"},"region":{"startLine":69}}}],"partialFingerprints":{"codehealthFindingId/v1":"23c9b801bff2577715f3eed4813efda75e32000de3daf4ef64acefdb8973ce69"}},{"ruleId":"D2","level":"warning","message":{"text":"clusterResourceCheckItem.Check (cognitive 36): clusterResourceCheckItem.Check has cognitive complexity 36 (threshold 15). Drivers by points: if/else 29, loops 4, boolean chains 3 (nesting depth added 14). Of this number, 18 points are the body\u0027s own statements and 18 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":"lightning/pkg/importer/precheck_impl.go"},"region":{"startLine":101}}}],"partialFingerprints":{"codehealthFindingId/v1":"020ddcf089dbf1c96a590a2708913a1de410b48a3525baf89b7beb0e8f2bd1a9"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.SendPrepareFlashbackToVersionRPC (cognitive 36): ddl.SendPrepareFlashbackToVersionRPC has cognitive complexity 36 (threshold 15). Drivers by points: if/else 29, boolean chains 4, match/switch 2, loops 1 (nesting depth added 17). 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, 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/ddl/cluster.go"},"region":{"startLine":455}}}],"partialFingerprints":{"codehealthFindingId/v1":"0641980886369d0e1e21e267fb54263409358d985907670339759442cdd2ef37"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.setColumnFlagWithConstraint (cognitive 36): ddl.setColumnFlagWithConstraint has cognitive complexity 36 (threshold 15). Drivers by points: if/else 29, loops 6, 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":"pkg/ddl/create_table.go"},"region":{"startLine":1201}}}],"partialFingerprints":{"codehealthFindingId/v1":"88dba83b2efab977b0d735a16bb1123ef757fe99ca135d284c281b7d937ad7c5"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.writeChunk (cognitive 36): ddl.writeChunk has cognitive complexity 36 (threshold 15). Drivers by points: if/else 23, loops 9, boolean chains 4 (nesting depth added 17). Of this number, 35 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":"pkg/ddl/index.go"},"region":{"startLine":2705}}}],"partialFingerprints":{"codehealthFindingId/v1":"1f9e08d1045648968f6a0e7a512d0a325cf91f69bcf0ab3a9e0cc9dabb3c32e0"}},{"ruleId":"D2","level":"warning","message":{"text":"worker.onModifyColumn (cognitive 36): worker.onModifyColumn has cognitive complexity 36 (threshold 15). Drivers by points: if/else 28, boolean chains 3, match/switch 3, 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":"pkg/ddl/modify_column.go"},"region":{"startLine":230}}}],"partialFingerprints":{"codehealthFindingId/v1":"d735dab0924a23f9f650b81bdc7fb9e1072db8803c3f35b79a1eb561117cb72d"}},{"ruleId":"D2","level":"warning","message":{"text":"executorBuilder.buildHashJoinV2FromChildExecs (cognitive 36): executorBuilder.buildHashJoinV2FromChildExecs has cognitive complexity 36 (threshold 15). Drivers by points: if/else 24, loops 9, boolean chains 3 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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":"pkg/executor/builder.go"},"region":{"startLine":1798}}}],"partialFingerprints":{"codehealthFindingId/v1":"95ea9edd0fc2873aa5242b43ab9cc4f8a8806b36ee1553b683e263c38998504a"}},{"ruleId":"D2","level":"warning","message":{"text":"IndexMergeReaderExecutor.rebuildRangeForCorCol (cognitive 36): IndexMergeReaderExecutor.rebuildRangeForCorCol has cognitive complexity 36 (threshold 15). Drivers by points: if/else 32, match/switch 3, loops 1 (nesting depth added 25). 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/executor/index_merge_reader.go"},"region":{"startLine":201}}}],"partialFingerprints":{"codehealthFindingId/v1":"85d8106db87db0f31ae21f2f8a048b5f2fc0144e89cdebde3810480ca77523dd"}},{"ruleId":"D2","level":"warning","message":{"text":"partialTableWorker.extractTaskHandles (cognitive 36): partialTableWorker.extractTaskHandles has cognitive complexity 36 (threshold 15). Drivers by points: if/else 32, loops 3, boolean chains 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/executor/index_merge_reader.go"},"region":{"startLine":733}}}],"partialFingerprints":{"codehealthFindingId/v1":"61820dc7bc7bf9506d0efb9c55018beb5a70c962fd60aa17f0527be9fd66c577"}},{"ruleId":"D2","level":"warning","message":{"text":"partialIndexWorker.extractTaskHandles (cognitive 36): partialIndexWorker.extractTaskHandles has cognitive complexity 36 (threshold 15). Drivers by points: if/else 32, loops 3, boolean chains 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/executor/index_merge_reader.go"},"region":{"startLine":1830}}}],"partialFingerprints":{"codehealthFindingId/v1":"8b38a6e2b4d401ec0779cd913760b2809e26c1a271849dd20c42662356197a66"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinJSONObjectSig.vecEvalJSON (cognitive 36): builtinJSONObjectSig.vecEvalJSON has cognitive complexity 36 (threshold 15). Drivers by points: if/else 29, loops 7 (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/expression/builtin_json_vec.go"},"region":{"startLine":619}}}],"partialFingerprints":{"codehealthFindingId/v1":"0108e8b2890ecee85a03d902613742d4c3969bcb7bfea1c715dc340bb0c15ddc"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinJSONContainsPathSig.vecEvalInt (cognitive 36): builtinJSONContainsPathSig.vecEvalInt has cognitive complexity 36 (threshold 15). Drivers by points: if/else 27, loops 5, boolean chains 4 (nesting depth added 13). 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, 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/expression/builtin_json_vec.go"},"region":{"startLine":1172}}}],"partialFingerprints":{"codehealthFindingId/v1":"f86d5df380e0a7f50096ebcf0d083c5fccb7a92ea0d1cc18d8db3f9fe789b3d9"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinJSONArrayAppendSig.vecEvalJSON (cognitive 36): builtinJSONArrayAppendSig.vecEvalJSON has cognitive complexity 36 (threshold 15). Drivers by points: if/else 30, loops 6 (nesting depth added 17). Of this number, 34 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":"pkg/expression/builtin_json_vec.go"},"region":{"startLine":1255}}}],"partialFingerprints":{"codehealthFindingId/v1":"d23fbbb455a8bda82f678eae26a7aee4a7112d3d0fd2f735499e672238d0456c"}},{"ruleId":"D2","level":"warning","message":{"text":"ingestctrl.checkMultiIngestSupport (cognitive 36): ingestctrl.checkMultiIngestSupport has cognitive complexity 36 (threshold 15). Drivers by points: if/else 26, loops 4, match/switch 4, boolean chains 2 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ingestor/ingestctrl/local.go"},"region":{"startLine":713}}}],"partialFingerprints":{"codehealthFindingId/v1":"c74c4f504c32cb0ecd627f14d9834814049e6bebf9b7e6418736a50d6d2a4759"}},{"ruleId":"D2","level":"warning","message":{"text":"dbSSTIngester.mergeSSTs (cognitive 36): dbSSTIngester.mergeSSTs has cognitive complexity 36 (threshold 15). Drivers by points: if/else 32, loops 3, jumps 1 (nesting depth added 12). Of this number, 32 points are the body\u0027s own statements and 4 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":"pkg/ingestor/ingestctrl/engine.go"},"region":{"startLine":1601}}}],"partialFingerprints":{"codehealthFindingId/v1":"8aef47ac9335eb4f1c7ee08b10993699c7a6db0fbaef1dbade6205a83baac93e"}},{"ruleId":"D2","level":"warning","message":{"text":"simplesst.GetReadRangeFromProps (cognitive 36): simplesst.GetReadRangeFromProps has cognitive complexity 36 (threshold 15). Drivers by points: if/else 23, loops 13 (nesting depth added 21). Most of this is not in the body itself: 5 of the 36 points are its own statements and the rest belongs to one function literal inside it that branches (line 193). 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":"pkg/ingestor/simplesst/util.go"},"region":{"startLine":165}}}],"partialFingerprints":{"codehealthFindingId/v1":"79e946df3f3d28b0eb9b83fc1ddc280050481ec33c3d1886c2c916a84ab4ef07"}},{"ruleId":"D2","level":"warning","message":{"text":"config.LoadGlobalConfig (cognitive 36): config.LoadGlobalConfig has cognitive complexity 36 (threshold 15). Drivers by points: if/else 34, boolean chains 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/lightning/config/global.go"},"region":{"startLine":142}}}],"partialFingerprints":{"codehealthFindingId/v1":"cb4253992cc4ebb480a1ee7902a8928c2f7a67f59baca126808ef0773b0919df"}},{"ruleId":"D2","level":"warning","message":{"text":"objstore.getAzureServiceClientBuilder (cognitive 36): objstore.getAzureServiceClientBuilder has cognitive complexity 36 (threshold 15). Drivers by points: if/else 30, boolean chains 6 (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/objstore/azblob.go"},"region":{"startLine":286}}}],"partialFingerprints":{"codehealthFindingId/v1":"714a59c72894ba55598553f92d0b2e7bd137063143912d1f08604820d497707c"}},{"ruleId":"D2","level":"warning","message":{"text":"core.CheckUpdateList (cognitive 36): core.CheckUpdateList has cognitive complexity 36 (threshold 15). Drivers by points: if/else 28, loops 6, boolean chains 2 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/logical_plan_builder.go"},"region":{"startLine":6243}}}],"partialFingerprints":{"codehealthFindingId/v1":"78bbd1f07be020c5b5bae219aced5e1e50ecf7448b420d5fba1992a774c17924"}},{"ruleId":"D2","level":"warning","message":{"text":"core.deriveTablePathStats (cognitive 36): core.deriveTablePathStats has cognitive complexity 36 (threshold 15). Drivers by points: if/else 30, boolean chains 4, loops 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/stats.go"},"region":{"startLine":294}}}],"partialFingerprints":{"codehealthFindingId/v1":"f12379a115fbbc57685ef836ef2d20a02f4b5d2ff55d341e2bf13a1ac0e3013d"}},{"ruleId":"D2","level":"warning","message":{"text":"CollectPredicateColumnsPoint.markAtLeastOneFullStatsLoadForEachTable (cognitive 36): CollectPredicateColumnsPoint.markAtLeastOneFullStatsLoadForEachTable has cognitive complexity 36 (threshold 15). Drivers by points: if/else 27, boolean chains 6, loops 3 (nesting depth added 10). Most of this is not in the body itself: 11 of the 36 points are its own statements and the rest belongs to one function literal inside it that branches (line 139). 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":"pkg/planner/core/rule/rule_collect_plan_stats.go"},"region":{"startLine":108}}}],"partialFingerprints":{"codehealthFindingId/v1":"cadb671f31754b9612aca0c82ceecd2d38540c1d246d5fae0744d8d3ee080e9a"}},{"ruleId":"D2","level":"warning","message":{"text":"MaxMinEliminator.checkColCanUseIndex (cognitive 36): MaxMinEliminator.checkColCanUseIndex has cognitive complexity 36 (threshold 15). Drivers by points: if/else 26, loops 6, boolean chains 3, match/switch 1 (nesting depth added 23). 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":"pkg/planner/core/rule/rule_max_min_eliminate.go"},"region":{"startLine":63}}}],"partialFingerprints":{"codehealthFindingId/v1":"54ccf4273c7bac80cc8e26df319140426c60f37c3eec04b8f9f6a97a03439d19"}},{"ruleId":"D2","level":"warning","message":{"text":"CorrelateSolver.correlate (cognitive 36): CorrelateSolver.correlate has cognitive complexity 36 (threshold 15). Drivers by points: if/else 25, boolean chains 7, loops 4 (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/planner/core/rule_correlate.go"},"region":{"startLine":51}}}],"partialFingerprints":{"codehealthFindingId/v1":"f1e397fd1deb5f50b9412590dbbb70bc2d91adfdea9140dfaec93c796793b462"}},{"ruleId":"D2","level":"warning","message":{"text":"joinReorderDPSolver.solve (cognitive 36): joinReorderDPSolver.solve has cognitive complexity 36 (threshold 15). Drivers by points: if/else 19, loops 15, boolean chains 2 (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":"pkg/planner/core/rule_join_reorder_dp.go"},"region":{"startLine":44}}}],"partialFingerprints":{"codehealthFindingId/v1":"80659aa4fff0dcaa7563ebf63da96f74c11d3b355dd94b7dce503c1d57c1911c"}},{"ruleId":"D2","level":"warning","message":{"text":"storage.TableStatsFromJSON (cognitive 36): storage.TableStatsFromJSON has cognitive complexity 36 (threshold 15). Drivers by points: if/else 26, loops 6, boolean chains 4 (nesting depth added 18). 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/statistics/handle/storage/json.go"},"region":{"startLine":135}}}],"partialFingerprints":{"codehealthFindingId/v1":"7d87113eca69f8a7f198d64b6946d1b70d8eead204bb3e9906b670a56977657c"}},{"ruleId":"D2","level":"warning","message":{"text":"tables.IterRecords (cognitive 36): tables.IterRecords has cognitive complexity 36 (threshold 15). Drivers by points: if/else 30, loops 4, boolean chains 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/table/tables/tables.go"},"region":{"startLine":1340}}}],"partialFingerprints":{"codehealthFindingId/v1":"948a69695c66b5c34ea573aa74518292bfd039088afa06c1a3fe2ae4d9c5fd1b"}},{"ruleId":"D2","level":"warning","message":{"text":"tableTimerStoreCore.listWithSctx (cognitive 36): tableTimerStoreCore.listWithSctx has cognitive complexity 36 (threshold 15). Drivers by points: if/else 34, boolean chains 1, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/timer/tablestore/store.go"},"region":{"startLine":131}}}],"partialFingerprints":{"codehealthFindingId/v1":"17250a25d4667807469aee7822bc7e01044517e1be660c96b822b3865e84a9ba"}},{"ruleId":"D2","level":"warning","message":{"text":"types.getValidFloatPrefix (cognitive 36): types.getValidFloatPrefix has cognitive complexity 36 (threshold 15). Drivers by points: if/else 28, boolean chains 7, 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":"pkg/types/convert.go"},"region":{"startLine":703}}}],"partialFingerprints":{"codehealthFindingId/v1":"18ad40dff66dbd3e86590306f7b763f9966a1980c2e5d3688724f48d42aba3b8"}},{"ruleId":"D2","level":"warning","message":{"text":"trieSelector.track (cognitive 36): trieSelector.track has cognitive complexity 36 (threshold 15). Drivers by points: if/else 29, loops 5, match/switch 2 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/util/table-rule-selector/trie_selector.go"},"region":{"startLine":470}}}],"partialFingerprints":{"codehealthFindingId/v1":"2bf34b8fada01310d8b9083c7fcfa3ec904edfec8ddc45edb8fd841b2e0cb5e7"}},{"ruleId":"D2","level":"warning","message":{"text":"AlterUserStmt.Restore (cognitive 36): AlterUserStmt.Restore has cognitive complexity 36 (threshold 15). Drivers by points: if/else 32, loops 4 (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":"pkg/parser/ast/misc.go"},"region":{"startLine":1982}}}],"partialFingerprints":{"codehealthFindingId/v1":"e652a890d9f9704c8d3b0a8cd3a6986c0fb574a9dd9556c71cf432c94f4f6649"}},{"ruleId":"D2","level":"warning","message":{"text":"backup.WriteBackupDDLJobs (cognitive 35): backup.WriteBackupDDLJobs has cognitive complexity 35 (threshold 15). Drivers by points: if/else 28, boolean chains 4, loops 3 (nesting depth added 12). Of this number, 17 points are the body\u0027s own statements and 18 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":"br/pkg/backup/client.go"},"region":{"startLine":989}}}],"partialFingerprints":{"codehealthFindingId/v1":"4d00a96b585a80863ef080c01e3216b6dc7bb7bc0ff28b353781876348b4e5e9"}},{"ruleId":"D2","level":"warning","message":{"text":"Dumper.renewSelectTableRegionFuncForLowerTiDB (cognitive 35): Dumper.renewSelectTableRegionFuncForLowerTiDB has cognitive complexity 35 (threshold 15). Drivers by points: if/else 25, loops 9, boolean chains 1 (nesting depth added 15). Of this number, 28 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":"dumpling/export/dump.go"},"region":{"startLine":1940}}}],"partialFingerprints":{"codehealthFindingId/v1":"67371ea3616a1e70b302f4c3106f9276401c7f73bc6ebec923ca9f19c6dfda48"}},{"ruleId":"D2","level":"warning","message":{"text":"PreImportInfoGetterImpl.EstimateSourceDataSize (cognitive 35): PreImportInfoGetterImpl.EstimateSourceDataSize has cognitive complexity 35 (threshold 15). Drivers by points: if/else 27, boolean chains 4, loops 4 (nesting depth added 18). 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":"lightning/pkg/importer/get_pre_info.go"},"region":{"startLine":530}}}],"partialFingerprints":{"codehealthFindingId/v1":"907906baeb601ca7e6ca646c3a0d24b4d31713328cab182becd8767009845111"}},{"ruleId":"D2","level":"warning","message":{"text":"Controller.listenCheckpointUpdates (cognitive 35): Controller.listenCheckpointUpdates has cognitive complexity 35 (threshold 15). Drivers by points: if/else 23, loops 8, boolean chains 4 (nesting depth added 17). Most of this is not in the body itself: 7 of the 35 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 980, 908, 951, \u2026). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals\u0027 work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lightning/pkg/importer/import.go"},"region":{"startLine":900}}}],"partialFingerprints":{"codehealthFindingId/v1":"483ab5bd75a01a5b7f39815212e7bdfa3b984837b2e8252022a6ce3b138a2f5c"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.getDefaultValue (cognitive 35): ddl.getDefaultValue has cognitive complexity 35 (threshold 15). Drivers by points: if/else 28, boolean chains 6, match/switch 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":"pkg/ddl/add_column.go"},"region":{"startLine":814}}}],"partialFingerprints":{"codehealthFindingId/v1":"aa74e1d64e6e734ffebeb5e95e23a60b5dcc27cd5142ca6756134afdf37fd0c8"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.checkColumnDefaultValue (cognitive 35): ddl.checkColumnDefaultValue has cognitive complexity 35 (threshold 15). Drivers by points: if/else 26, boolean chains 9 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/add_column.go"},"region":{"startLine":1212}}}],"partialFingerprints":{"codehealthFindingId/v1":"4d6c7ba47274e4d1e0e37162cc0b84c8db1f2633d5d901e3fe0c19a5997fdffc"}},{"ruleId":"D2","level":"warning","message":{"text":"HashAggExec.execute (cognitive 35): HashAggExec.execute has cognitive complexity 35 (threshold 15). Drivers by points: if/else 27, loops 6, boolean chains 2 (nesting depth added 19). Of this number, 31 points are the body\u0027s own statements and 4 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":"pkg/executor/aggregate/agg_hash_executor.go"},"region":{"startLine":732}}}],"partialFingerprints":{"codehealthFindingId/v1":"3921752fa19f5acbb05eb302649a4f3592b725137c17e703af674ab3d368b907"}},{"ruleId":"D2","level":"warning","message":{"text":"Executor.getTiDBQuota (cognitive 35): Executor.getTiDBQuota has cognitive complexity 35 (threshold 15). Drivers by points: if/else 24, boolean chains 7, loops 4 (nesting depth added 8). Of this number, 23 points are the body\u0027s own statements and 12 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/internal/calibrateresource/calibrate_resource.go"},"region":{"startLine":289}}}],"partialFingerprints":{"codehealthFindingId/v1":"9cc8a53fcab87b97d3ef46cbcca92051fa16f59a52e4a611cab1e74dc1f6d671"}},{"ruleId":"D2","level":"warning","message":{"text":"leftOuterSemiJoinProbe.buildResult (cognitive 35): leftOuterSemiJoinProbe.buildResult has cognitive complexity 35 (threshold 15). Drivers by points: if/else 20, loops 12, boolean chains 3 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/join/left_outer_semi_join_probe.go"},"region":{"startLine":175}}}],"partialFingerprints":{"codehealthFindingId/v1":"52fa6a489096fc377d953493770048d66fdc274a56bb5ee461dbff6a36728676"}},{"ruleId":"D2","level":"warning","message":{"text":"SimpleExec.setDefaultRoleRegular (cognitive 35): SimpleExec.setDefaultRoleRegular has cognitive complexity 35 (threshold 15). Drivers by points: if/else 30, loops 5 (nesting depth added 18). 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/executor/simple.go"},"region":{"startLine":256}}}],"partialFingerprints":{"codehealthFindingId/v1":"70b8928ab2ec9efdee9a83b8ac9d37d4c9cefaba3dc722826bd5817d919196ec"}},{"ruleId":"D2","level":"warning","message":{"text":"expression.vecJSONModify (cognitive 35): expression.vecJSONModify has cognitive complexity 35 (threshold 15). Drivers by points: if/else 28, loops 7 (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":"pkg/expression/builtin_json_vec.go"},"region":{"startLine":32}}}],"partialFingerprints":{"codehealthFindingId/v1":"925ac1fa4e64bf6ab54f102f99e5a291659947e39cf8603d52ec1ab4eea67f19"}},{"ruleId":"D2","level":"warning","message":{"text":"expression.eliminateCastFunction (cognitive 35): expression.eliminateCastFunction has cognitive complexity 35 (threshold 15). Drivers by points: if/else 26, loops 6, boolean chains 2, 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":"pkg/expression/util.go"},"region":{"startLine":993}}}],"partialFingerprints":{"codehealthFindingId/v1":"721f3154658400c9d8e384493bbb83a7b97ea896da5f0a10cea8971d0cd797f5"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinJSONLengthSig.vecEvalInt (cognitive 35): builtinJSONLengthSig.vecEvalInt has cognitive complexity 35 (threshold 15). Drivers by points: if/else 29, loops 4, boolean chains 2 (nesting depth added 18). 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/expression/builtin_json_vec.go"},"region":{"startLine":824}}}],"partialFingerprints":{"codehealthFindingId/v1":"015b35ae0fcfe31ae54266198cea679bb689e2e2875c065c28f1bed2c5b576c7"}},{"ruleId":"D2","level":"warning","message":{"text":"Engine.loadRangeBatchData (cognitive 35): Engine.loadRangeBatchData has cognitive complexity 35 (threshold 15). Drivers by points: if/else 27, loops 5, match/switch 2, boolean chains 1 (nesting depth added 14). Of this number, 27 points are the body\u0027s own statements and 8 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":"pkg/ingestor/globalsort/engine.go"},"region":{"startLine":253}}}],"partialFingerprints":{"codehealthFindingId/v1":"cce99562e0b490964acf8d69aa03fe76a4101fd361f34a524ee272d1190b54d0"}},{"ruleId":"D2","level":"warning","message":{"text":"Checker.CheckTableLock (cognitive 35): Checker.CheckTableLock has cognitive complexity 35 (threshold 15). Drivers by points: if/else 20, match/switch 7, boolean chains 6, loops 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/lock/lock.go"},"region":{"startLine":45}}}],"partialFingerprints":{"codehealthFindingId/v1":"0add875aaa6016419e1b9cea9b1333a8cdbb85a1182cee768774cacc60940f24"}},{"ruleId":"D2","level":"warning","message":{"text":"ResourceGroupSettings.String (cognitive 35): ResourceGroupSettings.String has cognitive complexity 35 (threshold 15). Drivers by points: if/else 34, match/switch 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":"pkg/meta/model/resource_group.go"},"region":{"startLine":78}}}],"partialFingerprints":{"codehealthFindingId/v1":"5b264412d68b7515108b2e3da0db88f4c4fd81e74e2cca6589252ade4af2ec0e"}},{"ruleId":"D2","level":"warning","message":{"text":"LogicalJoin.ExtractFDForOuterJoin (cognitive 35): LogicalJoin.ExtractFDForOuterJoin has cognitive complexity 35 (threshold 15). Drivers by points: if/else 26, loops 5, boolean chains 4 (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":"pkg/planner/core/operator/logicalop/logical_join.go"},"region":{"startLine":857}}}],"partialFingerprints":{"codehealthFindingId/v1":"daee7801c0221c1a3aebd1827a4fedc66418081943037150672eeef565d24596"}},{"ruleId":"D2","level":"warning","message":{"text":"PhysicalIndexJoin.ResolveIndices (cognitive 35): PhysicalIndexJoin.ResolveIndices has cognitive complexity 35 (threshold 15). Drivers by points: if/else 25, loops 8, boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/operator/physicalop/physical_index_join.go"},"region":{"startLine":374}}}],"partialFingerprints":{"codehealthFindingId/v1":"3b8dc016254eca2f2525e6d0635920c08e20df1a99e69c00dedc37e485503f33"}},{"ruleId":"D2","level":"warning","message":{"text":"PlanBuilder.buildInsert (cognitive 35): PlanBuilder.buildInsert has cognitive complexity 35 (threshold 15). Drivers by points: if/else 31, loops 2, boolean chains 1, match/switch 1 (nesting depth added 8). Of this number, 33 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: 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":"pkg/planner/core/planbuilder.go"},"region":{"startLine":4111}}}],"partialFingerprints":{"codehealthFindingId/v1":"e309368c25b04a23c48aaf2419336a38d2f18c9a5a5cf7bb456e10f479a792b2"}},{"ruleId":"D2","level":"warning","message":{"text":"rule.joinCondNullRejectsInnerCol (cognitive 35): rule.joinCondNullRejectsInnerCol has cognitive complexity 35 (threshold 15). Drivers by points: if/else 28, match/switch 3, boolean chains 2, loops 2 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/rule/rule_outer_join_to_semi_join.go"},"region":{"startLine":335}}}],"partialFingerprints":{"codehealthFindingId/v1":"75ac67ecc514acbe786699468fa61d8e6a9d5c3727c7b2ea9e31274b275325e6"}},{"ruleId":"D2","level":"warning","message":{"text":"aggregationEliminateChecker.tryToEliminateDistinct (cognitive 35): aggregationEliminateChecker.tryToEliminateDistinct has cognitive complexity 35 (threshold 15). Drivers by points: if/else 23, loops 12 (nesting depth added 25). 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/planner/core/rule_aggregation_elimination.go"},"region":{"startLine":90}}}],"partialFingerprints":{"codehealthFindingId/v1":"713c39c198a8a59c6e5c473e3f97d50d7caa0af83dd81257a528998a3c2ad9f4"}},{"ruleId":"D2","level":"warning","message":{"text":"optimizor.handleDownloadFile (cognitive 35): optimizor.handleDownloadFile has cognitive complexity 35 (threshold 15). Drivers by points: if/else 31, boolean chains 3, 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":"pkg/server/handler/optimizor/plan_replayer.go"},"region":{"startLine":87}}}],"partialFingerprints":{"codehealthFindingId/v1":"86d68a9822c4f586d5c511c30131b614b60106520ec20468d848a6ccd5331e7b"}},{"ruleId":"D2","level":"warning","message":{"text":"session.buildShardJobs (cognitive 35): session.buildShardJobs has cognitive complexity 35 (threshold 15). Drivers by points: if/else 31, loops 3, boolean chains 1 (nesting depth added 17). Of this number, 32 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":"pkg/session/nontransactional.go"},"region":{"startLine":446}}}],"partialFingerprints":{"codehealthFindingId/v1":"e51cd3658c0a0147a93b0e1af380de67dbc6c41d6abc2fb750d03e47f87f5d3f"}},{"ruleId":"D2","level":"warning","message":{"text":"variable.setPipelinedDmlResourcePolicy (cognitive 35): variable.setPipelinedDmlResourcePolicy has cognitive complexity 35 (threshold 15). Drivers by points: if/else 24, boolean chains 5, match/switch 4, loops 2 (nesting depth added 19). Of this number, 34 points are the body\u0027s own statements and 1 belongs 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":"pkg/sessionctx/variable/sysvar.go"},"region":{"startLine":4167}}}],"partialFingerprints":{"codehealthFindingId/v1":"21905a0ef57c1d2cae3cb7298ddc0c19b482c6692cc836b5d0f17b8518fc8e9d"}},{"ruleId":"D2","level":"warning","message":{"text":"AnalysisPriorityQueue.tryCreateJob (cognitive 35): AnalysisPriorityQueue.tryCreateJob has cognitive complexity 35 (threshold 15). Drivers by points: if/else 29, loops 6 (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":"pkg/statistics/handle/autoanalyze/priorityqueue/queue.go"},"region":{"startLine":838}}}],"partialFingerprints":{"codehealthFindingId/v1":"fe6bf8de08edd73e6a73d4f34ffbefb7131dab80ec178aad9ebbbae82065c488"}},{"ruleId":"D2","level":"warning","message":{"text":"Helper.GetMvccByEncodedKeyWithTS (cognitive 35): Helper.GetMvccByEncodedKeyWithTS has cognitive complexity 35 (threshold 15). Drivers by points: if/else 33, boolean chains 1, 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":"pkg/store/helper/helper.go"},"region":{"startLine":136}}}],"partialFingerprints":{"codehealthFindingId/v1":"564187d91d9a968ef3e784628b771034dcdae134d1685fe9792cd3ddc2d009a5"}},{"ruleId":"D2","level":"warning","message":{"text":"JobManager.jobLoopWithSession (cognitive 35): JobManager.jobLoopWithSession has cognitive complexity 35 (threshold 15). Drivers by points: if/else 31, match/switch 2, boolean chains 1, 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":"pkg/ttl/ttlworker/job_manager.go"},"region":{"startLine":173}}}],"partialFingerprints":{"codehealthFindingId/v1":"f24ddbd77af2e8f2589e35b775f09e6b77593bfb9ac67f16b3e403e856700f43"}},{"ruleId":"D2","level":"warning","message":{"text":"MemArbitrator.doReclaimMemByPriority (cognitive 35): MemArbitrator.doReclaimMemByPriority has cognitive complexity 35 (threshold 15). Drivers by points: if/else 26, loops 8, 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":"pkg/util/memory/arbitrator.go"},"region":{"startLine":1588}}}],"partialFingerprints":{"codehealthFindingId/v1":"fe4727c78fa6c7ec6a2c30aea3527cf5fead3dbec7576e4526fd2183859f6620"}},{"ruleId":"D2","level":"warning","message":{"text":"ranger.handleEnumFromBinOp (cognitive 35): ranger.handleEnumFromBinOp has cognitive complexity 35 (threshold 15). Drivers by points: if/else 30, match/switch 3, boolean chains 1, 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":"pkg/util/ranger/points.go"},"region":{"startLine":519}}}],"partialFingerprints":{"codehealthFindingId/v1":"e18f7c9a5622420740abc69faa766361d47c8e2340e31fc58acf90602466dc1b"}},{"ruleId":"D2","level":"warning","message":{"text":"ranger.RangesToString (cognitive 35): ranger.RangesToString has cognitive complexity 35 (threshold 15). Drivers by points: if/else 28, loops 4, boolean chains 3 (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/util/ranger/ranger.go"},"region":{"startLine":841}}}],"partialFingerprints":{"codehealthFindingId/v1":"51083b26dc0cf5a3d9901ce2e8c1bc8396daccc509a6d7406c3f681b0b0113d0"}},{"ruleId":"D2","level":"warning","message":{"text":"servermemorylimit.killSessIfNeeded (cognitive 35): servermemorylimit.killSessIfNeeded has cognitive complexity 35 (threshold 15). Drivers by points: if/else 34, jumps 1 (nesting depth added 18). Of this number, 34 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":"pkg/util/servermemorylimit/servermemorylimit.go"},"region":{"startLine":103}}}],"partialFingerprints":{"codehealthFindingId/v1":"1e00e7371a02774c59fddfdf57cb2b9d9f281415d7a23079c51c4002ad16ac09"}},{"ruleId":"D2","level":"warning","message":{"text":"Constraint.Restore (cognitive 35): Constraint.Restore has cognitive complexity 35 (threshold 15). Drivers by points: if/else 31, boolean chains 2, loops 1, match/switch 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/parser/ast/ddl.go"},"region":{"startLine":972}}}],"partialFingerprints":{"codehealthFindingId/v1":"e2d928169b9b1a71ebdcb3ea11453e9fbd98917b021d4e4007115f5bed66f6a0"}},{"ruleId":"D2","level":"warning","message":{"text":"PartitionMethod.Restore (cognitive 35): PartitionMethod.Restore has cognitive complexity 35 (threshold 15). Drivers by points: if/else 30, boolean chains 2, 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":"pkg/parser/ast/ddl.go"},"region":{"startLine":4771}}}],"partialFingerprints":{"codehealthFindingId/v1":"7df5b6f121e9506a65e63bbe2a884b898b9719547b0c04d2cf1a3236c472986a"}},{"ruleId":"D2","level":"warning","message":{"text":"Join.Restore (cognitive 35): Join.Restore has cognitive complexity 35 (threshold 15). Drivers by points: if/else 26, match/switch 4, boolean chains 3, loops 2 (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/parser/ast/dml.go"},"region":{"startLine":164}}}],"partialFingerprints":{"codehealthFindingId/v1":"5aa47c6581db334c024f1826ab6d4cb035d842361c172fd97a198be1c9fe6f2f"}},{"ruleId":"D2","level":"warning","message":{"text":"UpdateStmt.Restore (cognitive 35): UpdateStmt.Restore has cognitive complexity 35 (threshold 15). Drivers by points: if/else 32, loops 3 (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":"pkg/parser/ast/dml.go"},"region":{"startLine":2960}}}],"partialFingerprints":{"codehealthFindingId/v1":"c755801481de447c95b32257036c3669f2db39be4364fe127bbba0c36aeefa4c"}},{"ruleId":"D2","level":"warning","message":{"text":"sqlDigester.normalize (cognitive 35): sqlDigester.normalize has cognitive complexity 35 (threshold 15). Drivers by points: if/else 28, boolean chains 4, loops 2, jumps 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":"pkg/parser/digester.go"},"region":{"startLine":216}}}],"partialFingerprints":{"codehealthFindingId/v1":"5901c3f1f835efe65df954e225197c73dc977ec4cc61002b5e5fcc459563eb66"}},{"ruleId":"D2","level":"warning","message":{"text":"task.RunStreamTruncate (cognitive 34): task.RunStreamTruncate has cognitive complexity 34 (threshold 15). Drivers by points: if/else 29, boolean chains 3, loops 2 (nesting depth added 7). Of this number, 33 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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":"br/pkg/task/stream.go"},"region":{"startLine":1142}}}],"partialFingerprints":{"codehealthFindingId/v1":"e0bc35a34dd67821d3f35e7acd4667a7e866bb58ae6d2f577c52abadc0a8786a"}},{"ruleId":"D2","level":"warning","message":{"text":"runningJobs.checkRunnable (cognitive 34): runningJobs.checkRunnable has cognitive complexity 34 (threshold 15). Drivers by points: if/else 24, boolean chains 5, loops 3, match/switch 2 (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":"pkg/ddl/ddl_running_jobs.go"},"region":{"startLine":87}}}],"partialFingerprints":{"codehealthFindingId/v1":"bd3151604263dee26523f18854ed6c2fd03a4c5e70a30266dd4b203bf543eda6"}},{"ruleId":"D2","level":"warning","message":{"text":"worker.onCreateColumnarIndex (cognitive 34): worker.onCreateColumnarIndex has cognitive complexity 34 (threshold 15). Drivers by points: if/else 32, boolean chains 1, match/switch 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":"pkg/ddl/index.go"},"region":{"startLine":892}}}],"partialFingerprints":{"codehealthFindingId/v1":"15a32970757ecdf6c14f8318845d7d6e82d8f5147f1effa373df26b31cfe17bb"}},{"ruleId":"D2","level":"warning","message":{"text":"selectResultRuntimeStats.String (cognitive 34): selectResultRuntimeStats.String has cognitive complexity 34 (threshold 15). Drivers by points: if/else 32, loops 2 (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":"pkg/distsql/select_result.go"},"region":{"startLine":1112}}}],"partialFingerprints":{"codehealthFindingId/v1":"12440db1b9b40ea929cf4cfe977cf3adf735973575617ce693117e73f75fff5f"}},{"ruleId":"D2","level":"warning","message":{"text":"jobhistory.GetFromHistory (cognitive 34): jobhistory.GetFromHistory has cognitive complexity 34 (threshold 15). Drivers by points: if/else 28, boolean chains 2, loops 2, match/switch 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/dxf/importinto/jobhistory/history.go"},"region":{"startLine":66}}}],"partialFingerprints":{"codehealthFindingId/v1":"c2932353bd741789297fb3e94e0650104c9d1310591c0ed1c0bb9ec0b0b56791"}},{"ruleId":"D2","level":"warning","message":{"text":"executor.fetchClusterConfig (cognitive 34): executor.fetchClusterConfig has cognitive complexity 34 (threshold 15). Drivers by points: if/else 22, loops 7, match/switch 5 (nesting depth added 16). Most of this is not in the body itself: 9 of the 34 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 212, 189). 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":"pkg/executor/memtable_reader.go"},"region":{"startLine":179}}}],"partialFingerprints":{"codehealthFindingId/v1":"6326b63c42f7e6a4d9592c21f28f5aa97de78bcceffc1f05b482d6e7de57388d"}},{"ruleId":"D2","level":"warning","message":{"text":"tableWorker.executeTask (cognitive 34): tableWorker.executeTask has cognitive complexity 34 (threshold 15). Drivers by points: if/else 24, loops 9, boolean chains 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":"pkg/executor/distsql.go"},"region":{"startLine":2145}}}],"partialFingerprints":{"codehealthFindingId/v1":"760aba92c6ec235a5645d6ac914018b36a7acf842309921d366934d3a7c5263c"}},{"ruleId":"D2","level":"warning","message":{"text":"inspectionResultRetriever.retrieve (cognitive 34): inspectionResultRetriever.retrieve has cognitive complexity 34 (threshold 15). Drivers by points: if/else 26, loops 7, boolean chains 1 (nesting depth added 16). Of this number, 23 points are the body\u0027s own statements and 11 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":"pkg/executor/inspection_result.go"},"region":{"startLine":117}}}],"partialFingerprints":{"codehealthFindingId/v1":"20c2b6079862edef4f695a92ea66a6fa769c857bed995777548c2200e989af37"}},{"ruleId":"D2","level":"warning","message":{"text":"ParallelNestedLoopApplyExec.fetchAllInners (cognitive 34): ParallelNestedLoopApplyExec.fetchAllInners has cognitive complexity 34 (threshold 15). Drivers by points: if/else 26, loops 4, match/switch 4 (nesting depth added 14). Of this number, 31 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":"pkg/executor/parallel_apply.go"},"region":{"startLine":631}}}],"partialFingerprints":{"codehealthFindingId/v1":"97053c745b5b55f565686f2d1d9c9951b92373efe60ff9a04c4b11fec6c90fe8"}},{"ruleId":"D2","level":"warning","message":{"text":"expression.scalarExprSupportedByFlash (cognitive 34): expression.scalarExprSupportedByFlash has cognitive complexity 34 (threshold 15). Drivers by points: match/switch 27, boolean chains 5, if/else 2 (nesting depth added 14). 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/expression/infer_pushdown.go"},"region":{"startLine":292}}}],"partialFingerprints":{"codehealthFindingId/v1":"a92e60e914b7a86983df21c6699b501d898e6ff0901808d64cd7057512e6ff1e"}},{"ruleId":"D2","level":"warning","message":{"text":"unaryMinusFunctionClass.getFunction (cognitive 34): unaryMinusFunctionClass.getFunction has cognitive complexity 34 (threshold 15). Drivers by points: if/else 29, boolean chains 4, match/switch 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":"pkg/expression/builtin_op.go"},"region":{"startLine":1018}}}],"partialFingerprints":{"codehealthFindingId/v1":"665826e1b6842272ae712dd8752601f5e079395eb59d464deab57a8bce902882"}},{"ruleId":"D2","level":"warning","message":{"text":"dupeDetector.RecordIndexConflictError (cognitive 34): dupeDetector.RecordIndexConflictError has cognitive complexity 34 (threshold 15). Drivers by points: if/else 31, loops 2, boolean chains 1 (nesting depth added 15). Of this number, 27 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/ingestor/ingestctrl/duplicate.go"},"region":{"startLine":553}}}],"partialFingerprints":{"codehealthFindingId/v1":"4489ba321b6f5d4dcba447ad551ceabef9276708fe91a3aa8f9b1fe3c07f086a"}},{"ruleId":"D2","level":"warning","message":{"text":"mydump.buildViewImportPlan (cognitive 34): mydump.buildViewImportPlan has cognitive complexity 34 (threshold 15). Drivers by points: if/else 22, loops 12 (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":"pkg/lightning/mydump/view_import.go"},"region":{"startLine":294}}}],"partialFingerprints":{"codehealthFindingId/v1":"3e571c5dd450faf1ec34fb302c33c917f927f60a76c04077f04695a55535cac8"}},{"ruleId":"D2","level":"warning","message":{"text":"core.GeneratePlanCacheStmtWithAST (cognitive 34): core.GeneratePlanCacheStmtWithAST has cognitive complexity 34 (threshold 15). Drivers by points: if/else 23, boolean chains 6, loops 4, match/switch 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":"pkg/planner/core/plan_cache_utils.go"},"region":{"startLine":92}}}],"partialFingerprints":{"codehealthFindingId/v1":"c94079aff8cc03d9fe2d478a4130a929fbcac85848923f8439513ebbf7eed890"}},{"ruleId":"D2","level":"warning","message":{"text":"BasePhysicalAgg.canUse3Stage4MultiDistinctAgg (cognitive 34): BasePhysicalAgg.canUse3Stage4MultiDistinctAgg has cognitive complexity 34 (threshold 15). Drivers by points: if/else 24, loops 8, boolean chains 2 (nesting depth added 16). Of this number, 31 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":"pkg/planner/core/operator/physicalop/base_physical_agg.go"},"region":{"startLine":348}}}],"partialFingerprints":{"codehealthFindingId/v1":"679d1b3cebee461db9fd44de781a7be12190094b4970057d89239e9617d768a9"}},{"ruleId":"D2","level":"warning","message":{"text":"PhysicalIndexScan.InitSchema (cognitive 34): PhysicalIndexScan.InitSchema has cognitive complexity 34 (threshold 15). Drivers by points: if/else 23, loops 6, boolean chains 5 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/operator/physicalop/physical_index_scan.go"},"region":{"startLine":363}}}],"partialFingerprints":{"codehealthFindingId/v1":"a3b85563c0d0a0bbcccaabb144ce286440e71a7b8bfaf737d8adc80f68784adb"}},{"ruleId":"D2","level":"warning","message":{"text":"PlanBuilder.resolveWindowFunction (cognitive 34): PlanBuilder.resolveWindowFunction has cognitive complexity 34 (threshold 15). Drivers by points: if/else 26, loops 8 (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":"pkg/planner/core/logical_plan_builder.go"},"region":{"startLine":3054}}}],"partialFingerprints":{"codehealthFindingId/v1":"f260392900181d7609b2e79f2941caa9230b3d08f7e25fbdb934418909e7d2b1"}},{"ruleId":"D2","level":"warning","message":{"text":"session.runJobs (cognitive 34): session.runJobs has cognitive complexity 34 (threshold 15). Drivers by points: if/else 23, loops 5, boolean chains 4, match/switch 2 (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":"pkg/session/nontransactional.go"},"region":{"startLine":268}}}],"partialFingerprints":{"codehealthFindingId/v1":"1879e57fb54fb9dae77872962866aa0702ab4d4ff6020dd11629d7f07092a771"}},{"ruleId":"D2","level":"warning","message":{"text":"AsyncMergePartitionStats2GlobalStats.prepare (cognitive 34): AsyncMergePartitionStats2GlobalStats.prepare has cognitive complexity 34 (threshold 15). Drivers by points: if/else 29, 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":"pkg/statistics/handle/globalstats/global_stats_async.go"},"region":{"startLine":124}}}],"partialFingerprints":{"codehealthFindingId/v1":"3d26f94784d16d17bd68dad8aadb143a50f5f15b5cadbbf283282778b0c1e2c2"}},{"ruleId":"D2","level":"warning","message":{"text":"copr.buildBatchCopTasksConsistentHash (cognitive 34): copr.buildBatchCopTasksConsistentHash has cognitive complexity 34 (threshold 15). Drivers by points: if/else 26, loops 7, boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/store/copr/batch_coprocessor.go"},"region":{"startLine":602}}}],"partialFingerprints":{"codehealthFindingId/v1":"ade957bc3e9f52605386405e669d2713cff5124a2c6b3fa16780f0f83378f124"}},{"ruleId":"D2","level":"warning","message":{"text":"MPPClient.DispatchMPPTask (cognitive 34): MPPClient.DispatchMPPTask has cognitive complexity 34 (threshold 15). Drivers by points: if/else 26, boolean chains 4, loops 4 (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":"pkg/store/copr/mpp.go"},"region":{"startLine":94}}}],"partialFingerprints":{"codehealthFindingId/v1":"fc9a28af7fae7ebf026a25f6935f6bee4f5a8585f51006ced828722d9a8e3043"}},{"ruleId":"D2","level":"warning","message":{"text":"MVCCStore.buildPessimisticLock (cognitive 34): MVCCStore.buildPessimisticLock has cognitive complexity 34 (threshold 15). Drivers by points: if/else 32, boolean chains 2 (nesting depth added 18). 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/store/mockstore/unistore/tikv/mvcc.go"},"region":{"startLine":663}}}],"partialFingerprints":{"codehealthFindingId/v1":"280a8e7270a645098f6e6a399b4e4b64b25a4193666f931cb34277f689eea67c"}},{"ruleId":"D2","level":"warning","message":{"text":"ResourceGroupOption.Restore (cognitive 34): ResourceGroupOption.Restore has cognitive complexity 34 (threshold 15). Drivers by points: if/else 25, loops 6, match/switch 3 (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":"pkg/parser/ast/ddl.go"},"region":{"startLine":2519}}}],"partialFingerprints":{"codehealthFindingId/v1":"63a9283a75f747396a2956fcb7d95eabb3fd46b6f4358bbe211cf5018b16c9d0"}},{"ruleId":"D2","level":"warning","message":{"text":"ImportIntoStmt.Restore (cognitive 34): ImportIntoStmt.Restore has cognitive complexity 34 (threshold 15). Drivers by points: if/else 28, loops 6 (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":"pkg/parser/ast/dml.go"},"region":{"startLine":2245}}}],"partialFingerprints":{"codehealthFindingId/v1":"c047c6afc99e406bf950d818b3ad67c33b9ba67df8391749360e7adb9c842832"}},{"ruleId":"D2","level":"warning","message":{"text":"SnapClient.AllocTableIDs (cognitive 33): SnapClient.AllocTableIDs has cognitive complexity 33 (threshold 15). Drivers by points: if/else 27, boolean chains 3, loops 3 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"br/pkg/restore/snap_client/client.go"},"region":{"startLine":407}}}],"partialFingerprints":{"codehealthFindingId/v1":"e0d4fd1d3363e8cb633d057ccc78dbac9ca6dee7c3cfc2b4bb935118245fdd51"}},{"ruleId":"D2","level":"warning","message":{"text":"main.main (cognitive 33): main.main has cognitive complexity 33 (threshold 15). Drivers by points: if/else 27, boolean chains 6 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/tidb-server/main.go"},"region":{"startLine":400}}}],"partialFingerprints":{"codehealthFindingId/v1":"c8b1b72ddafdbde697c860826cc508828bac437bebf5d2518dbc8c49783e1f37"}},{"ruleId":"D2","level":"warning","message":{"text":"KeyspaceObservability.Valid (cognitive 33): KeyspaceObservability.Valid has cognitive complexity 33 (threshold 15). Drivers by points: if/else 31, boolean chains 1, 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/config/keyspace_observability.go"},"region":{"startLine":59}}}],"partialFingerprints":{"codehealthFindingId/v1":"b87a2b419f8a34bbd19f78fab8cdb3f7055ac684e922b84e2e79f4095512e653"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.setTableAutoRandomBits (cognitive 33): ddl.setTableAutoRandomBits has cognitive complexity 33 (threshold 15). Drivers by points: if/else 29, match/switch 3, 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":"pkg/ddl/create_table.go"},"region":{"startLine":864}}}],"partialFingerprints":{"codehealthFindingId/v1":"e3274eedb67ade1c3ae40a11df1963d95be872ba36529c649b2044bc5b5f4804"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.checkIndexColumn (cognitive 33): ddl.checkIndexColumn has cognitive complexity 33 (threshold 15). Drivers by points: if/else 27, boolean chains 6 (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/ddl/index.go"},"region":{"startLine":240}}}],"partialFingerprints":{"codehealthFindingId/v1":"ce97c944526aaf3fc438e2dabfbc381c9ee6760879f1e70192e6444f8aa19c4f"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.applySplitPoliciesForTable (cognitive 33): ddl.applySplitPoliciesForTable has cognitive complexity 33 (threshold 15). Drivers by points: if/else 23, boolean chains 5, jumps 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":"pkg/ddl/split_region.go"},"region":{"startLine":236}}}],"partialFingerprints":{"codehealthFindingId/v1":"8a8cb2808b6bcc06ac180404f670ed475d60826bf2d9f7b919a75476f2e4dbfe"}},{"ruleId":"D2","level":"warning","message":{"text":"runningJobs.removeRunningWithoutLock (cognitive 33): runningJobs.removeRunningWithoutLock has cognitive complexity 33 (threshold 15). Drivers by points: if/else 30, match/switch 2, 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":"pkg/ddl/ddl_running_jobs.go"},"region":{"startLine":252}}}],"partialFingerprints":{"codehealthFindingId/v1":"5f3123b6b2bb502fe8fbca24cfc80e1d56278bd61d138112b5248780f275887c"}},{"ruleId":"D2","level":"warning","message":{"text":"worker.analyzeTableInner (cognitive 33): worker.analyzeTableInner has cognitive complexity 33 (threshold 15). Drivers by points: if/else 31, boolean chains 1, match/switch 1 (nesting depth added 15). Of this number, 23 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":"pkg/ddl/index.go"},"region":{"startLine":1532}}}],"partialFingerprints":{"codehealthFindingId/v1":"5e600603eb8eeca9ec615b3f16678a8fa336faae27f342d4c3d41a08b12b5bd0"}},{"ruleId":"D2","level":"warning","message":{"text":"worker.addTableIndex (cognitive 33): worker.addTableIndex has cognitive complexity 33 (threshold 15). Drivers by points: if/else 30, loops 2, boolean chains 1 (nesting depth added 18). 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/ddl/index.go"},"region":{"startLine":2954}}}],"partialFingerprints":{"codehealthFindingId/v1":"3f9100399788f96ad0d586357bea0c0382800103e1bbd4578884a9252dbdd41e"}},{"ruleId":"D2","level":"warning","message":{"text":"worker.transitOneJobStep (cognitive 33): worker.transitOneJobStep has cognitive complexity 33 (threshold 15). Drivers by points: if/else 24, boolean chains 4, loops 3, match/switch 2 (nesting depth added 12). Of this number, 18 points are the body\u0027s own statements and 15 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/ddl/job_worker.go"},"region":{"startLine":591}}}],"partialFingerprints":{"codehealthFindingId/v1":"629bb5e7b46da2000aeee040a36e557ed6cf415859c0c2cfbe84d8fc82d45e4b"}},{"ruleId":"D2","level":"warning","message":{"text":"worker.onDropSchema (cognitive 33): worker.onDropSchema has cognitive complexity 33 (threshold 15). Drivers by points: if/else 28, loops 4, match/switch 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":"pkg/ddl/schema.go"},"region":{"startLine":158}}}],"partialFingerprints":{"codehealthFindingId/v1":"0fb694fbec952568cc8a252eb83cc6074764dfaa70dd5f03ae92821ad02a282b"}},{"ruleId":"D2","level":"warning","message":{"text":"testutils.WriteParquetFile (cognitive 33): testutils.WriteParquetFile has cognitive complexity 33 (threshold 15). Drivers by points: if/else 25, loops 6, match/switch 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/dumpformat/testutils/parquet_writer.go"},"region":{"startLine":167}}}],"partialFingerprints":{"codehealthFindingId/v1":"5e8f149e5d70d5ca932b522154e5e894e2eabe328ea96581dd93051d34c462de"}},{"ruleId":"D2","level":"warning","message":{"text":"executor.dataForAnalyzeStatusHelper (cognitive 33): executor.dataForAnalyzeStatusHelper has cognitive complexity 33 (threshold 15). Drivers by points: if/else 30, boolean chains 2, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/infoschema_reader.go"},"region":{"startLine":2550}}}],"partialFingerprints":{"codehealthFindingId/v1":"183e5a98e49f0b5a1997128ee19f89a865dc064209fe2ee9d82fdfbc9f47a95c"}},{"ruleId":"D2","level":"warning","message":{"text":"HashAggExec.Close (cognitive 33): HashAggExec.Close has cognitive complexity 33 (threshold 15). Drivers by points: if/else 23, loops 10 (nesting depth added 16). Of this number, 30 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":"pkg/executor/aggregate/agg_hash_executor.go"},"region":{"startLine":166}}}],"partialFingerprints":{"codehealthFindingId/v1":"cb2284e84fb1893b8a1a19244d370986ee24da0997480fb3df090c8544c26b91"}},{"ruleId":"D2","level":"warning","message":{"text":"executorBuilder.buildHashJoinFromChildExecs (cognitive 33): executorBuilder.buildHashJoinFromChildExecs has cognitive complexity 33 (threshold 15). Drivers by points: if/else 21, loops 11, 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":"pkg/executor/builder.go"},"region":{"startLine":1976}}}],"partialFingerprints":{"codehealthFindingId/v1":"64f750e79a37f038733d17e96240282718d167653eb210e552164d5b6d5e3433"}},{"ruleId":"D2","level":"warning","message":{"text":"FKCheckExec.checkRows (cognitive 33): FKCheckExec.checkRows has cognitive complexity 33 (threshold 15). Drivers by points: if/else 31, loops 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/foreign_key.go"},"region":{"startLine":557}}}],"partialFingerprints":{"codehealthFindingId/v1":"abab4b3a35dfef1db0746b805c5b3ea4dcf89cb5c4ae83aa9442f137fa0721e3"}},{"ruleId":"D2","level":"warning","message":{"text":"tableStorageStatsRetriever.initialize (cognitive 33): tableStorageStatsRetriever.initialize has cognitive complexity 33 (threshold 15). Drivers by points: if/else 25, loops 8 (nesting depth added 18). Of this number, 32 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":"pkg/executor/infoschema_reader.go"},"region":{"startLine":2440}}}],"partialFingerprints":{"codehealthFindingId/v1":"9d83e1ad39510b1d58433212ff107b1d0aabe10142ba21fa5f943b5868c0f4ee"}},{"ruleId":"D2","level":"warning","message":{"text":"localMppCoordinator.handleAllReports (cognitive 33): localMppCoordinator.handleAllReports has cognitive complexity 33 (threshold 15). Drivers by points: if/else 21, loops 7, boolean chains 3, match/switch 2 (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":"pkg/executor/internal/mpp/local_mpp_coordinator.go"},"region":{"startLine":730}}}],"partialFingerprints":{"codehealthFindingId/v1":"94d058905cb4197c0e02af65d555c10c7a59549b5b481c61c4f130593866c477"}},{"ruleId":"D2","level":"warning","message":{"text":"hashRowContainer.GetNullBucketRows (cognitive 33): hashRowContainer.GetNullBucketRows has cognitive complexity 33 (threshold 15). Drivers by points: if/else 25, loops 7, boolean chains 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/join/hash_table_v1.go"},"region":{"startLine":325}}}],"partialFingerprints":{"codehealthFindingId/v1":"496fb1a6cf9c2075f4bbe01133bf18c0d166e3b02feb4debfc67103ac0c7b752"}},{"ruleId":"D2","level":"warning","message":{"text":"SelectLockExec.Next (cognitive 33): SelectLockExec.Next has cognitive complexity 33 (threshold 15). Drivers by points: if/else 21, loops 10, boolean chains 1, match/switch 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/executor/select.go"},"region":{"startLine":247}}}],"partialFingerprints":{"codehealthFindingId/v1":"74240379909b5096e8fa058b30af8da945afceb01a2444cdd74556beac386e16"}},{"ruleId":"D2","level":"warning","message":{"text":"ShowExec.fetchShowCreateUser (cognitive 33): ShowExec.fetchShowCreateUser has cognitive complexity 33 (threshold 15). Drivers by points: if/else 31, boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/show.go"},"region":{"startLine":1852}}}],"partialFingerprints":{"codehealthFindingId/v1":"cd027bcbd7844044f713fe830f625af65b7c7f89148fdd5e111f4d357d0a9f29"}},{"ruleId":"D2","level":"warning","message":{"text":"ShowExec.fetchShowTableRegions (cognitive 33): ShowExec.fetchShowTableRegions has cognitive complexity 33 (threshold 15). Drivers by points: if/else 26, loops 7 (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":"pkg/executor/show.go"},"region":{"startLine":2247}}}],"partialFingerprints":{"codehealthFindingId/v1":"442c3bcf46bbddf5f28173ad5542d6d28d8e098ce508559c34088bfbf11e41d4"}},{"ruleId":"D2","level":"warning","message":{"text":"expression.TryPushCastIntoControlFunctionForHybridType (cognitive 33): expression.TryPushCastIntoControlFunctionForHybridType has cognitive complexity 33 (threshold 15). Drivers by points: if/else 18, loops 8, boolean chains 5, match/switch 2 (nesting depth added 13). Of this number, 32 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":"pkg/expression/builtin_cast.go"},"region":{"startLine":2898}}}],"partialFingerprints":{"codehealthFindingId/v1":"755c5077b859a16164ad0bced8875f488e8bddcc08e25be4379c505b5248d3ea"}},{"ruleId":"D2","level":"warning","message":{"text":"expression.getBaseCmpType (cognitive 33): expression.getBaseCmpType has cognitive complexity 33 (threshold 15). Drivers by points: boolean chains 22, if/else 11 (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/builtin_compare.go"},"region":{"startLine":1404}}}],"partialFingerprints":{"codehealthFindingId/v1":"92c07e0c380f0339f3cbb859e7cb0c5ee3aa1989d9700292ddbbb5fb1b28b72d"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinArithmeticIntDivideDecimalSig.vecEvalInt (cognitive 33): builtinArithmeticIntDivideDecimalSig.vecEvalInt has cognitive complexity 33 (threshold 15). Drivers by points: if/else 29, boolean chains 2, loops 2 (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":"pkg/expression/builtin_arithmetic_vec.go"},"region":{"startLine":567}}}],"partialFingerprints":{"codehealthFindingId/v1":"9827f7b3d658e3ecfa30d5cd1b6fe151ff30b0a7f8cd50921abb6738b5792597"}},{"ruleId":"D2","level":"warning","message":{"text":"isTrueOrFalseFunctionClass.getFunction (cognitive 33): isTrueOrFalseFunctionClass.getFunction has cognitive complexity 33 (threshold 15). Drivers by points: if/else 27, match/switch 5, 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":"pkg/expression/builtin_op.go"},"region":{"startLine":480}}}],"partialFingerprints":{"codehealthFindingId/v1":"c2a11b9c638c27e3f72ee1919edf19066ed907356d286598af8dd2b96f631c9c"}},{"ruleId":"D2","level":"warning","message":{"text":"Embedder.CreateEmbeddings (cognitive 33): Embedder.CreateEmbeddings has cognitive complexity 33 (threshold 15). Drivers by points: if/else 24, loops 5, match/switch 4 (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":"pkg/inference/embedding/mock/mock.go"},"region":{"startLine":41}}}],"partialFingerprints":{"codehealthFindingId/v1":"326c5dd445a3edcd8a399c39d638a55fbfef469144de859f8a995b46f8a05acf"}},{"ruleId":"D2","level":"warning","message":{"text":"LocalStorage.WalkDir (cognitive 33): LocalStorage.WalkDir has cognitive complexity 33 (threshold 15). Drivers by points: if/else 30, boolean chains 3 (nesting depth added 12). Most of this is not in the body itself: 1 of the 33 points is its own statement and the rest belongs to one function literal inside it that branches (line 141). 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":"pkg/objstore/local.go"},"region":{"startLine":136}}}],"partialFingerprints":{"codehealthFindingId/v1":"4f3efe4884e09fb4edbaf4145e24ac07405aea595ba09ae2ee75f9905f0eddaf"}},{"ruleId":"D2","level":"warning","message":{"text":"core.InjectProjBelowAgg (cognitive 33): core.InjectProjBelowAgg has cognitive complexity 33 (threshold 15). Drivers by points: if/else 16, loops 12, boolean chains 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":"pkg/planner/core/rule_inject_extra_projection.go"},"region":{"startLine":119}}}],"partialFingerprints":{"codehealthFindingId/v1":"6494bec0232ced33677c3c7a02996c1025c429929bd9f567d695998a9a6024a1"}},{"ruleId":"D2","level":"warning","message":{"text":"PlanBuilder.buildSet (cognitive 33): PlanBuilder.buildSet has cognitive complexity 33 (threshold 15). Drivers by points: if/else 28, boolean chains 4, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/planbuilder.go"},"region":{"startLine":779}}}],"partialFingerprints":{"codehealthFindingId/v1":"4f318ce26c2aaef48539312d063b12d95be7a7166909e564e12c58b13d2f1236"}},{"ruleId":"D2","level":"warning","message":{"text":"preprocessor.checkAlterTableGrammar (cognitive 33): preprocessor.checkAlterTableGrammar has cognitive complexity 33 (threshold 15). Drivers by points: if/else 22, loops 6, match/switch 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":"pkg/planner/core/preprocess.go"},"region":{"startLine":1424}}}],"partialFingerprints":{"codehealthFindingId/v1":"60ab158dc817f43deb234b8c98391eb5a64c6eb561586588d04b2334d5eafe5d"}},{"ruleId":"D2","level":"warning","message":{"text":"rule.rewriteJoinEqConds (cognitive 33): rule.rewriteJoinEqConds has cognitive complexity 33 (threshold 15). Drivers by points: if/else 25, boolean chains 5, loops 2, match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/rule/rule_join_key_type_cast.go"},"region":{"startLine":99}}}],"partialFingerprints":{"codehealthFindingId/v1":"49fd1f8fb28227a7da9c6051c3f47314881a14f93993731d0601f7b3ede69cb4"}},{"ruleId":"D2","level":"warning","message":{"text":"MySQLPrivilege.DBIsVisible (cognitive 33): MySQLPrivilege.DBIsVisible has cognitive complexity 33 (threshold 15). Drivers by points: if/else 25, boolean chains 4, loops 4 (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":"pkg/privilege/privileges/cache.go"},"region":{"startLine":1693}}}],"partialFingerprints":{"codehealthFindingId/v1":"eba63cf86f5e3a96766ccb112580a360bb50b4441cb320068396ef9e0316a281"}},{"ruleId":"D2","level":"warning","message":{"text":"clientConn.executePreparedStmtAndWriteResult (cognitive 33): clientConn.executePreparedStmtAndWriteResult has cognitive complexity 33 (threshold 15). Drivers by points: if/else 28, boolean chains 5 (nesting depth added 9). Of this number, 31 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":"pkg/server/conn_stmt.go"},"region":{"startLine":274}}}],"partialFingerprints":{"codehealthFindingId/v1":"ea70da0ede331912b9ea568d1aeff5a3e7860707c4c9276adc78bce4e99d1278"}},{"ruleId":"D2","level":"warning","message":{"text":"session.usePipelinedDmlOrWarn (cognitive 33): session.usePipelinedDmlOrWarn has cognitive complexity 33 (threshold 15). Drivers by points: if/else 27, boolean chains 5, 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":"pkg/session/session.go"},"region":{"startLine":5799}}}],"partialFingerprints":{"codehealthFindingId/v1":"75a59328dce1005033740e7328324a3fd98dd2af77d7ba1ff28b7365b7362781"}},{"ruleId":"D2","level":"warning","message":{"text":"storage.InsertColStats2KV (cognitive 33): storage.InsertColStats2KV has cognitive complexity 33 (threshold 15). Drivers by points: if/else 32, 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":"pkg/statistics/handle/storage/save.go"},"region":{"startLine":408}}}],"partialFingerprints":{"codehealthFindingId/v1":"2bfb52df3d6155be3e1842ba82c6520e84198d9e3712163b070eceeea4c397e1"}},{"ruleId":"D2","level":"warning","message":{"text":"MVCCStore.prewriteOptimistic (cognitive 33): MVCCStore.prewriteOptimistic has cognitive complexity 33 (threshold 15). Drivers by points: if/else 31, loops 2 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/store/mockstore/unistore/tikv/mvcc.go"},"region":{"startLine":791}}}],"partialFingerprints":{"codehealthFindingId/v1":"e97d6dc53aaab55dadb01a7636de5de1017f179b10f269f8dbcd4bbfa4391053"}},{"ruleId":"D2","level":"warning","message":{"text":"tables.checkIndexKeys (cognitive 33): tables.checkIndexKeys has cognitive complexity 33 (threshold 15). Drivers by points: if/else 28, loops 3, boolean chains 2 (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":"pkg/table/tables/mutation_checker.go"},"region":{"startLine":215}}}],"partialFingerprints":{"codehealthFindingId/v1":"8566acf8c3b6560aa9d70687865191e435c334c25fb6c2aa4494c7f1db4931c4"}},{"ruleId":"D2","level":"warning","message":{"text":"MyDecimal.FromBin (cognitive 33): MyDecimal.FromBin has cognitive complexity 33 (threshold 15). Drivers by points: if/else 27, boolean chains 4, 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":"pkg/types/mydecimal.go"},"region":{"startLine":1476}}}],"partialFingerprints":{"codehealthFindingId/v1":"a61f2b34bf9a8f46471a0a6883a7cddcdb8a45881f8c1e359facb7de247ef711"}},{"ruleId":"D2","level":"warning","message":{"text":"staticTestHelper.assertRecursivelyNotEqual (cognitive 33): staticTestHelper.assertRecursivelyNotEqual has cognitive complexity 33 (threshold 15). Drivers by points: if/else 18, loops 10, boolean chains 4, match/switch 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":"pkg/util/deeptest/statictesthelper.go"},"region":{"startLine":54}}}],"partialFingerprints":{"codehealthFindingId/v1":"b8826455b97d770b429a6a4c333fe94f4f1bbda27d7eeebb981fe7f59276137a"}},{"ruleId":"D2","level":"warning","message":{"text":"RuntimeStatsWithCommit.String (cognitive 33): RuntimeStatsWithCommit.String has cognitive complexity 33 (threshold 15). Drivers by points: if/else 33 (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":"pkg/util/execdetails/runtime_stats.go"},"region":{"startLine":825}}}],"partialFingerprints":{"codehealthFindingId/v1":"177ff42e41dee40d50b43d9872aa38ab424613a6162a7f6f83add2d040afc0e9"}},{"ruleId":"D2","level":"warning","message":{"text":"Filter.matchTable (cognitive 33): Filter.matchTable has cognitive complexity 33 (threshold 15). Drivers by points: if/else 19, loops 8, boolean chains 6 (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":"pkg/util/filter/filter.go"},"region":{"startLine":364}}}],"partialFingerprints":{"codehealthFindingId/v1":"3787ef429e58343ab80cad3f2db70eaa820bb25151ba895912760659841e02ed"}},{"ruleId":"D2","level":"warning","message":{"text":"PlanReplayerStmt.Restore (cognitive 33): PlanReplayerStmt.Restore has cognitive complexity 33 (threshold 15). Drivers by points: if/else 31, loops 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/parser/ast/misc.go"},"region":{"startLine":324}}}],"partialFingerprints":{"codehealthFindingId/v1":"ba3f6d2eadf133fe50373bca91dad12d72aa14ed18da6095c278118b20e65aed"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.checkAlterTableCharset (cognitive 32): ddl.checkAlterTableCharset has cognitive complexity 32 (threshold 15). Drivers by points: if/else 27, loops 3, boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/executor.go"},"region":{"startLine":4084}}}],"partialFingerprints":{"codehealthFindingId/v1":"8e6d8d56673632767f5c45784cfcee5d9424f38fbd7334e55fc57c5d6032d5c5"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.checkModifyGeneratedColumn (cognitive 32): ddl.checkModifyGeneratedColumn has cognitive complexity 32 (threshold 15). Drivers by points: if/else 29, loops 2, 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":"pkg/ddl/generated_column.go"},"region":{"startLine":202}}}],"partialFingerprints":{"codehealthFindingId/v1":"f3c7e19a0d731ee9bab7297dc21b1680b411bc110bd0616c472bfc1a0691baf8"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.doReorgWorkForCreateIndex (cognitive 32): ddl.doReorgWorkForCreateIndex has cognitive complexity 32 (threshold 15). Drivers by points: if/else 21, loops 6, match/switch 4, boolean chains 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":"pkg/ddl/index.go"},"region":{"startLine":1862}}}],"partialFingerprints":{"codehealthFindingId/v1":"d9acd2bebeb091c92f66ad22029a08abd85572049d9347632c270a444de6da82"}},{"ruleId":"D2","level":"warning","message":{"text":"indexWriteResultSink.collectResult (cognitive 32): indexWriteResultSink.collectResult has cognitive complexity 32 (threshold 15). Drivers by points: if/else 29, match/switch 2, loops 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/backfilling_operators.go"},"region":{"startLine":964}}}],"partialFingerprints":{"codehealthFindingId/v1":"2be6f2708a768a08e0ac2ac94829b1157856c80e9d3accc68b7f37706012afa1"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.refreshTiFlashPlacementRules (cognitive 32): ddl.refreshTiFlashPlacementRules has cognitive complexity 32 (threshold 15). Drivers by points: if/else 22, loops 8, boolean chains 2 (nesting depth added 14). Of this number, 28 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":"pkg/ddl/ddl_tiflash_api.go"},"region":{"startLine":549}}}],"partialFingerprints":{"codehealthFindingId/v1":"59147c5c8fc9ea6105946a415c76cd6dff29cde9a794d277bce7a691b3b048c2"}},{"ruleId":"D2","level":"warning","message":{"text":"importinto.collectConflictInfos (cognitive 32): importinto.collectConflictInfos has cognitive complexity 32 (threshold 15). Drivers by points: if/else 27, loops 5 (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":"pkg/dxf/importinto/planner.go"},"region":{"startLine":819}}}],"partialFingerprints":{"codehealthFindingId/v1":"42474c88b2c2b841598140e587a76d42d7209a314a43be2416ef7fd48c439bf1"}},{"ruleId":"D2","level":"warning","message":{"text":"executor.filterAndCollectTasks (cognitive 32): executor.filterAndCollectTasks has cognitive complexity 32 (threshold 15). Drivers by points: if/else 30, boolean chains 1, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/analyze.go"},"region":{"startLine":474}}}],"partialFingerprints":{"codehealthFindingId/v1":"3d927c5791469fb9566e104305679f749b375a76ca0b8380125d69adf8b05de7"}},{"ruleId":"D2","level":"warning","message":{"text":"ExecStmt.FinishExecuteStmt (cognitive 32): ExecStmt.FinishExecuteStmt has cognitive complexity 32 (threshold 15). Drivers by points: if/else 27, boolean chains 5 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/adapter.go"},"region":{"startLine":1663}}}],"partialFingerprints":{"codehealthFindingId/v1":"14a20128727afea78144b2111fd987f0a8a1f1c1bc700bb6c7029ac1799d4738"}},{"ruleId":"D2","level":"warning","message":{"text":"ExplainExec.executeAnalyzeExec (cognitive 32): ExplainExec.executeAnalyzeExec has cognitive complexity 32 (threshold 15). Drivers by points: if/else 25, boolean chains 5, loops 2 (nesting depth added 15). Of this number, 26 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":"pkg/executor/explain.go"},"region":{"startLine":98}}}],"partialFingerprints":{"codehealthFindingId/v1":"d6f060c72adb15b7589b719ebcf38b2e5f2a37d41556af86ed21b9611c40d8a1"}},{"ruleId":"D2","level":"warning","message":{"text":"baseJoinProbe.SetRestoredChunkForProbe (cognitive 32): baseJoinProbe.SetRestoredChunkForProbe has cognitive complexity 32 (threshold 15). Drivers by points: if/else 23, loops 9 (nesting depth added 13). Of this number, 31 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, 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/executor/join/base_join_probe.go"},"region":{"startLine":395}}}],"partialFingerprints":{"codehealthFindingId/v1":"d2b972ce5d1bb45c370099cca81e01126eb8598c34d64672f778cf004322a52f"}},{"ruleId":"D2","level":"warning","message":{"text":"buildWorkerBase.fetchBuildSideRows (cognitive 32): buildWorkerBase.fetchBuildSideRows has cognitive complexity 32 (threshold 15). Drivers by points: if/else 28, match/switch 2, boolean chains 1, loops 1 (nesting depth added 12). Of this number, 17 points are the body\u0027s own statements and 15 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":"pkg/executor/join/hash_join_base.go"},"region":{"startLine":257}}}],"partialFingerprints":{"codehealthFindingId/v1":"7ae32aa67ac6528e08fd11c335813a211defedebc47a951ec8ba30c7083ec932"}},{"ruleId":"D2","level":"warning","message":{"text":"IndexLookUpJoin.Next (cognitive 32): IndexLookUpJoin.Next has cognitive complexity 32 (threshold 15). Drivers by points: if/else 28, boolean chains 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":"pkg/executor/join/index_lookup_join.go"},"region":{"startLine":283}}}],"partialFingerprints":{"codehealthFindingId/v1":"193192a5bcad3ca63fccfb748e239b9a9ccacc74d159454ae4e063794df2c788"}},{"ruleId":"D2","level":"warning","message":{"text":"encodeWorker.parserData2TableData (cognitive 32): encodeWorker.parserData2TableData has cognitive complexity 32 (threshold 15). Drivers by points: if/else 27, boolean chains 2, loops 2, match/switch 1 (nesting depth added 13). Of this number, 29 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":"pkg/executor/load_data.go"},"region":{"startLine":505}}}],"partialFingerprints":{"codehealthFindingId/v1":"eff721bc88619f89fc27a58e212ea7741870de56ec9d1da637158d9374c50e63"}},{"ruleId":"D2","level":"warning","message":{"text":"SetExecutor.Next (cognitive 32): SetExecutor.Next has cognitive complexity 32 (threshold 15). Drivers by points: if/else 30, boolean chains 1, loops 1 (nesting depth added 18). 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/executor/set.go"},"region":{"startLine":60}}}],"partialFingerprints":{"codehealthFindingId/v1":"ca75287046c12999391a1d539d4759b2f40988408f14cda38707dc0bd4858094"}},{"ruleId":"D2","level":"warning","message":{"text":"ShowExec.fetchShowStatsLocked (cognitive 32): ShowExec.fetchShowStatsLocked has cognitive complexity 32 (threshold 15). Drivers by points: if/else 17, loops 14, boolean chains 1 (nesting depth added 18). 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/executor/show_stats.go"},"region":{"startLine":144}}}],"partialFingerprints":{"codehealthFindingId/v1":"f2d214941ab9600f5753f995b99fcdc5cdfe97c688be0b5a85508b45196f7c6b"}},{"ruleId":"D2","level":"warning","message":{"text":"expression.PropagateType (cognitive 32): expression.PropagateType has cognitive complexity 32 (threshold 15). Drivers by points: if/else 30, boolean chains 1, match/switch 1 (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":"pkg/expression/expression.go"},"region":{"startLine":1265}}}],"partialFingerprints":{"codehealthFindingId/v1":"abd9e46faadb60e6ff8f02717b4f3183e1fa53fae6abbfa0271e9971fbcc80b3"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinInetAtonSig.vecEvalInt (cognitive 32): builtinInetAtonSig.vecEvalInt has cognitive complexity 32 (threshold 15). Drivers by points: if/else 27, loops 3, boolean chains 2 (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":"pkg/expression/builtin_miscellaneous_vec.go"},"region":{"startLine":654}}}],"partialFingerprints":{"codehealthFindingId/v1":"ef21ca90c5af82e88da6e61b20b2faa0147583a3a96292bdef9a95b38b3ee61d"}},{"ruleId":"D2","level":"warning","message":{"text":"CSVParser.readQuotedField (cognitive 32): CSVParser.readQuotedField has cognitive complexity 32 (threshold 15). Drivers by points: if/else 27, boolean chains 2, match/switch 2, loops 1 (nesting depth added 18). 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/lightning/mydump/csv_parser.go"},"region":{"startLine":561}}}],"partialFingerprints":{"codehealthFindingId/v1":"6a424e67037a5c91d5befba19892ece0916470b883fc11cade032ac0b24ffd22"}},{"ruleId":"D2","level":"warning","message":{"text":"core.buildSchemaFromFields (cognitive 32): core.buildSchemaFromFields has cognitive complexity 32 (threshold 15). Drivers by points: if/else 23, loops 7, boolean chains 2 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/point_get_plan.go"},"region":{"startLine":795}}}],"partialFingerprints":{"codehealthFindingId/v1":"6c8d2754e2639c835dee022283d8afe8d1f8611f6e31e17b1f4ce9c130e294fe"}},{"ruleId":"D2","level":"warning","message":{"text":"physicalop.tryToGetMppWindows (cognitive 32): physicalop.tryToGetMppWindows has cognitive complexity 32 (threshold 15). Drivers by points: if/else 27, boolean chains 4, 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":"pkg/planner/core/operator/physicalop/physical_window.go"},"region":{"startLine":340}}}],"partialFingerprints":{"codehealthFindingId/v1":"017bd3be1eb2137a54941687ce6e2c76ac9f10569ea854b708aee3347a18dbf8"}},{"ruleId":"D2","level":"warning","message":{"text":"PlanBuilder.buildSelection (cognitive 32): PlanBuilder.buildSelection has cognitive complexity 32 (threshold 15). Drivers by points: if/else 25, loops 5, boolean chains 2 (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":"pkg/planner/core/logical_plan_builder.go"},"region":{"startLine":1349}}}],"partialFingerprints":{"codehealthFindingId/v1":"1272554980452f5f241e03477901805fdad8d5d4309a1b1e7896d2185963c474"}},{"ruleId":"D2","level":"warning","message":{"text":"PlanBuilder.addAliasName (cognitive 32): PlanBuilder.addAliasName has cognitive complexity 32 (threshold 15). Drivers by points: if/else 27, loops 4, boolean chains 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":"pkg/planner/core/logical_plan_builder.go"},"region":{"startLine":4147}}}],"partialFingerprints":{"codehealthFindingId/v1":"2134f6bb28b04f47a1fc754e39da5c4e0bffbba93fcaae8a2af0b41ae920fab7"}},{"ruleId":"D2","level":"warning","message":{"text":"partitionpruning.handleDroppingForRange (cognitive 32): partitionpruning.handleDroppingForRange has cognitive complexity 32 (threshold 15). Drivers by points: if/else 20, loops 8, boolean chains 4 (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":"pkg/planner/util/partitionpruning/partition_prune.go"},"region":{"startLine":52}}}],"partialFingerprints":{"codehealthFindingId/v1":"5df7ecf2620d917777eda4bdc1d939c899890f7eaaf3339d7490fac57d4bfad4"}},{"ruleId":"D2","level":"warning","message":{"text":"Server.initTiDBListener (cognitive 32): Server.initTiDBListener has cognitive complexity 32 (threshold 15). Drivers by points: if/else 22, boolean chains 10 (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/server/server.go"},"region":{"startLine":374}}}],"partialFingerprints":{"codehealthFindingId/v1":"ee69c320a6813cad837213082599d5280e2c52862e9de06717fbac65ae5eb237"}},{"ruleId":"D2","level":"warning","message":{"text":"session.upgradeStarterBootstrapWithFile (cognitive 32): session.upgradeStarterBootstrapWithFile has cognitive complexity 32 (threshold 15). Drivers by points: if/else 30, boolean chains 2 (nesting depth added 7). Of this number, 31 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, 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":"pkg/session/starter_bootstrap_file.go"},"region":{"startLine":211}}}],"partialFingerprints":{"codehealthFindingId/v1":"0df742b00721a6d1dce1da31f23e95943f4b49f22c1da6580e2428b130afe4f7"}},{"ruleId":"D2","level":"warning","message":{"text":"session.commitTxnWithTemporaryData (cognitive 32): session.commitTxnWithTemporaryData has cognitive complexity 32 (threshold 15). Drivers by points: if/else 29, loops 3 (nesting depth added 14). Of this number, 31 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, 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/session/session.go"},"region":{"startLine":700}}}],"partialFingerprints":{"codehealthFindingId/v1":"b0b6d74b239dd6b7ffaf7e94e6e423c8ef1fbf3552751799e8846519133488d3"}},{"ruleId":"D2","level":"warning","message":{"text":"autoanalyze.tryAutoAnalyzePartitionTableInDynamicMode (cognitive 32): autoanalyze.tryAutoAnalyzePartitionTableInDynamicMode has cognitive complexity 32 (threshold 15). Drivers by points: if/else 19, loops 10, boolean chains 3 (nesting depth added 14). Of this number, 29 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":"pkg/statistics/handle/autoanalyze/autoanalyze.go"},"region":{"startLine":635}}}],"partialFingerprints":{"codehealthFindingId/v1":"3ced8533f457c65664da4239b278c85bd276b858512da70d5e08e6954834b112"}},{"ruleId":"D2","level":"warning","message":{"text":"statsSyncLoad.handleOneItemTaskWithSCtx (cognitive 32): statsSyncLoad.handleOneItemTaskWithSCtx has cognitive complexity 32 (threshold 15). Drivers by points: if/else 32 (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/statistics/handle/syncload/stats_syncload.go"},"region":{"startLine":344}}}],"partialFingerprints":{"codehealthFindingId/v1":"0b8f19292ac6fc2ecc817c4026b0df7c0f44204885cad714e1c6e24e49279f90"}},{"ruleId":"D2","level":"warning","message":{"text":"CopClient.BuildCopIterator (cognitive 32): CopClient.BuildCopIterator has cognitive complexity 32 (threshold 15). Drivers by points: if/else 28, boolean chains 4 (nesting depth added 4). Of this number, 25 points are the body\u0027s own statements and 7 belong to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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":"pkg/store/copr/coprocessor.go"},"region":{"startLine":124}}}],"partialFingerprints":{"codehealthFindingId/v1":"0a4b2c7aa885a0789677893b2d56b03c80f1d3a02e84e511c08ee29bf7f59b45"}},{"ruleId":"D2","level":"warning","message":{"text":"error.ToTiDBErr (cognitive 32): error.ToTiDBErr has cognitive complexity 32 (threshold 15). Drivers by points: if/else 32. 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":"pkg/store/driver/error/error.go"},"region":{"startLine":77}}}],"partialFingerprints":{"codehealthFindingId/v1":"cbb0f9955dc886a2c94e7fade338ffaebe2a1af31c610c0648523d4b5fddc6db"}},{"ruleId":"D2","level":"warning","message":{"text":"helper.NewFrameItemFromRegionKey (cognitive 32): helper.NewFrameItemFromRegionKey has cognitive complexity 32 (threshold 15). Drivers by points: if/else 27, 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":"pkg/store/helper/helper.go"},"region":{"startLine":512}}}],"partialFingerprints":{"codehealthFindingId/v1":"5fa12eb67e1158953f2350c0969d8deebfbbc120e80447cdc126e1dd2be84126"}},{"ruleId":"D2","level":"warning","message":{"text":"TestKit.ExecWithContext (cognitive 32): TestKit.ExecWithContext has cognitive complexity 32 (threshold 15). Drivers by points: if/else 29, loops 2, boolean chains 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":"pkg/testkit/testkit.go"},"region":{"startLine":390}}}],"partialFingerprints":{"codehealthFindingId/v1":"f2079823d9faaf4c7f20fb3e1176aa303beea3d58950c2b34ea9df9cc21f8709"}},{"ruleId":"D2","level":"warning","message":{"text":"cache.RowToTableStatus (cognitive 32): cache.RowToTableStatus has cognitive complexity 32 (threshold 15). Drivers by points: if/else 32 (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/ttl/cache/ttlstatus.go"},"region":{"startLine":112}}}],"partialFingerprints":{"codehealthFindingId/v1":"4cd97fca9774793e5cd1f8fefc295f25e5dcadea30869d87581c65d102f01f3b"}},{"ruleId":"D2","level":"warning","message":{"text":"types.CheckModifyTypeCompatible (cognitive 32): types.CheckModifyTypeCompatible has cognitive complexity 32 (threshold 15). Drivers by points: if/else 24, boolean chains 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":"pkg/types/field_type.go"},"region":{"startLine":1476}}}],"partialFingerprints":{"codehealthFindingId/v1":"8633b48c47e0fbcc35cc033207aa01680b053796c4b0af737f24edff152561f1"}},{"ruleId":"D2","level":"warning","message":{"text":"types.OverlapsBinaryJSON (cognitive 32): types.OverlapsBinaryJSON has cognitive complexity 32 (threshold 15). Drivers by points: if/else 17, loops 12, boolean chains 2, match/switch 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/types/json_binary_functions.go"},"region":{"startLine":1133}}}],"partialFingerprints":{"codehealthFindingId/v1":"93715fcb6f144e2b80d170736f886d869957c6e0d52d623035959b53452964de"}},{"ruleId":"D2","level":"warning","message":{"text":"types.GetTimezone (cognitive 32): types.GetTimezone has cognitive complexity 32 (threshold 15). Drivers by points: if/else 26, boolean chains 5, loops 1 (nesting depth added 12). Of this number, 31 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, 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/types/time.go"},"region":{"startLine":849}}}],"partialFingerprints":{"codehealthFindingId/v1":"e36f79653b0a20372ff4832bf2125aecca3db1510262244dafd28b2353d08a23"}},{"ruleId":"D2","level":"warning","message":{"text":"util.GenLogFields (cognitive 32): util.GenLogFields has cognitive complexity 32 (threshold 15). Drivers by points: if/else 28, boolean chains 2, loops 2 (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/util/util.go"},"region":{"startLine":79}}}],"partialFingerprints":{"codehealthFindingId/v1":"e3c4322092f8cfa99532fb2572379c160a0649e3c4f73e77c2c31f9906f83a56"}},{"ruleId":"D2","level":"warning","message":{"text":"hint.ParseHintsSet (cognitive 32): hint.ParseHintsSet has cognitive complexity 32 (threshold 15). Drivers by points: if/else 24, loops 6, boolean chains 2 (nesting depth added 18). 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/util/hint/hint_processor.go"},"region":{"startLine":319}}}],"partialFingerprints":{"codehealthFindingId/v1":"1527486532e826e63d07a05400b453284e636ef40ee3be40bb540584ee5aa91b"}},{"ruleId":"D2","level":"warning","message":{"text":"MemArbitrator.shrinkDigestProfile (cognitive 32): MemArbitrator.shrinkDigestProfile has cognitive complexity 32 (threshold 15). Drivers by points: if/else 29, loops 3 (nesting depth added 15). Most of this is not in the body itself: 13 of the 32 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 775, 829). 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":"pkg/util/memory/arbitrator.go"},"region":{"startLine":760}}}],"partialFingerprints":{"codehealthFindingId/v1":"bb016c86bd9eae28150e6592fd785eaf803cedbbed5291550519e777b37ecf74"}},{"ruleId":"D2","level":"warning","message":{"text":"ruCollecting.compactWithLimits (cognitive 32): ruCollecting.compactWithLimits has cognitive complexity 32 (threshold 15). Drivers by points: if/else 20, loops 8, boolean chains 4 (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":"pkg/util/topsql/reporter/ru_datamodel.go"},"region":{"startLine":553}}}],"partialFingerprints":{"codehealthFindingId/v1":"494d13206424b38cc29c9f23d27129bec4b58d8fb7057e30ccde005dc7219568"}},{"ruleId":"D2","level":"warning","message":{"text":"FlushStmt.Restore (cognitive 32): FlushStmt.Restore has cognitive complexity 32 (threshold 15). Drivers by points: if/else 23, loops 6, match/switch 3 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/parser/ast/misc.go"},"region":{"startLine":1110}}}],"partialFingerprints":{"codehealthFindingId/v1":"a3109a6cba81e88cdb98e00f979cf876e92f0a89745846878422a131fa229679"}},{"ruleId":"D2","level":"warning","message":{"text":"Scanner.Lex (cognitive 32): Scanner.Lex has cognitive complexity 32 (threshold 15). Drivers by points: if/else 22, boolean chains 9, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/parser/lexer.go"},"region":{"startLine":237}}}],"partialFingerprints":{"codehealthFindingId/v1":"e7cfa516948966ee93109e4324be8904410552ca3f33980c6125a3ebd5a7f68e"}},{"ruleId":"D2","level":"warning","message":{"text":"schemaInfo.checkMergeOptionAllowed (cognitive 31): schemaInfo.checkMergeOptionAllowed has cognitive complexity 31 (threshold 15). Drivers by points: if/else 16, loops 11, boolean chains 4 (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":"br/pkg/backup/schema.go"},"region":{"startLine":328}}}],"partialFingerprints":{"codehealthFindingId/v1":"a26febf875d64a1a353f7ed1095698d6ba314f8354058e41042c605d647f9fc6"}},{"ruleId":"D2","level":"warning","message":{"text":"IngestRecorder.UpdateIndexInfo (cognitive 31): IngestRecorder.UpdateIndexInfo has cognitive complexity 31 (threshold 15). Drivers by points: if/else 23, loops 6, boolean chains 2 (nesting depth added 18). 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":"br/pkg/restore/ingestrec/ingest_recorder.go"},"region":{"startLine":158}}}],"partialFingerprints":{"codehealthFindingId/v1":"a15162bb14ff1dd728b2b5ec8d5aecad99327bac9d6d312de3f55b3c018dee5f"}},{"ruleId":"D2","level":"warning","message":{"text":"AdvancerExt.startListen (cognitive 31): AdvancerExt.startListen has cognitive complexity 31 (threshold 15). Drivers by points: if/else 21, match/switch 4, boolean chains 3, loops 3 (nesting depth added 15). Most of this is not in the body itself: 0 of the 31 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 281, 259, 244). 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":"br/pkg/streamhelper/advancer_cliext.go"},"region":{"startLine":238}}}],"partialFingerprints":{"codehealthFindingId/v1":"ae1c4830e02aeb6ade329e4abd60f3e14bddf67bb1c58b94d9cff9fc97b832aa"}},{"ruleId":"D2","level":"warning","message":{"text":"export.outputTemplateUsesIndex (cognitive 31): export.outputTemplateUsesIndex has cognitive complexity 31 (threshold 15). Drivers by points: if/else 27, loops 2, boolean chains 1, match/switch 1 (nesting depth added 13). Most of this is not in the body itself: 1 of the 31 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 741, 726). 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":"dumpling/export/config.go"},"region":{"startLine":713}}}],"partialFingerprints":{"codehealthFindingId/v1":"9b3d0f27244b82ed1d049f488d705dbd0f9a581271bafe4c3b8a8f409b2c7cba"}},{"ruleId":"D2","level":"warning","message":{"text":"export.WriteInsertInCsv (cognitive 31): export.WriteInsertInCsv has cognitive complexity 31 (threshold 15). Drivers by points: if/else 26, loops 3, boolean chains 2 (nesting depth added 11). 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, 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":"dumpling/export/writer_util.go"},"region":{"startLine":329}}}],"partialFingerprints":{"codehealthFindingId/v1":"fad80179695ee27b00ffb57141eb1778260a857c5586316b0308a659a293490a"}},{"ruleId":"D2","level":"warning","message":{"text":"main.run (cognitive 31): main.run has cognitive complexity 31 (threshold 15). Drivers by points: if/else 28, loops 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":"lightning/cmd/tidb-lightning-ctl/main.go"},"region":{"startLine":57}}}],"partialFingerprints":{"codehealthFindingId/v1":"fe592862475036017913f9e7b0a91999efd3dc8d5eb6c1525100b4d119cd5409"}},{"ruleId":"D2","level":"warning","message":{"text":"bindinfo.genPlanUnderState (cognitive 31): bindinfo.genPlanUnderState has cognitive complexity 31 (threshold 15). Drivers by points: if/else 19, loops 7, boolean chains 3, match/switch 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/bindinfo/binding_plan_generation.go"},"region":{"startLine":389}}}],"partialFingerprints":{"codehealthFindingId/v1":"cc6a68c263bff57973b4853d422a72b732220f49393997ad5f6c42d1f4ca46d8"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.checkAndSetFlashbackClusterInfo (cognitive 31): ddl.checkAndSetFlashbackClusterInfo has cognitive complexity 31 (threshold 15). Drivers by points: if/else 26, loops 3, boolean chains 2 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/cluster.go"},"region":{"startLine":191}}}],"partialFingerprints":{"codehealthFindingId/v1":"63583ed85b47e53dbf795ba38fea6efb7646c95590c2a79bf4c7a963f9dd462c"}},{"ruleId":"D2","level":"warning","message":{"text":"mergeTempIndexWorker.handleOneRange (cognitive 31): mergeTempIndexWorker.handleOneRange has cognitive complexity 31 (threshold 15). Drivers by points: if/else 27, loops 3, boolean chains 1 (nesting depth added 17). Most of this is not in the body itself: 10 of the 31 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 1262, 1326). 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":"pkg/ddl/backfilling_operators.go"},"region":{"startLine":1242}}}],"partialFingerprints":{"codehealthFindingId/v1":"d6e7c8f25a24c13f1cd8fb320bc0b4709e7b9a852ec7b73930682057850ae57d"}},{"ruleId":"D2","level":"warning","message":{"text":"executor.BatchCreateTableWithInfo (cognitive 31): executor.BatchCreateTableWithInfo has cognitive complexity 31 (threshold 15). Drivers by points: if/else 26, loops 3, boolean chains 2 (nesting depth added 12). 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":"pkg/ddl/executor.go"},"region":{"startLine":1237}}}],"partialFingerprints":{"codehealthFindingId/v1":"06412263b710bb304195218328e8874f0712d8f35f6440db68ab9af682894d21"}},{"ruleId":"D2","level":"warning","message":{"text":"addIndexTxnWorker.batchCheckUniqueKey (cognitive 31): addIndexTxnWorker.batchCheckUniqueKey has cognitive complexity 31 (threshold 15). Drivers by points: if/else 26, loops 4, boolean chains 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":"pkg/ddl/index.go"},"region":{"startLine":2612}}}],"partialFingerprints":{"codehealthFindingId/v1":"641a27be535a95e6bca414ed8a15d7c186d3ff5d2e7935b7fe43c13fd22476a5"}},{"ruleId":"D2","level":"warning","message":{"text":"RequestBuilder.SetDAGRequest (cognitive 31): RequestBuilder.SetDAGRequest has cognitive complexity 31 (threshold 15). Drivers by points: if/else 28, boolean chains 3 (nesting depth added 18). 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/distsql/request_builder.go"},"region":{"startLine":190}}}],"partialFingerprints":{"codehealthFindingId/v1":"b8e5093a033afcb035914b5bf453f141a2e2d51b18b7eb71b35156d942a08c67"}},{"ruleId":"D2","level":"warning","message":{"text":"domain.dumpExplain (cognitive 31): domain.dumpExplain has cognitive complexity 31 (threshold 15). Drivers by points: if/else 26, loops 3, boolean chains 2 (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":"pkg/domain/plan_replayer_dump.go"},"region":{"startLine":756}}}],"partialFingerprints":{"codehealthFindingId/v1":"e47a200cffbbca0c0bcbc79869bb2372b703f75de574b0e409f10466aa6cc736"}},{"ruleId":"D2","level":"warning","message":{"text":"parquetfile.getStringFromParquetByte (cognitive 31): parquetfile.getStringFromParquetByte has cognitive complexity 31 (threshold 15). Drivers by points: if/else 16, loops 12, boolean chains 3 (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":"pkg/dumpformat/parquetfile/type_converter.go"},"region":{"startLine":82}}}],"partialFingerprints":{"codehealthFindingId/v1":"6ab4ed71a8ab355f0d1ff67541ae0a9ecb15c44b4f47cdf4b76ee36dad99303e"}},{"ruleId":"D2","level":"warning","message":{"text":"balancer.doBalanceSubtasks (cognitive 31): balancer.doBalanceSubtasks has cognitive complexity 31 (threshold 15). Drivers by points: if/else 21, loops 8, boolean chains 2 (nesting depth added 8). 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":"pkg/dxf/framework/scheduler/balancer.go"},"region":{"startLine":124}}}],"partialFingerprints":{"codehealthFindingId/v1":"cfbf529ad283ccdd886186a8b5eece16063a4d7dd47065a638b4fa04aacae9e0"}},{"ruleId":"D2","level":"warning","message":{"text":"executorBuilder.corColInDistPlan (cognitive 31): executorBuilder.corColInDistPlan has cognitive complexity 31 (threshold 15). Drivers by points: if/else 16, loops 13, match/switch 2 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/builder.go"},"region":{"startLine":3438}}}],"partialFingerprints":{"codehealthFindingId/v1":"c4b7bfc88a10847c05f8c3186e2e073b6d45007d42803aad3ce6b8226fe622fc"}},{"ruleId":"D2","level":"warning","message":{"text":"dataReaderBuilder.buildPartitionedTableReaderKVRangesForIndexJoin (cognitive 31): dataReaderBuilder.buildPartitionedTableReaderKVRangesForIndexJoin has cognitive complexity 31 (threshold 15). Drivers by points: if/else 18, loops 13 (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":"pkg/executor/builder.go"},"region":{"startLine":4123}}}],"partialFingerprints":{"codehealthFindingId/v1":"17f84ff75a80e4a8a9c91d21323dbd47d3e4e441cec4284ead02a066dce32f40"}},{"ruleId":"D2","level":"warning","message":{"text":"memtableRetriever.setDataFromIndex (cognitive 31): memtableRetriever.setDataFromIndex has cognitive complexity 31 (threshold 15). Drivers by points: if/else 24, loops 5, boolean chains 2 (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":"pkg/executor/infoschema_reader.go"},"region":{"startLine":1516}}}],"partialFingerprints":{"codehealthFindingId/v1":"b68c2bb822691a31f0896e50a683cc34247f273b5de48eafffa58a7ccb57b303"}},{"ruleId":"D2","level":"warning","message":{"text":"indexHashJoinInnerWorker.handleTask (cognitive 31): indexHashJoinInnerWorker.handleTask has cognitive complexity 31 (threshold 15). Drivers by points: if/else 26, match/switch 3, loops 2 (nesting depth added 15). Of this number, 21 points are the body\u0027s own statements and 10 belong to 4 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":"pkg/executor/join/index_lookup_hash_join.go"},"region":{"startLine":685}}}],"partialFingerprints":{"codehealthFindingId/v1":"953bcbbebba7a1c0b3a5d5b55f9c2c5f9f60dbe296a762b19e68cee17d9f260e"}},{"ruleId":"D2","level":"warning","message":{"text":"memTableReader.getRowData (cognitive 31): memTableReader.getRowData has cognitive complexity 31 (threshold 15). Drivers by points: if/else 24, loops 4, boolean chains 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":"pkg/executor/mem_reader.go"},"region":{"startLine":501}}}],"partialFingerprints":{"codehealthFindingId/v1":"b4d150050837f883e92822f77d5dd340efd512168b557f3c026239bd9ceb57a6"}},{"ruleId":"D2","level":"warning","message":{"text":"ShowExec.fetchShowColumns (cognitive 31): ShowExec.fetchShowColumns has cognitive complexity 31 (threshold 15). Drivers by points: if/else 26, boolean chains 4, 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/executor/show.go"},"region":{"startLine":696}}}],"partialFingerprints":{"codehealthFindingId/v1":"aa951ad2bb7d204e5be8ad58bf0faae61b3d1c7234b26eb0395b7fc8963c3235"}},{"ruleId":"D2","level":"warning","message":{"text":"expression.GetAccurateCmpType (cognitive 31): expression.GetAccurateCmpType has cognitive complexity 31 (threshold 15). Drivers by points: if/else 17, boolean chains 14 (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/expression/builtin_compare.go"},"region":{"startLine":1433}}}],"partialFingerprints":{"codehealthFindingId/v1":"081d14b052857c1de23b6f53fad58b9fe60ff443b1b05927e016a96c8070fe29"}},{"ruleId":"D2","level":"warning","message":{"text":"expression.rowBasedFilter (cognitive 31): expression.rowBasedFilter has cognitive complexity 31 (threshold 15). Drivers by points: if/else 22, loops 6, boolean chains 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":"pkg/expression/chunk_executor.go"},"region":{"startLine":465}}}],"partialFingerprints":{"codehealthFindingId/v1":"050b292e84ed2203c7fdae6388d2b7bbfb62c713249a008c125e25512a54f362"}},{"ruleId":"D2","level":"warning","message":{"text":"expression.VecEvalBool (cognitive 31): expression.VecEvalBool has cognitive complexity 31 (threshold 15). Drivers by points: if/else 24, loops 6, boolean chains 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":"pkg/expression/expression.go"},"region":{"startLine":420}}}],"partialFingerprints":{"codehealthFindingId/v1":"77ed7a6190af471bf37392e19fe7b89d4f45ac1cb563a1d915f94f5f8a937cdf"}},{"ruleId":"D2","level":"warning","message":{"text":"TikvImporter.adjust (cognitive 31): TikvImporter.adjust has cognitive complexity 31 (threshold 15). Drivers by points: if/else 25, match/switch 4, boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/lightning/config/config.go"},"region":{"startLine":1142}}}],"partialFingerprints":{"codehealthFindingId/v1":"8954c6292c77b28b576bc78e5fe73b277fe72a7c3104bf4aa16d3bd0c14d43c6"}},{"ruleId":"D2","level":"warning","message":{"text":"core.convertToBatchPointGet (cognitive 31): core.convertToBatchPointGet has cognitive complexity 31 (threshold 15). Drivers by points: if/else 21, loops 6, boolean chains 4 (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/planner/core/find_best_task.go"},"region":{"startLine":3071}}}],"partialFingerprints":{"codehealthFindingId/v1":"3c94b4293079d3c23e7a27ff28811c7ac4a97edb60fe5182344014ecd55f2617"}},{"ruleId":"D2","level":"warning","message":{"text":"expressionRewriter.rewriteSystemVariable (cognitive 31): expressionRewriter.rewriteSystemVariable has cognitive complexity 31 (threshold 15). Drivers by points: if/else 22, boolean chains 8, match/switch 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":"pkg/planner/core/expression_rewriter.go"},"region":{"startLine":1989}}}],"partialFingerprints":{"codehealthFindingId/v1":"b4db0914fb127ed3050c7b76b60a23fb91120ddf08dac87094782a79b0caabaf"}},{"ruleId":"D2","level":"warning","message":{"text":"expressionRewriter.toColumn (cognitive 31): expressionRewriter.toColumn has cognitive complexity 31 (threshold 15). Drivers by points: if/else 26, boolean chains 4, 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/planner/core/expression_rewriter.go"},"region":{"startLine":3083}}}],"partialFingerprints":{"codehealthFindingId/v1":"d4e7419b963c98b3e44b6e3cc0a348fde644164c6dc277434e6511baea2beb11"}},{"ruleId":"D2","level":"warning","message":{"text":"joinorder.FindAndRemovePlanByAstHint (cognitive 31): joinorder.FindAndRemovePlanByAstHint has cognitive complexity 31 (threshold 15). Drivers by points: if/else 24, boolean chains 5, loops 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/joinorder/util.go"},"region":{"startLine":361}}}],"partialFingerprints":{"codehealthFindingId/v1":"fd29fae1c5f1084ee8d24b189517855fc9904b612d4ac426ad5f59455bb8c1be"}},{"ruleId":"D2","level":"warning","message":{"text":"LogicalAggregation.ExtractFD (cognitive 31): LogicalAggregation.ExtractFD has cognitive complexity 31 (threshold 15). Drivers by points: if/else 15, loops 13, match/switch 2, boolean chains 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":"pkg/planner/core/operator/logicalop/logical_aggregation.go"},"region":{"startLine":346}}}],"partialFingerprints":{"codehealthFindingId/v1":"9760135ded0e3e8f21ca4106d156e8ea6f12a1c3fcd595f51858655b5baf70e6"}},{"ruleId":"D2","level":"warning","message":{"text":"LogicalProjection.ExtractFD (cognitive 31): LogicalProjection.ExtractFD has cognitive complexity 31 (threshold 15). Drivers by points: if/else 20, loops 8, match/switch 2, boolean chains 1 (nesting depth added 18). 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/planner/core/operator/logicalop/logical_projection.go"},"region":{"startLine":388}}}],"partialFingerprints":{"codehealthFindingId/v1":"82e294a315a4bf1a15070595781ea5e461eeb44de649b77d93248329860a9f46"}},{"ruleId":"D2","level":"warning","message":{"text":"PhysicalHashJoin.ResolveIndicesItself (cognitive 31): PhysicalHashJoin.ResolveIndicesItself has cognitive complexity 31 (threshold 15). Drivers by points: if/else 21, loops 8, boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/operator/physicalop/physical_hash_join.go"},"region":{"startLine":379}}}],"partialFingerprints":{"codehealthFindingId/v1":"dd79097bb453cecdfcf713d98d931737a240db51af9c7a889d94b6e17fb2970e"}},{"ruleId":"D2","level":"warning","message":{"text":"rule.FindPredicateType (cognitive 31): rule.FindPredicateType has cognitive complexity 31 (threshold 15). Drivers by points: if/else 27, loops 3, match/switch 1 (nesting depth added 14). 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":"pkg/planner/core/rule/rule_predicate_simplification.go"},"region":{"startLine":90}}}],"partialFingerprints":{"codehealthFindingId/v1":"a1605e4971f8d0aa5c53305d48df974104d22e5f880c619f98e38054b6bac21f"}},{"ruleId":"D2","level":"warning","message":{"text":"rule.collectEqOrInBoundColIDs (cognitive 31): rule.collectEqOrInBoundColIDs has cognitive complexity 31 (threshold 15). Drivers by points: if/else 25, loops 4, match/switch 2 (nesting depth added 19). 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":"pkg/planner/core/rule/rule_prune_indexes.go"},"region":{"startLine":264}}}],"partialFingerprints":{"codehealthFindingId/v1":"8a14e528e98cfda86cd69ca7083139b2eb1dacafe100c5d83195fd48bea6f4d8"}},{"ruleId":"D2","level":"warning","message":{"text":"Manager.deleteExpiredRows (cognitive 31): Manager.deleteExpiredRows has cognitive complexity 31 (threshold 15). Drivers by points: if/else 26, loops 5 (nesting depth added 13). 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":"pkg/resourcegroup/runaway/record.go"},"region":{"startLine":245}}}],"partialFingerprints":{"codehealthFindingId/v1":"0798cb806b1c4c2a9c0d598bbe431ed989afae112300c48183347f26eb90f0b5"}},{"ruleId":"D2","level":"warning","message":{"text":"SchemaHandler.ServeHTTP (cognitive 31): SchemaHandler.ServeHTTP has cognitive complexity 31 (threshold 15). Drivers by points: if/else 29, loops 2 (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":"pkg/server/handler/tikvhandler/tikv_handler.go"},"region":{"startLine":970}}}],"partialFingerprints":{"codehealthFindingId/v1":"9ea4bdb19241face3296c8b02e8337ea36ec86cfedbb2206e8e2e156a532448c"}},{"ruleId":"D2","level":"warning","message":{"text":"RegionHandler.ServeHTTP (cognitive 31): RegionHandler.ServeHTTP has cognitive complexity 31 (threshold 15). Drivers by points: if/else 28, 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":"pkg/server/handler/tikvhandler/tikv_handler.go"},"region":{"startLine":1514}}}],"partialFingerprints":{"codehealthFindingId/v1":"b63ebfff8e3bf1245d43fd3c059fd879589a46706da2f472b9c4e2c91bf9a97b"}},{"ruleId":"D2","level":"warning","message":{"text":"session.runInBootstrapSession (cognitive 31): session.runInBootstrapSession has cognitive complexity 31 (threshold 15). Drivers by points: if/else 30, 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":"pkg/session/session.go"},"region":{"startLine":4697}}}],"partialFingerprints":{"codehealthFindingId/v1":"4d366448bd48edaf9aae746441de72b81162e9ec2d21a90b29cf27241eaeedcb"}},{"ruleId":"D2","level":"warning","message":{"text":"statsSyncLoad.readStatsForOneItem (cognitive 31): statsSyncLoad.readStatsForOneItem has cognitive complexity 31 (threshold 15). Drivers by points: if/else 30, boolean chains 1 (nesting depth added 12). 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":"pkg/statistics/handle/syncload/stats_syncload.go"},"region":{"startLine":434}}}],"partialFingerprints":{"codehealthFindingId/v1":"e102c404b00e68e7e4d500a1c30665ba76119e1981f2d37a2bb8ad86c56f5888"}},{"ruleId":"D2","level":"warning","message":{"text":"expandExec.next (cognitive 31): expandExec.next has cognitive complexity 31 (threshold 15). Drivers by points: if/else 19, loops 10, boolean chains 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/store/mockstore/unistore/cophandler/mpp_exec.go"},"region":{"startLine":776}}}],"partialFingerprints":{"codehealthFindingId/v1":"27ee4e41ff9a2f1b3478440d0b1e9c3f9ef8df097a3f74cfd271a1767ec91795"}},{"ruleId":"D2","level":"warning","message":{"text":"MVCCStore.Scan (cognitive 31): MVCCStore.Scan has cognitive complexity 31 (threshold 15). Drivers by points: if/else 27, boolean chains 3, loops 1 (nesting depth added 10). 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":"pkg/store/mockstore/unistore/tikv/mvcc.go"},"region":{"startLine":1985}}}],"partialFingerprints":{"codehealthFindingId/v1":"d324ca6a22db21a34231a25005cbdb6dcb41594de0d9edeb1962dbd448e2ea48"}},{"ruleId":"D2","level":"warning","message":{"text":"telemetry.collectFeatureUsageFromInfoschema (cognitive 31): telemetry.collectFeatureUsageFromInfoschema has cognitive complexity 31 (threshold 15). Drivers by points: if/else 25, loops 6 (nesting depth added 18). 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/telemetry/data_feature_usage.go"},"region":{"startLine":126}}}],"partialFingerprints":{"codehealthFindingId/v1":"f393853e975d65f46850ab9a6e69872af3a09eaaa0bc02b94b81aff90cd55a2a"}},{"ruleId":"D2","level":"warning","message":{"text":"etcdNotifier.Watch (cognitive 31): etcdNotifier.Watch has cognitive complexity 31 (threshold 15). Drivers by points: if/else 17, loops 8, match/switch 6 (nesting depth added 21). 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 138). 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":"pkg/timer/tablestore/notifier.go"},"region":{"startLine":127}}}],"partialFingerprints":{"codehealthFindingId/v1":"e5b1b28c79569d2a5048b17a5475be041644ae70ea6046e48998b7b237d1603b"}},{"ruleId":"D2","level":"warning","message":{"text":"JobManager.rescheduleJobs (cognitive 31): JobManager.rescheduleJobs has cognitive complexity 31 (threshold 15). Drivers by points: if/else 25, loops 5, 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":"pkg/ttl/ttlworker/job_manager.go"},"region":{"startLine":610}}}],"partialFingerprints":{"codehealthFindingId/v1":"0e96481bb2dc1cf70c4f62baf8c1abfc86c059c9dada104bdd02f4b62a734619"}},{"ruleId":"D2","level":"warning","message":{"text":"Decoder.DecodeOne (cognitive 31): Decoder.DecodeOne has cognitive complexity 31 (threshold 15). Drivers by points: if/else 29, boolean chains 1, match/switch 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":"pkg/util/codec/codec.go"},"region":{"startLine":1627}}}],"partialFingerprints":{"codehealthFindingId/v1":"5ef77f71249eb6eb34c4439383e9839e282171d569d3b2070bf19ed7b507338c"}},{"ruleId":"D2","level":"warning","message":{"text":"matcherParser.parseWildcardPattern (cognitive 31): matcherParser.parseWildcardPattern has cognitive complexity 31 (threshold 15). Drivers by points: if/else 23, match/switch 5, boolean chains 1, jumps 1, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/util/table-filter/parser.go"},"region":{"startLine":206}}}],"partialFingerprints":{"codehealthFindingId/v1":"30b28235edc0b4349b060ecdcb31688473e0c97254ff4f29deb3a44a928b8cb6"}},{"ruleId":"D2","level":"warning","message":{"text":"main.newBackupMetaValidateCommand (cognitive 30): main.newBackupMetaValidateCommand has cognitive complexity 30 (threshold 15). Drivers by points: if/else 15, loops 15 (nesting depth added 12). 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 161). 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":"br/cmd/br/debug.go"},"region":{"startLine":157}}}],"partialFingerprints":{"codehealthFindingId/v1":"5452f694db5846006d86b3a89f898d885156add8a5dbf8bf63719561a3e8ddde"}},{"ruleId":"D2","level":"warning","message":{"text":"EC2Session.waitDataFSREnabled (cognitive 30): EC2Session.waitDataFSREnabled has cognitive complexity 30 (threshold 15). Drivers by points: if/else 23, loops 5, boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"br/pkg/aws/ebs.go"},"region":{"startLine":369}}}],"partialFingerprints":{"codehealthFindingId/v1":"2869147b127111fb828a5fa4f304629c7e75f3711e117028544495883fe961b7"}},{"ruleId":"D2","level":"warning","message":{"text":"MultiTablesRestorer.GoRestore (cognitive 30): MultiTablesRestorer.GoRestore has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14, loops 14, boolean chains 2 (nesting depth added 17). Most of this is not in the body itself: 7 of the 30 points are its own statements and the rest belongs to one function literal inside it that branches (line 370). 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":"br/pkg/restore/restorer.go"},"region":{"startLine":346}}}],"partialFingerprints":{"codehealthFindingId/v1":"e5365593cbe6ce2a74baf84f94298bd633f4623c3e463bbe4084761c3a9f92ec"}},{"ruleId":"D2","level":"warning","message":{"text":"split.sendSplitRegionRequest (cognitive 30): split.sendSplitRegionRequest has cognitive complexity 30 (threshold 15). Drivers by points: if/else 28, boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"br/pkg/restore/split/client.go"},"region":{"startLine":415}}}],"partialFingerprints":{"codehealthFindingId/v1":"5318d5b367e1e1a306d24511a04880b3b0833c61c2b195839a202f377240c1c3"}},{"ruleId":"D2","level":"warning","message":{"text":"pdClient.splitWaitAndMaybeScatter (cognitive 30): pdClient.splitWaitAndMaybeScatter has cognitive complexity 30 (threshold 15). Drivers by points: if/else 28, boolean chains 1, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"br/pkg/restore/split/client.go"},"region":{"startLine":748}}}],"partialFingerprints":{"codehealthFindingId/v1":"b6655aad621fa2eccbf2421dfc8216a2a423fe6209678a73419e4cfba09ab19a"}},{"ruleId":"D2","level":"warning","message":{"text":"TableMappingManager.ParseMetaKvAndUpdateIdMapping (cognitive 30): TableMappingManager.ParseMetaKvAndUpdateIdMapping has cognitive complexity 30 (threshold 15). Drivers by points: if/else 26, match/switch 4 (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":"br/pkg/stream/table_mapping.go"},"region":{"startLine":159}}}],"partialFingerprints":{"codehealthFindingId/v1":"2f7e48ee231b66bd4f6053afef6798a6691852074f837d09664ed4f388daeb9b"}},{"ruleId":"D2","level":"warning","message":{"text":"logCollector.Summary (cognitive 30): logCollector.Summary has cognitive complexity 30 (threshold 15). Drivers by points: if/else 21, loops 6, boolean chains 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":"br/pkg/summary/collector.go"},"region":{"startLine":186}}}],"partialFingerprints":{"codehealthFindingId/v1":"8a0de474b66a25cdf8077d94e4f66e1c41da9d7dbf7fabb0705c7e9b333b4610"}},{"ruleId":"D2","level":"warning","message":{"text":"dbTaskMetaMgr.CheckAndPausePdSchedulers (cognitive 30): dbTaskMetaMgr.CheckAndPausePdSchedulers has cognitive complexity 30 (threshold 15). Drivers by points: if/else 29, loops 1 (nesting depth added 9). Most of this is not in the body itself: 7 of the 30 points are its own statements and the rest belongs to one function literal inside it that branches (line 770). 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":"lightning/pkg/importer/meta_manager.go"},"region":{"startLine":748}}}],"partialFingerprints":{"codehealthFindingId/v1":"39dc59107d404a6c4c802d9945a97f94127ec69e74235344980f5a95b3e21ccb"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.generateMergeSortPlan (cognitive 30): ddl.generateMergeSortPlan has cognitive complexity 30 (threshold 15). Drivers by points: if/else 18, loops 12 (nesting depth added 11). Of this number, 26 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":"pkg/ddl/backfilling_dist_scheduler.go"},"region":{"startLine":649}}}],"partialFingerprints":{"codehealthFindingId/v1":"549d86d9b3dd951d5f8251e47bb39c82ccbd34705cb1529af077397d281136b0"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.generateOriginDefaultValue (cognitive 30): ddl.generateOriginDefaultValue has cognitive complexity 30 (threshold 15). Drivers by points: if/else 23, boolean chains 5, match/switch 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/column.go"},"region":{"startLine":1281}}}],"partialFingerprints":{"codehealthFindingId/v1":"5e77dadac5fd5ed5785690a123b26b98397a0ba9c0bc9cd033aa2ac24ce1d92f"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.checkGeneratedColumn (cognitive 30): ddl.checkGeneratedColumn has cognitive complexity 30 (threshold 15). Drivers by points: if/else 23, loops 7 (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":"pkg/ddl/create_table.go"},"region":{"startLine":551}}}],"partialFingerprints":{"codehealthFindingId/v1":"293d732b0ce49df73d351a61ca19fbcc8f741cf9ff63a275210100fcd2f50e8f"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.PollAvailableTableProgress (cognitive 30): ddl.PollAvailableTableProgress has cognitive complexity 30 (threshold 15). Drivers by points: if/else 27, boolean chains 2, loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/ddl_tiflash_api.go"},"region":{"startLine":289}}}],"partialFingerprints":{"codehealthFindingId/v1":"19c2350e4eeebcbd1347b4eee4c015202a272d737e0ba8939ca65733be5844a7"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.normalizeSplitPolicy (cognitive 30): ddl.normalizeSplitPolicy has cognitive complexity 30 (threshold 15). Drivers by points: if/else 24, boolean chains 4, 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":"pkg/ddl/split_region.go"},"region":{"startLine":344}}}],"partialFingerprints":{"codehealthFindingId/v1":"472ce854d0ca477296be69d71b3e0eeca4bb5fac23222c012e39b1c73195de66"}},{"ruleId":"D2","level":"warning","message":{"text":"executor.checkHistoryJobInTest (cognitive 30): executor.checkHistoryJobInTest has cognitive complexity 30 (threshold 15). Drivers by points: if/else 24, match/switch 3, boolean chains 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":"pkg/ddl/sanity_check.go"},"region":{"startLine":195}}}],"partialFingerprints":{"codehealthFindingId/v1":"060c702331ab93943de329370a12f443c3c3b191f3c7a5392f379ad428d846cd"}},{"ruleId":"D2","level":"warning","message":{"text":"etcdSyncer.WaitVersionSynced (cognitive 30): etcdSyncer.WaitVersionSynced has cognitive complexity 30 (threshold 15). Drivers by points: if/else 26, loops 4 (nesting depth added 18). 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/ddl/schemaver/syncer.go"},"region":{"startLine":351}}}],"partialFingerprints":{"codehealthFindingId/v1":"83a5f002973c3ec7f2dbdd0eaa09452590a26cee63e8d1f97ffae5b6e8d72666"}},{"ruleId":"D2","level":"warning","message":{"text":"Domain.analyzeJobsCleanupWorker (cognitive 30): Domain.analyzeJobsCleanupWorker has cognitive complexity 30 (threshold 15). Drivers by points: if/else 24, loops 4, match/switch 2 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/domain/domain.go"},"region":{"startLine":2386}}}],"partialFingerprints":{"codehealthFindingId/v1":"b9cee05e02cccef03df930ad2424c2f48f96ef480792cd91a0b02e189a47b3f2"}},{"ruleId":"D2","level":"warning","message":{"text":"BaseTaskExecutor.checkBalanceSubtask (cognitive 30): BaseTaskExecutor.checkBalanceSubtask has cognitive complexity 30 (threshold 15). Drivers by points: if/else 25, loops 3, match/switch 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/dxf/framework/taskexecutor/task_executor.go"},"region":{"startLine":157}}}],"partialFingerprints":{"codehealthFindingId/v1":"1566e795e48775be23f67aae0596427c9fae784e39e5ad46f6485318cc45d6fd"}},{"ruleId":"D2","level":"warning","message":{"text":"executor.buildKvRangesForIndexJoin (cognitive 30): executor.buildKvRangesForIndexJoin has cognitive complexity 30 (threshold 15). Drivers by points: if/else 17, loops 11, boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/builder.go"},"region":{"startLine":5494}}}],"partialFingerprints":{"codehealthFindingId/v1":"b73e5a8f98a5b7bd68d41e98248537d39302c7887d6a5a67170fae33093e01eb"}},{"ruleId":"D2","level":"warning","message":{"text":"RecoverIndexExec.fetchRecoverRows (cognitive 30): RecoverIndexExec.fetchRecoverRows has cognitive complexity 30 (threshold 15). Drivers by points: if/else 27, loops 3 (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/executor/admin.go"},"region":{"startLine":361}}}],"partialFingerprints":{"codehealthFindingId/v1":"65c62e74b0deaffee9387ebd8f3d62380cc57a2ff2a2ca8dcc60ed7372eccbbf"}},{"ruleId":"D2","level":"warning","message":{"text":"RecoverIndexExec.batchMarkDup (cognitive 30): RecoverIndexExec.batchMarkDup has cognitive complexity 30 (threshold 15). Drivers by points: if/else 25, loops 4, boolean chains 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":"pkg/executor/admin.go"},"region":{"startLine":457}}}],"partialFingerprints":{"codehealthFindingId/v1":"4411fd4d18a8b55198145fb5e25abf4a634cfb2ac018be0f4075dc7c09360c72"}},{"ruleId":"D2","level":"warning","message":{"text":"HashAggExec.unparallelExec (cognitive 30): HashAggExec.unparallelExec has cognitive complexity 30 (threshold 15). Drivers by points: if/else 21, loops 8, boolean chains 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/executor/aggregate/agg_hash_executor.go"},"region":{"startLine":677}}}],"partialFingerprints":{"codehealthFindingId/v1":"49c4116c0109e27b5c9467d3d70bd591c423d745ecc6f4297490013cfaa12a23"}},{"ruleId":"D2","level":"warning","message":{"text":"memtableRetriever.setDataFromCheckConstraints (cognitive 30): memtableRetriever.setDataFromCheckConstraints has cognitive complexity 30 (threshold 15). Drivers by points: if/else 21, loops 7, boolean chains 2 (nesting depth added 18). 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/executor/infoschema_reader.go"},"region":{"startLine":937}}}],"partialFingerprints":{"codehealthFindingId/v1":"433642b934e3c56a92d5deed0ff036830e4ca746d821e6be21ff1aff5d8d5c7d"}},{"ruleId":"D2","level":"warning","message":{"text":"hashRowContainer.PutChunkSelected (cognitive 30): hashRowContainer.PutChunkSelected has cognitive complexity 30 (threshold 15). Drivers by points: if/else 21, loops 5, boolean chains 4 (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":"pkg/executor/join/hash_table_v1.go"},"region":{"startLine":437}}}],"partialFingerprints":{"codehealthFindingId/v1":"9638584ea68eb1eb775504d56797d314ca81b54c5d983d1de3cb66618f353125"}},{"ruleId":"D2","level":"warning","message":{"text":"innerMergeWorker.handleTask (cognitive 30): innerMergeWorker.handleTask has cognitive complexity 30 (threshold 15). Drivers by points: if/else 20, loops 9, boolean chains 1 (nesting depth added 12). Of this number, 17 points are the body\u0027s own statements and 13 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/executor/join/index_lookup_merge_join.go"},"region":{"startLine":424}}}],"partialFingerprints":{"codehealthFindingId/v1":"f2170e1508b9de7d0c1b208c1fe717e2c54aa4eea63a2527f7ae1af68b934bf3"}},{"ruleId":"D2","level":"warning","message":{"text":"slowLogReverseScanner.loadCompressedBlocks (cognitive 30): slowLogReverseScanner.loadCompressedBlocks has cognitive complexity 30 (threshold 15). Drivers by points: if/else 28, 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":"pkg/executor/slow_query.go"},"region":{"startLine":573}}}],"partialFingerprints":{"codehealthFindingId/v1":"94d51bebcefa146335c9cabf7dfcfe72defa8e67d3a2bc3aefd07da0c0889d45"}},{"ruleId":"D2","level":"warning","message":{"text":"UnionExec.resultPuller (cognitive 30): UnionExec.resultPuller has cognitive complexity 30 (threshold 15). Drivers by points: if/else 23, loops 3, match/switch 3, boolean chains 1 (nesting depth added 17). Of this number, 26 points are the body\u0027s own statements and 4 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":"pkg/executor/unionexec/union.go"},"region":{"startLine":126}}}],"partialFingerprints":{"codehealthFindingId/v1":"634a6616e65ebd379aeafd705372cf2fee557b402488c093b9abbf4b0ec27c76"}},{"ruleId":"D2","level":"warning","message":{"text":"expression.TableInfo2SchemaAndNames (cognitive 30): expression.TableInfo2SchemaAndNames has cognitive complexity 30 (threshold 15). Drivers by points: if/else 21, loops 8, boolean chains 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":"pkg/expression/expression.go"},"region":{"startLine":1062}}}],"partialFingerprints":{"codehealthFindingId/v1":"492589bd4f13b3c8e8703a2e9da8feb1fe0db62650e14ac3811f995817a0ee8a"}},{"ruleId":"D2","level":"warning","message":{"text":"expression.GetTimeValue (cognitive 30): expression.GetTimeValue has cognitive complexity 30 (threshold 15). Drivers by points: if/else 24, match/switch 5, boolean chains 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":"pkg/expression/helper.go"},"region":{"startLine":90}}}],"partialFingerprints":{"codehealthFindingId/v1":"144860aa9bccd6efeb543e7163753ac5dd98c135dc5a3517b698d7f2896f7572"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinTranslateBinarySig.vecEvalString (cognitive 30): builtinTranslateBinarySig.vecEvalString has cognitive complexity 30 (threshold 15). Drivers by points: if/else 21, loops 6, boolean chains 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":"pkg/expression/builtin_string_vec.go"},"region":{"startLine":3094}}}],"partialFingerprints":{"codehealthFindingId/v1":"3c958cb1959e948f425c7533de6e042327e00567082a29ab37abd15fd6111ece"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinTranslateUTF8Sig.vecEvalString (cognitive 30): builtinTranslateUTF8Sig.vecEvalString has cognitive complexity 30 (threshold 15). Drivers by points: if/else 21, loops 6, boolean chains 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":"pkg/expression/builtin_string_vec.go"},"region":{"startLine":3167}}}],"partialFingerprints":{"codehealthFindingId/v1":"cdbe6781cd6f6530746006ba15dec6af9b940c3c18e723158695de7ff73cf101"}},{"ruleId":"D2","level":"warning","message":{"text":"unixTimestampFunctionClass.getFunction (cognitive 30): unixTimestampFunctionClass.getFunction has cognitive complexity 30 (threshold 15). Drivers by points: if/else 29, boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/builtin_time.go"},"region":{"startLine":4363}}}],"partialFingerprints":{"codehealthFindingId/v1":"00b9e0b9b4b7a146b027074b80222e877e265774afb0634d5a87cea7f6355627"}},{"ruleId":"D2","level":"warning","message":{"text":"infoschema.applyRefreshMeta (cognitive 30): infoschema.applyRefreshMeta has cognitive complexity 30 (threshold 15). Drivers by points: if/else 28, boolean chains 2 (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":"pkg/infoschema/builder.go"},"region":{"startLine":146}}}],"partialFingerprints":{"codehealthFindingId/v1":"3e85d2deb1ec79120b83b16f0d96644bbcf7f773e47488ed5108f0e9611a4cee"}},{"ruleId":"D2","level":"warning","message":{"text":"ossstore.NewOSSStorage (cognitive 30): ossstore.NewOSSStorage has cognitive complexity 30 (threshold 15). Drivers by points: if/else 28, 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":"pkg/objstore/ossstore/store.go"},"region":{"startLine":77}}}],"partialFingerprints":{"codehealthFindingId/v1":"71c2f0d2522a791f8116ac20f854281349d6ebf7634fd124e18f21a42ed8a725"}},{"ruleId":"D2","level":"warning","message":{"text":"core.indexJoinPathBuildTmpRange (cognitive 30): core.indexJoinPathBuildTmpRange has cognitive complexity 30 (threshold 15). Drivers by points: if/else 28, boolean chains 1, loops 1 (nesting depth added 15). Of this number, 28 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":"pkg/planner/core/index_join_path.go"},"region":{"startLine":440}}}],"partialFingerprints":{"codehealthFindingId/v1":"c6e18098293cf6976e470538608612af2ef83b9bb3b583fa760843dbef668a65"}},{"ruleId":"D2","level":"warning","message":{"text":"core.buildPartialPaths4MVIndex (cognitive 30): core.buildPartialPaths4MVIndex has cognitive complexity 30 (threshold 15). Drivers by points: if/else 22, boolean chains 4, loops 3, match/switch 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":"pkg/planner/core/indexmerge_path.go"},"region":{"startLine":838}}}],"partialFingerprints":{"codehealthFindingId/v1":"798cb1e2549062e4366dcba2186956f5cd7ae7502c3ccc11c1515d325e270912"}},{"ruleId":"D2","level":"warning","message":{"text":"expressionRewriter.constructBinaryOpFunction (cognitive 30): expressionRewriter.constructBinaryOpFunction has cognitive complexity 30 (threshold 15). Drivers by points: if/else 17, loops 7, match/switch 5, boolean chains 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":"pkg/planner/core/expression_rewriter.go"},"region":{"startLine":413}}}],"partialFingerprints":{"codehealthFindingId/v1":"2de90d39f96e32092523cc60b67fce623439af1b44ccdc1f8eeb2bff1776ddc5"}},{"ruleId":"D2","level":"warning","message":{"text":"expressionRewriter.handleScalarSubquery (cognitive 30): expressionRewriter.handleScalarSubquery has cognitive complexity 30 (threshold 15). Drivers by points: if/else 21, loops 7, boolean chains 2 (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/planner/core/expression_rewriter.go"},"region":{"startLine":1527}}}],"partialFingerprints":{"codehealthFindingId/v1":"baba32a9a9f5bdde45adf8a20632e37e20b94101dd59202843b26f2cfa6dffde"}},{"ruleId":"D2","level":"warning","message":{"text":"havingWindowAndOrderbyExprResolver.resolveFromPlan (cognitive 30): havingWindowAndOrderbyExprResolver.resolveFromPlan has cognitive complexity 30 (threshold 15). Drivers by points: if/else 22, boolean chains 5, match/switch 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/logical_plan_builder.go"},"region":{"startLine":2692}}}],"partialFingerprints":{"codehealthFindingId/v1":"d864f662379423a7c8250d7528e3c129c6443e8fc59994dea2cad8b095bec64c"}},{"ruleId":"D2","level":"warning","message":{"text":"DataSource.CheckPartialIndexes (cognitive 30): DataSource.CheckPartialIndexes has cognitive complexity 30 (threshold 15). Drivers by points: if/else 20, boolean chains 6, loops 4 (nesting depth added 11). Of this number, 27 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":"pkg/planner/core/operator/logicalop/logical_datasource.go"},"region":{"startLine":870}}}],"partialFingerprints":{"codehealthFindingId/v1":"ea605ca14ae609aa93849c9b8b2aad3ad8feb58272da0192cf420e54880d3fbe"}},{"ruleId":"D2","level":"warning","message":{"text":"physicalop.GetMergeJoin (cognitive 30): physicalop.GetMergeJoin has cognitive complexity 30 (threshold 15). Drivers by points: if/else 20, boolean chains 5, loops 5 (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/planner/core/operator/physicalop/physical_merge_join.go"},"region":{"startLine":50}}}],"partialFingerprints":{"codehealthFindingId/v1":"1051ca4cf11167317526955f5c82cb9f81c089e1796f7175e7486336be99f5fe"}},{"ruleId":"D2","level":"warning","message":{"text":"PhysicalHashJoin.ToPB (cognitive 30): PhysicalHashJoin.ToPB has cognitive complexity 30 (threshold 15). Drivers by points: if/else 22, loops 5, boolean chains 2, match/switch 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/operator/physicalop/physical_hash_join.go"},"region":{"startLine":481}}}],"partialFingerprints":{"codehealthFindingId/v1":"07502fe63cb9093cf37dbeb2341043818d3c9d40e9074e9492b96d11e576288b"}},{"ruleId":"D2","level":"warning","message":{"text":"PlanBuilder.BuildDataSourceFromView (cognitive 30): PlanBuilder.BuildDataSourceFromView has cognitive complexity 30 (threshold 15). Drivers by points: if/else 23, loops 4, boolean chains 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":"pkg/planner/core/logical_plan_builder.go"},"region":{"startLine":5508}}}],"partialFingerprints":{"codehealthFindingId/v1":"0d7baf902202de9db616e97e314d4e3c33a1de377e09e53b1ed2320f82385bdc"}},{"ruleId":"D2","level":"warning","message":{"text":"indexadvisor.CollectIndexableColumnsFromQuery (cognitive 30): indexadvisor.CollectIndexableColumnsFromQuery has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14, loops 12, match/switch 4 (nesting depth added 14). Most of this is not in the body itself: 3 of the 30 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 390, 433). 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":"pkg/planner/indexadvisor/utils.go"},"region":{"startLine":372}}}],"partialFingerprints":{"codehealthFindingId/v1":"41dea703925bf59a11b049339ff73341f8150e3ca9a05d3734b8a311cebcfea8"}},{"ruleId":"D2","level":"warning","message":{"text":"UserPrivileges.RequestVerification (cognitive 30): UserPrivileges.RequestVerification has cognitive complexity 30 (threshold 15). Drivers by points: if/else 18, match/switch 5, boolean chains 4, 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":"pkg/privilege/privileges/privileges.go"},"region":{"startLine":164}}}],"partialFingerprints":{"codehealthFindingId/v1":"526ed457d22a86bebb72783a4ca5964fb69539aa19bd0adade7921e0ddb3131c"}},{"ruleId":"D2","level":"warning","message":{"text":"server.parseBinaryParams (cognitive 30): server.parseBinaryParams has cognitive complexity 30 (threshold 15). Drivers by points: if/else 23, match/switch 6, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/server/conn_stmt_params.go"},"region":{"startLine":38}}}],"partialFingerprints":{"codehealthFindingId/v1":"a8955c39013ee933f79236798f44cc011810e70b39a99bb7df5f1a142882993d"}},{"ruleId":"D2","level":"warning","message":{"text":"tikvhandler.parseQuery (cognitive 30): tikvhandler.parseQuery has cognitive complexity 30 (threshold 15). Drivers by points: if/else 29, loops 1 (nesting depth added 18). 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/server/handler/tikvhandler/tikv_handler.go"},"region":{"startLine":1619}}}],"partialFingerprints":{"codehealthFindingId/v1":"87428dca7956094935bc80dcdf83b02eaca1c36d391e39ed76abbed8122a1db7"}},{"ruleId":"D2","level":"warning","message":{"text":"LoadKeyspaceController.OnServerCreated (cognitive 30): LoadKeyspaceController.OnServerCreated has cognitive complexity 30 (threshold 15). Drivers by points: if/else 19, loops 7, boolean chains 4 (nesting depth added 16). Most of this is not in the body itself: 1 of the 30 points is its own statement and the rest belongs to one function literal inside it that branches (line 53). 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":"pkg/standby/idle_watcher.go"},"region":{"startLine":46}}}],"partialFingerprints":{"codehealthFindingId/v1":"512b78a52f0654d291fa6de8736cd984f0e64adb77b27dc8d9f617f88eb6bab8"}},{"ruleId":"D2","level":"warning","message":{"text":"statsUsageImpl.dumpStatsDeltaToKV (cognitive 30): statsUsageImpl.dumpStatsDeltaToKV has cognitive complexity 30 (threshold 15). Drivers by points: if/else 26, boolean chains 2, loops 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/statistics/handle/usage/session_stats_collect.go"},"region":{"startLine":256}}}],"partialFingerprints":{"codehealthFindingId/v1":"1a6c5fadf1aff2f913a7348e82fd6448142e5f5d3287a2fa9e0c3b8189e74e8a"}},{"ruleId":"D2","level":"warning","message":{"text":"copIteratorWorker.handleCopCache (cognitive 30): copIteratorWorker.handleCopCache has cognitive complexity 30 (threshold 15). Drivers by points: if/else 27, boolean chains 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":"pkg/store/copr/coprocessor.go"},"region":{"startLine":2586}}}],"partialFingerprints":{"codehealthFindingId/v1":"c65115ccf3001d93e1568d5aa5e399b0133151d742f373141a51c04197ed3007"}},{"ruleId":"D2","level":"warning","message":{"text":"MVCCStore.CheckTxnStatus (cognitive 30): MVCCStore.CheckTxnStatus has cognitive complexity 30 (threshold 15). Drivers by points: if/else 26, boolean chains 4 (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":"pkg/store/mockstore/unistore/tikv/mvcc.go"},"region":{"startLine":497}}}],"partialFingerprints":{"codehealthFindingId/v1":"50e98e9607eafdfca337e80c6457ea375db67e011ca4edb2418a0001795fba16"}},{"ruleId":"D2","level":"warning","message":{"text":"ttlworker.prepareSession (cognitive 30): ttlworker.prepareSession has cognitive complexity 30 (threshold 15). Drivers by points: if/else 27, boolean chains 3 (nesting depth added 7). Of this number, 17 points are the body\u0027s own statements and 13 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/ttl/ttlworker/session.go"},"region":{"startLine":72}}}],"partialFingerprints":{"codehealthFindingId/v1":"d30687f8cf552333a9c87a1fcb7ae158f59022b694148ee5bc9f4941e6252ec8"}},{"ruleId":"D2","level":"warning","message":{"text":"TTLTimersSyncer.SyncTimers (cognitive 30): TTLTimersSyncer.SyncTimers has cognitive complexity 30 (threshold 15). Drivers by points: if/else 21, loops 9 (nesting depth added 13). Of this number, 24 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":"pkg/ttl/ttlworker/timer_sync.go"},"region":{"startLine":176}}}],"partialFingerprints":{"codehealthFindingId/v1":"b5e535d63b37b83b104020ad4a9a60b8368b6cb2a445b5c91b2b1b6240df3efb"}},{"ruleId":"D2","level":"warning","message":{"text":"types.unquoteJSONString (cognitive 30): types.unquoteJSONString has cognitive complexity 30 (threshold 15). Drivers by points: if/else 25, match/switch 3, boolean chains 1, 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":"pkg/types/json_binary_functions.go"},"region":{"startLine":109}}}],"partialFingerprints":{"codehealthFindingId/v1":"b4ba49249d0f3ea688e48ad94ed529f63331ea6a6653cf00c1ee49d8a47b2bca"}},{"ruleId":"D2","level":"warning","message":{"text":"types.mergePatchBinaryJSON (cognitive 30): types.mergePatchBinaryJSON has cognitive complexity 30 (threshold 15). Drivers by points: if/else 20, loops 9, boolean chains 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":"pkg/types/json_binary_functions.go"},"region":{"startLine":917}}}],"partialFingerprints":{"codehealthFindingId/v1":"8670997da6641290f15d5c00e35d434362b113fc8e320c635a9c63a8e767aa10"}},{"ruleId":"D2","level":"warning","message":{"text":"keydecoder.DecodeKey (cognitive 30): keydecoder.DecodeKey has cognitive complexity 30 (threshold 15). Drivers by points: if/else 26, loops 3, boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/util/keydecoder/keydecoder.go"},"region":{"startLine":74}}}],"partialFingerprints":{"codehealthFindingId/v1":"5c04326836387361c7b969d350f50a0cdbf8d19081f90f050e8d493deab6c6ec"}},{"ruleId":"D2","level":"warning","message":{"text":"conditionChecker.checkLikeFunc (cognitive 30): conditionChecker.checkLikeFunc has cognitive complexity 30 (threshold 15). Drivers by points: if/else 27, boolean chains 2, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/util/ranger/checker.go"},"region":{"startLine":160}}}],"partialFingerprints":{"codehealthFindingId/v1":"4d045146ba6bb2fa917c25d51f5987712aeac3c5c72bcb6282d2c1315e40eafc"}},{"ruleId":"D2","level":"warning","message":{"text":"ChunkDecoder.decodeColToChunk (cognitive 30): ChunkDecoder.decodeColToChunk has cognitive complexity 30 (threshold 15). Drivers by points: if/else 27, boolean chains 2, match/switch 1 (nesting depth added 14). 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":"pkg/util/rowcodec/decoder.go"},"region":{"startLine":290}}}],"partialFingerprints":{"codehealthFindingId/v1":"ef72baa2f4fb8e1c6fc6cf5c6b1cf72dd308840df5891feb7427ab1b72426c7d"}},{"ruleId":"D2","level":"warning","message":{"text":"workloadlearning.extractMetricsFromOperatorTree (cognitive 30): workloadlearning.extractMetricsFromOperatorTree has cognitive complexity 30 (threshold 15). Drivers by points: if/else 22, boolean chains 4, loops 3, match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/workloadlearning/handle.go"},"region":{"startLine":414}}}],"partialFingerprints":{"codehealthFindingId/v1":"6bc4794963c574c2955fb087f33817a2fc46d0fa8b44ff750b857cc9114c4bb2"}},{"ruleId":"D2","level":"warning","message":{"text":"ast.dedupStatsObjects (cognitive 30): ast.dedupStatsObjects has cognitive complexity 30 (threshold 15). Drivers by points: if/else 23, loops 4, match/switch 2, boolean chains 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/parser/ast/stats.go"},"region":{"startLine":432}}}],"partialFingerprints":{"codehealthFindingId/v1":"a4a2bdbbe3b3d5a1970d40719ceb30e64ff81a4ebe518fb44ec166a725d7c9d1"}},{"ruleId":"D2","level":"warning","message":{"text":"parser.startWithSlash (cognitive 30): parser.startWithSlash has cognitive complexity 30 (threshold 15). Drivers by points: if/else 23, match/switch 4, boolean chains 2, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/parser/lexer.go"},"region":{"startLine":559}}}],"partialFingerprints":{"codehealthFindingId/v1":"53e91e64204668af75ad3a3557d2254d3213d125d24df0a36da9ba3926249db9"}},{"ruleId":"D2","level":"warning","message":{"text":"MyDecimal.FromString (cognitive 30): MyDecimal.FromString has cognitive complexity 30 (threshold 15). Drivers by points: if/else 17, loops 7, boolean chains 5, match/switch 1 (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":"pkg/parser/test_driver/test_driver_mydecimal.go"},"region":{"startLine":186}}}],"partialFingerprints":{"codehealthFindingId/v1":"c7d8f3bc33d3736a3557605e39b06e0c5beb39673fc5c82b3f03da09d50e94af"}},{"ruleId":"D2","level":"warning","message":{"text":"Registry.checkForTableConflicts (cognitive 29): Registry.checkForTableConflicts has cognitive complexity 29 (threshold 15). Drivers by points: if/else 18, loops 10, boolean chains 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":"br/pkg/registry/registration.go"},"region":{"startLine":585}}}],"partialFingerprints":{"codehealthFindingId/v1":"11f0c65b050ea0d8c16a3ccf2cb9f65974f5a8a6f21815b1da8936bc97ae3b67"}},{"ruleId":"D2","level":"warning","message":{"text":"SnapFileImporter.ingest (cognitive 29): SnapFileImporter.ingest has cognitive complexity 29 (threshold 15). Drivers by points: if/else 20, loops 5, match/switch 3, boolean chains 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":"br/pkg/restore/snap_client/import.go"},"region":{"startLine":1214}}}],"partialFingerprints":{"codehealthFindingId/v1":"0f119dbfa721e6c5ef2ae58b09257d1cd7e97652be1221065c5920a5f38a3783"}},{"ruleId":"D2","level":"warning","message":{"text":"task.RunStreamStart (cognitive 29): task.RunStreamStart has cognitive complexity 29 (threshold 15). Drivers by points: if/else 27, boolean chains 2 (nesting depth added 6). Of this number, 28 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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":"br/pkg/task/stream.go"},"region":{"startLine":601}}}],"partialFingerprints":{"codehealthFindingId/v1":"7adc31d114950ae98e61994ea540118bd7a4d1abc64962cc1513c1830158d722"}},{"ruleId":"D2","level":"warning","message":{"text":"checksumTableCtx.genRequestsWithIDMap (cognitive 29): checksumTableCtx.genRequestsWithIDMap has cognitive complexity 29 (threshold 15). Drivers by points: if/else 19, loops 10 (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":"br/pkg/task/operator/checksum_table.go"},"region":{"startLine":348}}}],"partialFingerprints":{"codehealthFindingId/v1":"6d308858d9549c907031c772331b544fe925455ce6ac853845c134b0fcfa163c"}},{"ruleId":"D2","level":"warning","message":{"text":"tableEmptyCheckItem.Check (cognitive 29): tableEmptyCheckItem.Check has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13, loops 7, match/switch 7, boolean chains 1, jumps 1 (nesting depth added 14). Most of this is not in the body itself: 13 of the 29 points are its own statements and the rest belongs to one function literal inside it that branches (line 1408). 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":"lightning/pkg/importer/precheck_impl.go"},"region":{"startLine":1384}}}],"partialFingerprints":{"codehealthFindingId/v1":"9f3540622020e8918ab4784ca59ea3b2fbbc6d99a644d64aec14ee4a67e187a8"}},{"ruleId":"D2","level":"warning","message":{"text":"config.InitializeConfig (cognitive 29): config.InitializeConfig has cognitive complexity 29 (threshold 15). Drivers by points: if/else 27, boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/config/config.go"},"region":{"startLine":1452}}}],"partialFingerprints":{"codehealthFindingId/v1":"353db856ed893f50e92ef7afe1a5463df7d6d6ac2ec470dc05dac9e9f972c898"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.checkAddPartitionValue (cognitive 29): ddl.checkAddPartitionValue has cognitive complexity 29 (threshold 15). Drivers by points: if/else 23, loops 3, boolean chains 2, match/switch 1 (nesting depth added 17). 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":"pkg/ddl/partition.go"},"region":{"startLine":428}}}],"partialFingerprints":{"codehealthFindingId/v1":"2de4dbfb9a0dd45fb2e9033180132c4f03a58afb6d8322ddcbe28a32585b5e45"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.onUpdateTiFlashReplicaStatus (cognitive 29): ddl.onUpdateTiFlashReplicaStatus has cognitive complexity 29 (threshold 15). Drivers by points: if/else 19, loops 6, boolean chains 4 (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/ddl/table.go"},"region":{"startLine":1233}}}],"partialFingerprints":{"codehealthFindingId/v1":"85e7f6aceca6dbf5545fbd0d2be12159d5f73ba8a6f27689dd320e5776558aef"}},{"ruleId":"D2","level":"warning","message":{"text":"cleanUpIndexWorker.BackfillData (cognitive 29): cleanUpIndexWorker.BackfillData has cognitive complexity 29 (threshold 15). Drivers by points: if/else 26, loops 2, boolean chains 1 (nesting depth added 13). Most of this is not in the body itself: 0 of the 29 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 3785, 3858, 3776). 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":"pkg/ddl/index.go"},"region":{"startLine":3775}}}],"partialFingerprints":{"codehealthFindingId/v1":"4b534f67e56a015fc35f556c68cf529c35728f6a1d58c19ac58c184e9d9c46cf"}},{"ruleId":"D2","level":"warning","message":{"text":"worker.onRecoverTable (cognitive 29): worker.onRecoverTable has cognitive complexity 29 (threshold 15). Drivers by points: if/else 26, boolean chains 2, 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":"pkg/ddl/table.go"},"region":{"startLine":159}}}],"partialFingerprints":{"codehealthFindingId/v1":"feab399018cd92543626b7d579f6555e3e6dd91776943fab5d47cfef8572906b"}},{"ruleId":"D2","level":"warning","message":{"text":"executor.tlsOption2GlobalPriv (cognitive 29): executor.tlsOption2GlobalPriv has cognitive complexity 29 (threshold 15). Drivers by points: if/else 21, match/switch 5, loops 2, boolean chains 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":"pkg/executor/grant.go"},"region":{"startLine":407}}}],"partialFingerprints":{"codehealthFindingId/v1":"9b071d1383d27301ce240b8b0aadb70b67c70a270446f67d4f088d0b7e6ceaf5"}},{"ruleId":"D2","level":"warning","message":{"text":"memtableRetriever.setDataFromTableConstraints (cognitive 29): memtableRetriever.setDataFromTableConstraints has cognitive complexity 29 (threshold 15). Drivers by points: if/else 23, 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":"pkg/executor/infoschema_reader.go"},"region":{"startLine":2300}}}],"partialFingerprints":{"codehealthFindingId/v1":"304c8e97fc89f39bc96785eae017f6d5c25f038917f8c821d464c835f8a524ca"}},{"ruleId":"D2","level":"warning","message":{"text":"indexHashJoinInnerWorker.run (cognitive 29): indexHashJoinInnerWorker.run has cognitive complexity 29 (threshold 15). Drivers by points: if/else 21, match/switch 5, boolean chains 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":"pkg/executor/join/index_lookup_hash_join.go"},"region":{"startLine":543}}}],"partialFingerprints":{"codehealthFindingId/v1":"0fb4e8cec44557d223fa12521920a9d0af29139e9fd751f0027ad8c1b90287f3"}},{"ruleId":"D2","level":"warning","message":{"text":"clusterLogRetriever.startRetrieving (cognitive 29): clusterLogRetriever.startRetrieving has cognitive complexity 29 (threshold 15). Drivers by points: if/else 17, match/switch 7, loops 3, boolean chains 2 (nesting depth added 15). Most of this is not in the body itself: 6 of the 29 points are its own statements and the rest belongs to one function literal inside it that branches (line 502). 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":"pkg/executor/memtable_reader.go"},"region":{"startLine":470}}}],"partialFingerprints":{"codehealthFindingId/v1":"2f5060e1e779def249077063ba0a1dd3d4bbf4906eb31a5f992f02920bedd6c2"}},{"ruleId":"D2","level":"warning","message":{"text":"ShowExec.fetchShowImportGroups (cognitive 29): ShowExec.fetchShowImportGroups has cognitive complexity 29 (threshold 15). Drivers by points: if/else 23, boolean chains 2, loops 2, match/switch 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/show.go"},"region":{"startLine":2721}}}],"partialFingerprints":{"codehealthFindingId/v1":"b5e9a98397fbf80c0b0b823e58e3522d530871ed2b9c7dccd6969140c73b4152"}},{"ruleId":"D2","level":"warning","message":{"text":"TableReaderExecutor.buildRespForGroupedRanges (cognitive 29): TableReaderExecutor.buildRespForGroupedRanges has cognitive complexity 29 (threshold 15). Drivers by points: if/else 22, loops 4, boolean chains 3 (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":"pkg/executor/table_reader.go"},"region":{"startLine":401}}}],"partialFingerprints":{"codehealthFindingId/v1":"15329d023591f98088df63995d3293902b736f1de401da03938254b994a57072"}},{"ruleId":"D2","level":"warning","message":{"text":"globalsort.MergeOverlappingFilesV2 (cognitive 29): globalsort.MergeOverlappingFilesV2 has cognitive complexity 29 (threshold 15). Drivers by points: if/else 25, loops 4 (nesting depth added 13). Of this number, 18 points are the body\u0027s own statements and 11 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":"pkg/ingestor/globalsort/merge_v2.go"},"region":{"startLine":38}}}],"partialFingerprints":{"codehealthFindingId/v1":"37eb9f87ce2975905a85fe8a630ae2091cb5e78d5736848861dcf42251d3e773"}},{"ruleId":"D2","level":"warning","message":{"text":"globalsort.readAllData (cognitive 29): globalsort.readAllData has cognitive complexity 29 (threshold 15). Drivers by points: if/else 17, loops 7, match/switch 5 (nesting depth added 14). Most of this is not in the body itself: 10 of the 29 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 114, 59). 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":"pkg/ingestor/globalsort/reader.go"},"region":{"startLine":42}}}],"partialFingerprints":{"codehealthFindingId/v1":"f473c09ad5a8ad56d40e0641cee6ceb1f63ea13bf0e71b72955965581277def6"}},{"ruleId":"D2","level":"warning","message":{"text":"RangeSplitter.SplitOneRangesGroup (cognitive 29): RangeSplitter.SplitOneRangesGroup has cognitive complexity 29 (threshold 15). Drivers by points: if/else 16, loops 9, boolean chains 4 (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":"pkg/ingestor/globalsort/split.go"},"region":{"startLine":184}}}],"partialFingerprints":{"codehealthFindingId/v1":"03b546ff12baeb34e2e616bd204c92472f684336eb7eab648c68e611870a1b72"}},{"ruleId":"D2","level":"warning","message":{"text":"Backend.ImportEngine (cognitive 29): Backend.ImportEngine has cognitive complexity 29 (threshold 15). Drivers by points: if/else 28, 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":"pkg/ingestor/ingestctrl/local.go"},"region":{"startLine":1406}}}],"partialFingerprints":{"codehealthFindingId/v1":"ea9d85bfc90ed92abaca568aff74e005d5c199df8fdf1497dd735b4ef910b355"}},{"ruleId":"D2","level":"warning","message":{"text":"common.BuildAddIndexSQL (cognitive 29): common.BuildAddIndexSQL has cognitive complexity 29 (threshold 15). Drivers by points: if/else 22, loops 6, jumps 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":"pkg/lightning/common/util.go"},"region":{"startLine":518}}}],"partialFingerprints":{"codehealthFindingId/v1":"31ae5de67b77045c87c867673cda4d428a5f895432cadad8aa7366b867ed2d70"}},{"ruleId":"D2","level":"warning","message":{"text":"mdLoaderSetup.route (cognitive 29): mdLoaderSetup.route has cognitive complexity 29 (threshold 15). Drivers by points: if/else 23, loops 6 (nesting depth added 9). Of this number, 19 points are the body\u0027s own statements and 10 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/lightning/mydump/loader.go"},"region":{"startLine":671}}}],"partialFingerprints":{"codehealthFindingId/v1":"f8670949fee0ea7880028f1f10845936b7c100be253925ca56e1b458e3d63f59"}},{"ruleId":"D2","level":"warning","message":{"text":"core.completePhysicalIndexJoin (cognitive 29): core.completePhysicalIndexJoin has cognitive complexity 29 (threshold 15). Drivers by points: if/else 21, boolean chains 4, loops 2, match/switch 2 (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":"pkg/planner/core/exhaust_physical_plans.go"},"region":{"startLine":374}}}],"partialFingerprints":{"codehealthFindingId/v1":"328f7825ee3929c0185be130f81abe7c88fc8fb8276f53a95e5f6eb19fc19b4a"}},{"ruleId":"D2","level":"warning","message":{"text":"core.generateOtherIndexMerge (cognitive 29): core.generateOtherIndexMerge has cognitive complexity 29 (threshold 15). Drivers by points: if/else 22, loops 6, 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":"pkg/planner/core/indexmerge_path.go"},"region":{"startLine":516}}}],"partialFingerprints":{"codehealthFindingId/v1":"2ca207cc67ce9c121b1cc6f3a6b321ee6a261292dc2471f19388df5e0c409c68"}},{"ruleId":"D2","level":"warning","message":{"text":"core.indexIsAvailableByHints (cognitive 29): core.indexIsAvailableByHints has cognitive complexity 29 (threshold 15). Drivers by points: if/else 20, boolean chains 5, loops 2, match/switch 2 (nesting depth added 11). Of this number, 28 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":"pkg/planner/core/point_get_plan.go"},"region":{"startLine":676}}}],"partialFingerprints":{"codehealthFindingId/v1":"fc5e88246419b681c6932f53015489f8aeffd45df0e03896617088d57b4a9a66"}},{"ruleId":"D2","level":"warning","message":{"text":"core.pruneRedundantApply (cognitive 29): core.pruneRedundantApply has cognitive complexity 29 (threshold 15). Drivers by points: if/else 21, loops 6, boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/rule_decorrelate.go"},"region":{"startLine":143}}}],"partialFingerprints":{"codehealthFindingId/v1":"f41c2abf9e528b939ea8ce1f7dcdf693d956c0e6496ccc82c25ffdfdbb21bbcf"}},{"ruleId":"D2","level":"warning","message":{"text":"DataSource.HandleColsToAppend (cognitive 29): DataSource.HandleColsToAppend has cognitive complexity 29 (threshold 15). Drivers by points: if/else 17, boolean chains 6, loops 6 (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/planner/core/operator/logicalop/logical_datasource.go"},"region":{"startLine":632}}}],"partialFingerprints":{"codehealthFindingId/v1":"aaa6905be5df5fa77be4aa0a459580d46db8f5862f06a5d20e4b8d3294f7efaf"}},{"ruleId":"D2","level":"warning","message":{"text":"physicalop.getEnforcedMergeJoin (cognitive 29): physicalop.getEnforcedMergeJoin has cognitive complexity 29 (threshold 15). Drivers by points: if/else 24, loops 3, boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/operator/physicalop/physical_merge_join.go"},"region":{"startLine":146}}}],"partialFingerprints":{"codehealthFindingId/v1":"70a6f9e62d2d0a98abdea90df8272ecff4178e5504c5427720846516433bbf84"}},{"ruleId":"D2","level":"warning","message":{"text":"PhysicalIndexScan.OperatorInfo (cognitive 29): PhysicalIndexScan.OperatorInfo has cognitive complexity 29 (threshold 15). Drivers by points: if/else 23, loops 6 (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":"pkg/planner/core/operator/physicalop/physical_index_scan.go"},"region":{"startLine":260}}}],"partialFingerprints":{"codehealthFindingId/v1":"da9058583db02f723bb1f014eb2f32402b1c7f8202c4d75bf1c60e0309e20373"}},{"ruleId":"D2","level":"warning","message":{"text":"PlanBuilder.appendAuxiliaryFieldsForSubqueries (cognitive 29): PlanBuilder.appendAuxiliaryFieldsForSubqueries has cognitive complexity 29 (threshold 15). Drivers by points: if/else 18, loops 10, boolean chains 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/planner/core/subquery_plan_builder.go"},"region":{"startLine":104}}}],"partialFingerprints":{"codehealthFindingId/v1":"6b0353f6eee67dc2533a3c3a416eba7188a55962faed4fd310c642b803998896"}},{"ruleId":"D2","level":"warning","message":{"text":"aliasChecker.Enter (cognitive 29): aliasChecker.Enter has cognitive complexity 29 (threshold 15). Drivers by points: if/else 20, loops 7, boolean chains 2 (nesting depth added 18). 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/planner/core/preprocess.go"},"region":{"startLine":2357}}}],"partialFingerprints":{"codehealthFindingId/v1":"a4c32da0ba58ed807af98a79baba89f91fe78ba40344927fe32fbb08c4db3618"}},{"ruleId":"D2","level":"warning","message":{"text":"joinReorderGreedySolver.constructConnectedJoinTree (cognitive 29): joinReorderGreedySolver.constructConnectedJoinTree has cognitive complexity 29 (threshold 15). Drivers by points: if/else 22, boolean chains 4, loops 3 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/rule_join_reorder_greedy.go"},"region":{"startLine":98}}}],"partialFingerprints":{"codehealthFindingId/v1":"4ce3c40e851a29d60e1a48b862f21801ae312354b6e1c276192bd3f3ee2b9174"}},{"ruleId":"D2","level":"warning","message":{"text":"compressedReader.Read (cognitive 29): compressedReader.Read has cognitive complexity 29 (threshold 15). Drivers by points: if/else 26, match/switch 3 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/server/internal/packetio.go"},"region":{"startLine":492}}}],"partialFingerprints":{"codehealthFindingId/v1":"e6a1ad74c871abbb03e34c924a9f703f4544b5e1b66bac715a7e5f940853c31d"}},{"ruleId":"D2","level":"warning","message":{"text":"session.EncodeStates (cognitive 29): session.EncodeStates has cognitive complexity 29 (threshold 15). Drivers by points: if/else 21, match/switch 4, boolean chains 2, loops 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/session/session.go"},"region":{"startLine":5622}}}],"partialFingerprints":{"codehealthFindingId/v1":"2aaa8199b5e926ccf705fb0960a863e9b14315578d2016547cf770d863e393de"}},{"ruleId":"D2","level":"warning","message":{"text":"storage.gcTableStats (cognitive 29): storage.gcTableStats has cognitive complexity 29 (threshold 15). Drivers by points: if/else 22, loops 7 (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":"pkg/statistics/handle/storage/gc.go"},"region":{"startLine":276}}}],"partialFingerprints":{"codehealthFindingId/v1":"3d66f153c3d53ac71237b88313ceac948f0d0d5772d1dab57d9e52a067e69ac8"}},{"ruleId":"D2","level":"warning","message":{"text":"statsUsageImpl.DumpStatsDeltaToKV (cognitive 29): statsUsageImpl.DumpStatsDeltaToKV has cognitive complexity 29 (threshold 15). Drivers by points: if/else 22, loops 7 (nesting depth added 15). Most of this is not in the body itself: 11 of the 29 points are its own statements and the rest belongs to one function literal inside it that branches (line 135). 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":"pkg/statistics/handle/usage/session_stats_collect.go"},"region":{"startLine":103}}}],"partialFingerprints":{"codehealthFindingId/v1":"b6c6b7b2fa16a87c156083e20494fcecf53be5736f9bdcc16da89d75395ae902"}},{"ruleId":"D2","level":"warning","message":{"text":"copr.buildExceedsBoundDiagFields (cognitive 29): copr.buildExceedsBoundDiagFields has cognitive complexity 29 (threshold 15). Drivers by points: if/else 19, boolean chains 10 (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":"pkg/store/copr/coprocessor.go"},"region":{"startLine":2005}}}],"partialFingerprints":{"codehealthFindingId/v1":"9c7a06f677b9b45d6f955f501fdd1570c4db611cb30ed1ad079ba6643adc0393"}},{"ruleId":"D2","level":"warning","message":{"text":"copr.checkRangesCovered (cognitive 29): copr.checkRangesCovered has cognitive complexity 29 (threshold 15). Drivers by points: if/else 17, loops 8, boolean chains 4 (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":"pkg/store/copr/region_cache.go"},"region":{"startLine":309}}}],"partialFingerprints":{"codehealthFindingId/v1":"5a00f16006548e4106d4693a6d60dd719727a29719560962ed90821d2966a61a"}},{"ruleId":"D2","level":"warning","message":{"text":"closureExecutor.execute (cognitive 29): closureExecutor.execute has cognitive complexity 29 (threshold 15). Drivers by points: if/else 28, 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":"pkg/store/mockstore/unistore/cophandler/closure_exec.go"},"region":{"startLine":557}}}],"partialFingerprints":{"codehealthFindingId/v1":"3bc3f39bf750f5c00411bbf4e96f61c9c8fbc117704c048063d6b6ab4e9ae53e"}},{"ruleId":"D2","level":"warning","message":{"text":"table.handleZeroDatetime (cognitive 29): table.handleZeroDatetime has cognitive complexity 29 (threshold 15). Drivers by points: if/else 20, boolean chains 8, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/table/column.go"},"region":{"startLine":237}}}],"partialFingerprints":{"codehealthFindingId/v1":"d51e791d010f43d007788112bec47d42fd7622a3d00cb0460bb543c54fd4e31c"}},{"ruleId":"D2","level":"warning","message":{"text":"util.NewTLSConfig (cognitive 29): util.NewTLSConfig has cognitive complexity 29 (threshold 15). Drivers by points: if/else 23, boolean chains 3, loops 3 (nesting depth added 6). Of this number, 18 points are the body\u0027s own statements and 11 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":"pkg/util/security.go"},"region":{"startLine":174}}}],"partialFingerprints":{"codehealthFindingId/v1":"190fe1af3b2cbd2c1377e315aa23251d3f28c03ef3a65895dde4219a0c75dca9"}},{"ruleId":"D2","level":"warning","message":{"text":"MemArbitrator.UpdateDigestProfileCache (cognitive 29): MemArbitrator.UpdateDigestProfileCache has cognitive complexity 29 (threshold 15). Drivers by points: if/else 22, boolean chains 4, loops 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/util/memory/arbitrator.go"},"region":{"startLine":852}}}],"partialFingerprints":{"codehealthFindingId/v1":"a8aee3b8541fca89a063a04932502b88fb7a2fc086270407d45e88d3af64c55b"}},{"ruleId":"D2","level":"warning","message":{"text":"MemArbitrator.shrinkAwaitFreePool (cognitive 29): MemArbitrator.shrinkAwaitFreePool has cognitive complexity 29 (threshold 15). Drivers by points: if/else 25, boolean chains 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":"pkg/util/memory/arbitrator.go"},"region":{"startLine":2669}}}],"partialFingerprints":{"codehealthFindingId/v1":"3804e81f7e002aef420c361629e0141c3369ba03f40b85673423177c60a37ceb"}},{"ruleId":"D2","level":"warning","message":{"text":"plancodec.decodeBinaryOperator (cognitive 29): plancodec.decodeBinaryOperator has cognitive complexity 29 (threshold 15). Drivers by points: if/else 25, boolean chains 3, 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":"pkg/util/plancodec/binary_plan_decode.go"},"region":{"startLine":203}}}],"partialFingerprints":{"codehealthFindingId/v1":"989779d7ed7fb7cdad102a1a7f8878fabd6ca5ee50543c294cebcae12192f48b"}},{"ruleId":"D2","level":"warning","message":{"text":"PartitionOptions.Validate (cognitive 29): PartitionOptions.Validate has cognitive complexity 29 (threshold 15). Drivers by points: if/else 22, boolean chains 3, loops 3, match/switch 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":"pkg/parser/ast/ddl.go"},"region":{"startLine":4877}}}],"partialFingerprints":{"codehealthFindingId/v1":"fe9aeb762f45e456dcd2e29b3e27d5d826edaf3419ce5487519068f0a88a2f59"}},{"ruleId":"D2","level":"warning","message":{"text":"metautil.downloadStats (cognitive 28): metautil.downloadStats has cognitive complexity 28 (threshold 15). Drivers by points: if/else 22, loops 3, match/switch 3 (nesting depth added 16). Most of this is not in the body itself: 3 of the 28 points are its own statements and the rest belongs to one function literal inside it that branches (line 195). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal\u0027s work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"br/pkg/metautil/statsfile.go"},"region":{"startLine":179}}}],"partialFingerprints":{"codehealthFindingId/v1":"22343d99ef0b74b3eb335ed98df6e8dca89a7b066aa84c937e4f28755bd83814"}},{"ruleId":"D2","level":"warning","message":{"text":"DB.CreateTables (cognitive 28): DB.CreateTables has cognitive complexity 28 (threshold 15). Drivers by points: if/else 24, 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":"br/pkg/restore/internal/prealloc_db/db.go"},"region":{"startLine":268}}}],"partialFingerprints":{"codehealthFindingId/v1":"53aaaea7749fdb61e28e808882a17d73be87313cb0f7cfe467119fbe18e33811"}},{"ruleId":"D2","level":"warning","message":{"text":"logclient.LoadAndProcessMetaKVFilesInBatch (cognitive 28): logclient.LoadAndProcessMetaKVFilesInBatch has cognitive complexity 28 (threshold 15). Drivers by points: if/else 22, loops 5, boolean chains 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":"br/pkg/restore/log_client/client.go"},"region":{"startLine":1287}}}],"partialFingerprints":{"codehealthFindingId/v1":"aa6e8a3402e77318de4327a5fcee2fe2f22b126602a7c0dd47483f703fdcd907"}},{"ruleId":"D2","level":"warning","message":{"text":"LogClient.generateRepairIngestIndexSQLs (cognitive 28): LogClient.generateRepairIngestIndexSQLs has cognitive complexity 28 (threshold 15). Drivers by points: if/else 27, boolean chains 1 (nesting depth added 5). Of this number, 15 points are the body\u0027s own statements and 13 belong to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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":"br/pkg/restore/log_client/client.go"},"region":{"startLine":1948}}}],"partialFingerprints":{"codehealthFindingId/v1":"9510bd128dfd87fa02ad431f854c6a98667834bb594880049629cf8db55ede73"}},{"ruleId":"D2","level":"warning","message":{"text":"SnapClient.InitCheckpoint (cognitive 28): SnapClient.InitCheckpoint has cognitive complexity 28 (threshold 15). Drivers by points: if/else 28 (nesting depth added 12). 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 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":"br/pkg/restore/snap_client/client.go"},"region":{"startLine":490}}}],"partialFingerprints":{"codehealthFindingId/v1":"7e3b6a8bd88f494cd4ce81c6de7c30a6b9123a0fa4ee86f79abe0e636fa1d557"}},{"ruleId":"D2","level":"warning","message":{"text":"SnapFileImporter.downloadSST (cognitive 28): SnapFileImporter.downloadSST has cognitive complexity 28 (threshold 15). Drivers by points: if/else 20, loops 6, match/switch 2 (nesting depth added 15). Most of this is not in the body itself: 12 of the 28 points are its own statements and the rest belongs to one function literal inside it that branches (line 1069). 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":"br/pkg/restore/snap_client/import.go"},"region":{"startLine":1032}}}],"partialFingerprints":{"codehealthFindingId/v1":"051a197f0a9891291aebf172863ee07ed5fdb29c14fa675a5a23df4c98c629f2"}},{"ruleId":"D2","level":"warning","message":{"text":"checksumTableCtx.loadPitrIdMap (cognitive 28): checksumTableCtx.loadPitrIdMap has cognitive complexity 28 (threshold 15). Drivers by points: if/else 26, loops 2 (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":"br/pkg/task/operator/checksum_table.go"},"region":{"startLine":196}}}],"partialFingerprints":{"codehealthFindingId/v1":"e548b1a6318b0f7d46458402dace3f53249febe2069dc94a1e224ad3c48c165d"}},{"ruleId":"D2","level":"warning","message":{"text":"export.getNumericIndex (cognitive 28): export.getNumericIndex has cognitive complexity 28 (threshold 15). Drivers by points: if/else 20, loops 3, match/switch 3, boolean chains 2 (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":"dumpling/export/sql.go"},"region":{"startLine":658}}}],"partialFingerprints":{"codehealthFindingId/v1":"7971f1661424031b06621f3468e72b9177f87baa8b8ae1e28bc239222d957bc7"}},{"ruleId":"D2","level":"warning","message":{"text":"mock.NewImportSource (cognitive 28): mock.NewImportSource has cognitive complexity 28 (threshold 15). Drivers by points: if/else 18, loops 6, match/switch 4 (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":"lightning/pkg/importer/mock/mock.go"},"region":{"startLine":65}}}],"partialFingerprints":{"codehealthFindingId/v1":"21595cdd3977f1a0ee3271567d81416a5b578e079af144b60824c081a76fbb5b"}},{"ruleId":"D2","level":"warning","message":{"text":"TableImporter.preDeduplicate (cognitive 28): TableImporter.preDeduplicate has cognitive complexity 28 (threshold 15). Drivers by points: if/else 20, loops 5, 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":"lightning/pkg/importer/table_import.go"},"region":{"startLine":1719}}}],"partialFingerprints":{"codehealthFindingId/v1":"04e267b358409374b25d1c7ccd3d370f1ea23c4df90bc7348ad88ff568fdb517"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.BuildHiddenColumnInfo (cognitive 28): ddl.BuildHiddenColumnInfo has cognitive complexity 28 (threshold 15). Drivers by points: if/else 24, loops 3, 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":"pkg/ddl/create_table.go"},"region":{"startLine":1591}}}],"partialFingerprints":{"codehealthFindingId/v1":"ed2b6b5a5a1fdd3c75500ac61e5cc5c87e4703c0ff95e49d4e089bef1bd909e0"}},{"ruleId":"D2","level":"warning","message":{"text":"delRange.doTask (cognitive 28): delRange.doTask has cognitive complexity 28 (threshold 15). Drivers by points: if/else 22, loops 5, boolean chains 1 (nesting depth added 15). Most of this is not in the body itself: 10 of the 28 points are its own statements and the rest belongs to one function literal inside it that branches (line 217). 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":"pkg/ddl/delete_range.go"},"region":{"startLine":210}}}],"partialFingerprints":{"codehealthFindingId/v1":"25283e97fc7a73fc14727dda3c16714cd8886b082e0bf3a1291bb0e65a930625"}},{"ruleId":"D2","level":"warning","message":{"text":"BaseScheduler.scheduleTask (cognitive 28): BaseScheduler.scheduleTask has cognitive complexity 28 (threshold 15). Drivers by points: if/else 22, match/switch 4, 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":"pkg/dxf/framework/scheduler/scheduler.go"},"region":{"startLine":180}}}],"partialFingerprints":{"codehealthFindingId/v1":"30af2031037ca5c058a2a8ef5ca3fd7ef5307a98332e61bfca0807966931190f"}},{"ruleId":"D2","level":"warning","message":{"text":"executor.fillRowChecksum (cognitive 28): executor.fillRowChecksum has cognitive complexity 28 (threshold 15). Drivers by points: if/else 20, loops 8 (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":"pkg/executor/point_get.go"},"region":{"startLine":464}}}],"partialFingerprints":{"codehealthFindingId/v1":"62e424a5cb2deec134f78083a950b901cfd76e57029e9282421629446f18ba91"}},{"ruleId":"D2","level":"warning","message":{"text":"HashAggPartialWorker.spillDataToDiskImpl (cognitive 28): HashAggPartialWorker.spillDataToDiskImpl has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14, loops 14 (nesting depth added 16). Of this number, 25 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":"pkg/executor/aggregate/agg_hash_partial_worker.go"},"region":{"startLine":320}}}],"partialFingerprints":{"codehealthFindingId/v1":"fe6ac45bb81f2f83998808a2942bdaed3d9616ee3e3588cdef4d8dbc5307c5e4"}},{"ruleId":"D2","level":"warning","message":{"text":"memtableRetriever.setDataForStatisticsInTable (cognitive 28): memtableRetriever.setDataForStatisticsInTable has cognitive complexity 28 (threshold 15). Drivers by points: if/else 20, loops 6, boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/infoschema_reader.go"},"region":{"startLine":493}}}],"partialFingerprints":{"codehealthFindingId/v1":"24e79e0ce64c26aea0a6b68bcf061ed9e47e5aa33f6ca20fb63a190d17a61abc"}},{"ruleId":"D2","level":"warning","message":{"text":"memtableRetriever.setDataFromTables (cognitive 28): memtableRetriever.setDataFromTables has cognitive complexity 28 (threshold 15). Drivers by points: if/else 25, boolean chains 2, loops 1 (nesting depth added 12). Of this number, 18 points are the body\u0027s own statements and 10 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/executor/infoschema_reader.go"},"region":{"startLine":831}}}],"partialFingerprints":{"codehealthFindingId/v1":"a7f5c303051757733cf8b03fae1b3dacd58e87a86d66cf0f358d2e34073b2722"}},{"ruleId":"D2","level":"warning","message":{"text":"memtableRetriever.keyColumnUsageInTable (cognitive 28): memtableRetriever.keyColumnUsageInTable has cognitive complexity 28 (threshold 15). Drivers by points: if/else 18, loops 9, boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/infoschema_reader.go"},"region":{"startLine":1993}}}],"partialFingerprints":{"codehealthFindingId/v1":"de27245fab98e15da238bfb0da0354ae34ee38bf863ffade43e1273511783c07"}},{"ruleId":"D2","level":"warning","message":{"text":"MergeJoinTable.fetchNextInnerGroup (cognitive 28): MergeJoinTable.fetchNextInnerGroup has cognitive complexity 28 (threshold 15). Drivers by points: if/else 21, boolean chains 4, loops 2, jumps 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/join/merge_join.go"},"region":{"startLine":178}}}],"partialFingerprints":{"codehealthFindingId/v1":"dd046432c6f797fad93a27853a7c5c4ac4be936ec1e917d17db6c4a904bdf0e8"}},{"ruleId":"D2","level":"warning","message":{"text":"tikvRegionPeersRetriever.retrieve (cognitive 28): tikvRegionPeersRetriever.retrieve has cognitive complexity 28 (threshold 15). Drivers by points: if/else 22, loops 4, boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/memtable_reader.go"},"region":{"startLine":911}}}],"partialFingerprints":{"codehealthFindingId/v1":"0f0c0b578a878188a81b5c2fe3a0f24438667b9fa5aa159eda4a02669041faf3"}},{"ruleId":"D2","level":"warning","message":{"text":"UpdateExec.exec (cognitive 28): UpdateExec.exec has cognitive complexity 28 (threshold 15). Drivers by points: if/else 25, loops 2, 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":"pkg/executor/update.go"},"region":{"startLine":255}}}],"partialFingerprints":{"codehealthFindingId/v1":"a780a4048c8b3ad961adda262ffd4eccf03b108ca5a6e6e64aa53e01b488becc"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinArithmeticPlusIntSig.evalInt (cognitive 28): builtinArithmeticPlusIntSig.evalInt has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14, boolean chains 13, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/builtin_arithmetic.go"},"region":{"startLine":229}}}],"partialFingerprints":{"codehealthFindingId/v1":"42569e6a3ef221fd2d3acccdbde7d5853d2320e7748b136c843d589a9869e40c"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinConvSig.evalString (cognitive 28): builtinConvSig.evalString has cognitive complexity 28 (threshold 15). Drivers by points: if/else 22, boolean chains 5, match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/builtin_math.go"},"region":{"startLine":1269}}}],"partialFingerprints":{"codehealthFindingId/v1":"650d2a9c12994957f1f1fbed4ce2f3638e144cb9f2760d9967ee25bf3508f3db"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinConcatWSSig.vecEvalString (cognitive 28): builtinConcatWSSig.vecEvalString has cognitive complexity 28 (threshold 15). Drivers by points: if/else 21, 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":"pkg/expression/builtin_string_vec.go"},"region":{"startLine":626}}}],"partialFingerprints":{"codehealthFindingId/v1":"89366341ad2a57af97670db1e1d47900c4b41deef7b67e6e61f9a363a3323451"}},{"ruleId":"D2","level":"warning","message":{"text":"perfschema.dataForRemoteProfile (cognitive 28): perfschema.dataForRemoteProfile has cognitive complexity 28 (threshold 15). Drivers by points: if/else 20, loops 7, match/switch 1 (nesting depth added 11). Most of this is not in the body itself: 11 of the 28 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 349, 389). 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":"pkg/infoschema/perfschema/tables.go"},"region":{"startLine":336}}}],"partialFingerprints":{"codehealthFindingId/v1":"138b02730fa2b0cc34653b8e03ff234fd004a0c8ed20b6e449da98f503770015"}},{"ruleId":"D2","level":"warning","message":{"text":"kv.RunInNewTxn (cognitive 28): kv.RunInNewTxn has cognitive complexity 28 (threshold 15). Drivers by points: if/else 22, match/switch 3, boolean chains 2, loops 1 (nesting depth added 15). Of this number, 19 points are the body\u0027s own statements and 9 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/kv/txn.go"},"region":{"startLine":107}}}],"partialFingerprints":{"codehealthFindingId/v1":"01a5fc9e28fca2e9da86cbae821115a6bff612b4dacb3092e6e3e58868d682e1"}},{"ruleId":"D2","level":"warning","message":{"text":"tidbEncoder.Encode (cognitive 28): tidbEncoder.Encode has cognitive complexity 28 (threshold 15). Drivers by points: if/else 23, loops 5 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/lightning/backend/tidb/tidb.go"},"region":{"startLine":580}}}],"partialFingerprints":{"codehealthFindingId/v1":"d24440003d005001ce3cfe1b26a19a445ba1eddec757e212c2c1a8e2fcc49500"}},{"ruleId":"D2","level":"warning","message":{"text":"regexRouterParser.Parse (cognitive 28): regexRouterParser.Parse has cognitive complexity 28 (threshold 15). Drivers by points: if/else 25, boolean chains 3 (nesting depth added 6). Of this number, 18 points are the body\u0027s own statements and 10 belong to 3 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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":"pkg/lightning/mydump/router.go"},"region":{"startLine":275}}}],"partialFingerprints":{"codehealthFindingId/v1":"850447bb48c8a658da0e68c6f995117674f3cdb7494e00520259404bc7a881eb"}},{"ruleId":"D2","level":"warning","message":{"text":"SchemaImporter.importTables (cognitive 28): SchemaImporter.importTables has cognitive complexity 28 (threshold 15). Drivers by points: if/else 19, loops 6, match/switch 3 (nesting depth added 17). Most of this is not in the body itself: 1 of the 28 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 163, 197). 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":"pkg/lightning/mydump/schema_import.go"},"region":{"startLine":159}}}],"partialFingerprints":{"codehealthFindingId/v1":"30278131938d8886eddc936d10954dc71bf34b35c50398b0d27a71df313ca3f6"}},{"ruleId":"D2","level":"warning","message":{"text":"allocator.alloc4Signed (cognitive 28): allocator.alloc4Signed has cognitive complexity 28 (threshold 15). Drivers by points: if/else 27, boolean chains 1 (nesting depth added 12). Of this number, 17 points are the body\u0027s own statements and 11 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":"pkg/meta/autoid/autoid.go"},"region":{"startLine":889}}}],"partialFingerprints":{"codehealthFindingId/v1":"a744d50d967f6c272af9b75e3570bc5e46818c74535b835fe6abf5b7c2b89a74"}},{"ruleId":"D2","level":"warning","message":{"text":"allocator.alloc4Unsigned (cognitive 28): allocator.alloc4Unsigned has cognitive complexity 28 (threshold 15). Drivers by points: if/else 28 (nesting depth added 13). Of this number, 17 points are the body\u0027s own statements and 11 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":"pkg/meta/autoid/autoid.go"},"region":{"startLine":977}}}],"partialFingerprints":{"codehealthFindingId/v1":"88dcadae146928ef6519751b67b4bc2f6ab1587c4c3878696556f49b278e9f67"}},{"ruleId":"D2","level":"warning","message":{"text":"core.binaryOpFromFlatOp (cognitive 28): core.binaryOpFromFlatOp has cognitive complexity 28 (threshold 15). Drivers by points: if/else 21, match/switch 5, loops 2 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/common_plans.go"},"region":{"startLine":1254}}}],"partialFingerprints":{"codehealthFindingId/v1":"c1ead9a573345eb2fdfc20bf46c07e8eca94015b98bfefd879ae9bcb9049bd6d"}},{"ruleId":"D2","level":"warning","message":{"text":"core.genHintTblForJoinNodes (cognitive 28): core.genHintTblForJoinNodes has cognitive complexity 28 (threshold 15). Drivers by points: if/else 17, boolean chains 9, loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/hint_utils.go"},"region":{"startLine":379}}}],"partialFingerprints":{"codehealthFindingId/v1":"384c3a08594f262aa02823de1fce278b0f66bbc86909da3ecc68a427b5fda4b9"}},{"ruleId":"D2","level":"warning","message":{"text":"core.pruneAndBuildColPositionInfoForDelete (cognitive 28): core.pruneAndBuildColPositionInfoForDelete has cognitive complexity 28 (threshold 15). Drivers by points: if/else 18, loops 9, 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":"pkg/planner/core/logical_plan_builder.go"},"region":{"startLine":5868}}}],"partialFingerprints":{"codehealthFindingId/v1":"2d34f44d55f4e8b65fdcb544f8ebf14241a3a48014add16ec6e3247ba0adee27"}},{"ruleId":"D2","level":"warning","message":{"text":"tidbCodecFuncHelper.decodeIndexKey (cognitive 28): tidbCodecFuncHelper.decodeIndexKey has cognitive complexity 28 (threshold 15). Drivers by points: if/else 22, loops 6 (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":"pkg/planner/core/expression_codec_fn.go"},"region":{"startLine":380}}}],"partialFingerprints":{"codehealthFindingId/v1":"c10af1ffbddf97b3f594a982336d8cc9af0e5c1669dab1002dfb54b062940cf1"}},{"ruleId":"D2","level":"warning","message":{"text":"expressionRewriter.rewriteFuncCall (cognitive 28): expressionRewriter.rewriteFuncCall has cognitive complexity 28 (threshold 15). Drivers by points: if/else 23, boolean chains 4, match/switch 1 (nesting depth added 13). The drivers above price the dispatch low by construction \u2014 a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full \u2014 so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/expression_rewriter.go"},"region":{"startLine":2845}}}],"partialFingerprints":{"codehealthFindingId/v1":"6d380e5a9e90057cb9fcb8c0cf3a5109d37d88647d0c2e6e3f8f6418de357edd"}},{"ruleId":"D2","level":"warning","message":{"text":"LogicalJoin.pushDownTopNToChild (cognitive 28): LogicalJoin.pushDownTopNToChild has cognitive complexity 28 (threshold 15). Drivers by points: if/else 16, loops 8, boolean chains 4 (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/planner/core/operator/logicalop/logical_join.go"},"region":{"startLine":1218}}}],"partialFingerprints":{"codehealthFindingId/v1":"6a6c710a7d7ec82b0915b9dec488dbfc5d130f9a12ed34318dc0905fb1d9320a"}},{"ruleId":"D2","level":"warning","message":{"text":"LogicalProjection.PushDownTopN (cognitive 28): LogicalProjection.PushDownTopN has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15, loops 9, match/switch 3, boolean chains 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":"pkg/planner/core/operator/logicalop/logical_projection.go"},"region":{"startLine":183}}}],"partialFingerprints":{"codehealthFindingId/v1":"effce16bb65e2ae689b8d78258a3c0dfd9437f4f5561cc04206606faf45ca01c"}},{"ruleId":"D2","level":"warning","message":{"text":"physicalop.CheckAggCanPushCop (cognitive 28): physicalop.CheckAggCanPushCop has cognitive complexity 28 (threshold 15). Drivers by points: if/else 21, loops 4, boolean chains 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":"pkg/planner/core/operator/physicalop/base_physical_agg.go"},"region":{"startLine":536}}}],"partialFingerprints":{"codehealthFindingId/v1":"5f89dac7570a3eb09ab90a5ef00f2c494b46d9555da350016e13130b4da0f387"}},{"ruleId":"D2","level":"warning","message":{"text":"mppTaskGenerator.generateMPPTasksForFragment (cognitive 28): mppTaskGenerator.generateMPPTasksForFragment has cognitive complexity 28 (threshold 15). Drivers by points: if/else 17, loops 9, boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/operator/physicalop/fragment.go"},"region":{"startLine":546}}}],"partialFingerprints":{"codehealthFindingId/v1":"5176e9e4ba5f908fdb7168bfe3e7a30f9739203b6c323a9b7ba1560ec4f12951"}},{"ruleId":"D2","level":"warning","message":{"text":"PlanBuilder.buildProjectionField (cognitive 28): PlanBuilder.buildProjectionField has cognitive complexity 28 (threshold 15). Drivers by points: if/else 26, boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/logical_plan_builder.go"},"region":{"startLine":1541}}}],"partialFingerprints":{"codehealthFindingId/v1":"c68039ea8f49254450dac8ab5a7e1b4e046312c4c5f5ceb68ca0777049af11db"}},{"ruleId":"D2","level":"warning","message":{"text":"PlanBuilder.buildWindowFunctionFrameBound (cognitive 28): PlanBuilder.buildWindowFunctionFrameBound has cognitive complexity 28 (threshold 15). Drivers by points: if/else 19, boolean chains 7, 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":"pkg/planner/core/logical_plan_builder.go"},"region":{"startLine":6872}}}],"partialFingerprints":{"codehealthFindingId/v1":"7d403703213cc71667848b6b1dec4a90317ffea49f2a6bfae1f3ea595e4fab8a"}},{"ruleId":"D2","level":"warning","message":{"text":"rule.pruneEmptyORBranches (cognitive 28): rule.pruneEmptyORBranches has cognitive complexity 28 (threshold 15). Drivers by points: if/else 21, boolean chains 4, 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":"pkg/planner/core/rule/rule_predicate_simplification.go"},"region":{"startLine":433}}}],"partialFingerprints":{"codehealthFindingId/v1":"d35218e7cc658df94423124e4270bde6a822b82c3c8221ba48871cbc02eb5af7"}},{"ruleId":"D2","level":"warning","message":{"text":"GcSubstituter.substitute (cognitive 28): GcSubstituter.substitute has cognitive complexity 28 (threshold 15). Drivers by points: loops 27, match/switch 1 (nesting depth added 16). 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":"pkg/planner/core/rule_generate_column_substitute.go"},"region":{"startLine":176}}}],"partialFingerprints":{"codehealthFindingId/v1":"39428ea0ea758bc6888bef6e917e3e411bc2e13613cc349a314a5953d374e11e"}},{"ruleId":"D2","level":"warning","message":{"text":"MySQLPrivilege.merge (cognitive 28): MySQLPrivilege.merge has cognitive complexity 28 (threshold 15). Drivers by points: if/else 21, loops 7 (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":"pkg/privilege/privileges/cache.go"},"region":{"startLine":587}}}],"partialFingerprints":{"codehealthFindingId/v1":"c25d6919d51e8b59f3e9ba87522efee0133c7c613e395e6f2d9cf518f14599e9"}},{"ruleId":"D2","level":"warning","message":{"text":"StatsCacheImpl.Update (cognitive 28): StatsCacheImpl.Update has cognitive complexity 28 (threshold 15). Drivers by points: if/else 22, boolean chains 3, loops 3 (nesting depth added 12). Of this number, 25 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":"pkg/statistics/handle/cache/statscache.go"},"region":{"startLine":122}}}],"partialFingerprints":{"codehealthFindingId/v1":"48764e15ab91a0529abe9fac6013e7cac9a4941a38db525d8779687e72d3f16b"}},{"ruleId":"D2","level":"warning","message":{"text":"indexScanExec.Process (cognitive 28): indexScanExec.Process has cognitive complexity 28 (threshold 15). Drivers by points: if/else 21, boolean chains 4, loops 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":"pkg/store/mockstore/unistore/cophandler/mpp_exec.go"},"region":{"startLine":321}}}],"partialFingerprints":{"codehealthFindingId/v1":"7814a5a730306ebbc2b075f7504f0cda852bda711e6febed0207298be827f7cb"}},{"ruleId":"D2","level":"warning","message":{"text":"index.getIndexedValue (cognitive 28): index.getIndexedValue has cognitive complexity 28 (threshold 15). Drivers by points: if/else 19, loops 7, boolean chains 1, jumps 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":"pkg/table/tables/index.go"},"region":{"startLine":214}}}],"partialFingerprints":{"codehealthFindingId/v1":"7ace2fb6b16b6bf9476aa4a501d160fbbc7df65a789cf64423fd6fc3ccaed69b"}},{"ruleId":"D2","level":"warning","message":{"text":"cache.RowToTTLTask (cognitive 28): cache.RowToTTLTask has cognitive complexity 28 (threshold 15). Drivers by points: if/else 28 (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/ttl/cache/task.go"},"region":{"startLine":124}}}],"partialFingerprints":{"codehealthFindingId/v1":"b40b200c53c19ae384fc6f65e8cbfc5134a83846b001e9fa464e8f095d35918f"}},{"ruleId":"D2","level":"warning","message":{"text":"PhysicalTable.splitCommonHandleRanges (cognitive 28): PhysicalTable.splitCommonHandleRanges has cognitive complexity 28 (threshold 15). Drivers by points: if/else 26, boolean chains 1, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ttl/cache/table.go"},"region":{"startLine":394}}}],"partialFingerprints":{"codehealthFindingId/v1":"2fc998af3a8526184dce8c993b13786209d163e7cf7ba0ef8f5593369d18aea5"}},{"ruleId":"D2","level":"warning","message":{"text":"ttlworker.GetDelayMetricRecords (cognitive 28): ttlworker.GetDelayMetricRecords has cognitive complexity 28 (threshold 15). Drivers by points: if/else 21, loops 7 (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":"pkg/ttl/ttlworker/job_manager.go"},"region":{"startLine":1123}}}],"partialFingerprints":{"codehealthFindingId/v1":"17387f97ff239ca4d61cf33dc79dac930ee73024289fdf3fba47ea0ad57dd39e"}},{"ruleId":"D2","level":"warning","message":{"text":"types.doAdd (cognitive 28): types.doAdd has cognitive complexity 28 (threshold 15). Drivers by points: if/else 25, 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":"pkg/types/mydecimal.go"},"region":{"startLine":1898}}}],"partialFingerprints":{"codehealthFindingId/v1":"623a3f849c3151bdfb31712585b00aa6596e351678f6296723951c7341226fec"}},{"ruleId":"D2","level":"warning","message":{"text":"mergingIter.Seek (cognitive 28): mergingIter.Seek has cognitive complexity 28 (threshold 15). Drivers by points: if/else 23, loops 3, boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/util/extsort/disk_sorter.go"},"region":{"startLine":458}}}],"partialFingerprints":{"codehealthFindingId/v1":"2ad3252593022c0d64eed668e85aeaece924bfc998e907e492d84bced35b7643"}},{"ruleId":"D2","level":"warning","message":{"text":"ruCollecting.toTopRURecords (cognitive 28): ruCollecting.toTopRURecords has cognitive complexity 28 (threshold 15). Drivers by points: if/else 21, loops 4, boolean chains 3 (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":"pkg/util/topsql/reporter/ru_datamodel.go"},"region":{"startLine":473}}}],"partialFingerprints":{"codehealthFindingId/v1":"c07956a548df0c88b17a8d00db042246878b1c4479be215aad41ee48a30597dd"}},{"ruleId":"D2","level":"warning","message":{"text":"worker.startSnapshot (cognitive 28): worker.startSnapshot has cognitive complexity 28 (threshold 15). Drivers by points: if/else 22, loops 4, match/switch 2 (nesting depth added 17). Most of this is not in the body itself: 0 of the 28 points are its own statements and the rest belongs to one function literal inside it that branches (line 204). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal\u0027s work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/util/workloadrepo/snapshot.go"},"region":{"startLine":203}}}],"partialFingerprints":{"codehealthFindingId/v1":"09e0d4ac042721ab67e8b242ca30274727a850193785418d7e5839df4921149b"}},{"ruleId":"D2","level":"warning","message":{"text":"PartitionOptions.Restore (cognitive 28): PartitionOptions.Restore has cognitive complexity 28 (threshold 15). Drivers by points: if/else 22, loops 4, boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/parser/ast/ddl.go"},"region":{"startLine":4932}}}],"partialFingerprints":{"codehealthFindingId/v1":"1b6b285418446a8d25e660b91fc2372b6bae47df380ed863b1c8a3c252f44c7e"}},{"ruleId":"D2","level":"warning","message":{"text":"SplitOption.Restore (cognitive 28): SplitOption.Restore has cognitive complexity 28 (threshold 15). Drivers by points: if/else 21, loops 7 (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":"pkg/parser/ast/dml.go"},"region":{"startLine":4216}}}],"partialFingerprints":{"codehealthFindingId/v1":"8828b3a3a84cfb8cd18168804dcd9a22b566d01c0cdfef8a3cfc93a25c01e486"}},{"ruleId":"D2","level":"warning","message":{"text":"GrantStmt.Restore (cognitive 28): GrantStmt.Restore has cognitive complexity 28 (threshold 15). Drivers by points: if/else 23, loops 4, boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/parser/ast/misc.go"},"region":{"startLine":3297}}}],"partialFingerprints":{"codehealthFindingId/v1":"aed075cb14e69d917533637cec9309d022666bb147c3dcb5d8067abbeddf383d"}},{"ruleId":"D2","level":"warning","message":{"text":"main.newCheckSumCommand (cognitive 27): main.newCheckSumCommand has cognitive complexity 27 (threshold 15). Drivers by points: if/else 17, loops 10 (nesting depth added 16). Most of this is not in the body itself: 0 of the 27 points are its own statements and the rest belongs to one function literal inside it that branches (line 70). 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":"br/cmd/br/debug.go"},"region":{"startLine":65}}}],"partialFingerprints":{"codehealthFindingId/v1":"7bc6561052cfd29ffdc7aae01e9a74e4918a1973bfaedb7505a09ceb939ff183"}},{"ruleId":"D2","level":"warning","message":{"text":"CheckpointRunner.startCheckpointMainLoop (cognitive 27): CheckpointRunner.startCheckpointMainLoop has cognitive complexity 27 (threshold 15). Drivers by points: if/else 24, match/switch 2, loops 1 (nesting depth added 16). Most of this is not in the body itself: 0 of the 27 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 451, 438). 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":"br/pkg/checkpoint/checkpoint.go"},"region":{"startLine":431}}}],"partialFingerprints":{"codehealthFindingId/v1":"0ff8614ef334ef5a68822e61c50e077f3ae05da31a13b9f4561fb14fe52e5cdc"}},{"ruleId":"D2","level":"warning","message":{"text":"restore.GroupOverlappedBackupFileSetsIter (cognitive 27): restore.GroupOverlappedBackupFileSetsIter has cognitive complexity 27 (threshold 15). Drivers by points: if/else 23, boolean chains 2, loops 2 (nesting depth added 12). 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":"br/pkg/restore/misc.go"},"region":{"startLine":456}}}],"partialFingerprints":{"codehealthFindingId/v1":"91fbfd8acafe52d15cf7b368499b7c30583652fb376cf925e4d64def4265e8d1"}},{"ruleId":"D2","level":"warning","message":{"text":"Dumper.buildConcatTask (cognitive 27): Dumper.buildConcatTask has cognitive complexity 27 (threshold 15). Drivers by points: if/else 16, loops 9, match/switch 2 (nesting depth added 16). Of this number, 23 points are the body\u0027s own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body 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":"dumpling/export/dump.go"},"region":{"startLine":675}}}],"partialFingerprints":{"codehealthFindingId/v1":"b80391cd90f4a062d0352a600018848a6c7ceed61e2fd97480129ffc560f4420"}},{"ruleId":"D2","level":"warning","message":{"text":"emptyRegionCheckItem.Check (cognitive 27): emptyRegionCheckItem.Check has cognitive complexity 27 (threshold 15). Drivers by points: if/else 21, loops 6 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lightning/pkg/importer/precheck_impl.go"},"region":{"startLine":255}}}],"partialFingerprints":{"codehealthFindingId/v1":"afd3e267fe45920843c58bd928c9f1cd6082a40657e29e498c0bf77fea6567f2"}},{"ruleId":"D2","level":"warning","message":{"text":"DefaultJobMonitor.WaitForJobs (cognitive 27): DefaultJobMonitor.WaitForJobs has cognitive complexity 27 (threshold 15). Drivers by points: if/else 23, loops 2, match/switch 2 (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":"lightning/pkg/importinto/job_monitor.go"},"region":{"startLine":73}}}],"partialFingerprints":{"codehealthFindingId/v1":"3ed0393bd7f69a3a9245668e83e870047b23c3489d360c92f7e959fb7f072ba2"}},{"ruleId":"D2","level":"warning","message":{"text":"DefaultJobMonitor.processJobStatuses (cognitive 27): DefaultJobMonitor.processJobStatuses has cognitive complexity 27 (threshold 15). Drivers by points: if/else 22, loops 2, match/switch 2, 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":"lightning/pkg/importinto/job_monitor.go"},"region":{"startLine":158}}}],"partialFingerprints":{"codehealthFindingId/v1":"23f93d19eb7df6d5c0561a137fa435241ea41208552d68c0b16df19dc39710a3"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.generateGlobalSortIngestPlan (cognitive 27): ddl.generateGlobalSortIngestPlan has cognitive complexity 27 (threshold 15). Drivers by points: if/else 21, loops 6 (nesting depth added 11). Of this number, 20 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/ddl/backfilling_dist_scheduler.go"},"region":{"startLine":457}}}],"partialFingerprints":{"codehealthFindingId/v1":"9241fd513c98142630e5d3d5788d877ab38cf5312c5092a674ea5ef74544aa9b"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.getFlashbackKeyRanges (cognitive 27): ddl.getFlashbackKeyRanges has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15, loops 11, boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/cluster.go"},"region":{"startLine":367}}}],"partialFingerprints":{"codehealthFindingId/v1":"0b3010c668baebcadbc0c579ebee51eaee44489a696ce4f927609fa70c42214c"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.modifyTaskParamLoop (cognitive 27): ddl.modifyTaskParamLoop has cognitive complexity 27 (threshold 15). Drivers by points: if/else 24, match/switch 2, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/index.go"},"region":{"startLine":3362}}}],"partialFingerprints":{"codehealthFindingId/v1":"0dbf54d96b322b1ac0d168aa13b138471aba933b7a82b7dc5e25c2dbb5f52264"}},{"ruleId":"D2","level":"warning","message":{"text":"executor.CreateSchema (cognitive 27): executor.CreateSchema has cognitive complexity 27 (threshold 15). Drivers by points: if/else 21, boolean chains 3, match/switch 2, 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/ddl/executor.go"},"region":{"startLine":218}}}],"partialFingerprints":{"codehealthFindingId/v1":"ad614b828304fcfb31a639970fb2ecd2215c7900124d5cef8f6116ddcdc1670b"}},{"ruleId":"D2","level":"warning","message":{"text":"jobScheduler.loadAndDeliverJobs (cognitive 27): jobScheduler.loadAndDeliverJobs has cognitive complexity 27 (threshold 15). Drivers by points: if/else 24, boolean chains 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":"pkg/ddl/job_scheduler.go"},"region":{"startLine":379}}}],"partialFingerprints":{"codehealthFindingId/v1":"11887e0c14b5bff49b11729312505d54921213b680e86516644e09eb8d8269f6"}},{"ruleId":"D2","level":"warning","message":{"text":"worker.onAddCheckConstraint (cognitive 27): worker.onAddCheckConstraint has cognitive complexity 27 (threshold 15). Drivers by points: if/else 20, loops 6, match/switch 1 (nesting depth added 12). 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":"pkg/ddl/constraint.go"},"region":{"startLine":35}}}],"partialFingerprints":{"codehealthFindingId/v1":"8e46eb354bbe574316208da90208396c41fc42742815eadb5e027f551cbe6c85"}},{"ruleId":"D2","level":"warning","message":{"text":"worker.onDropTablePartition (cognitive 27): worker.onDropTablePartition has cognitive complexity 27 (threshold 15). Drivers by points: if/else 25, boolean chains 1, match/switch 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":"pkg/ddl/partition.go"},"region":{"startLine":2304}}}],"partialFingerprints":{"codehealthFindingId/v1":"2580a144ffd6684bef85359496cc222a3aaec9f8714a889a3c9f80607c6331bf"}},{"ruleId":"D2","level":"warning","message":{"text":"Domain.Init (cognitive 27): Domain.Init has cognitive complexity 27 (threshold 15). Drivers by points: if/else 27 (nesting depth added 8). Of this number, 25 points are the body\u0027s own statements and 2 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":"pkg/domain/domain.go"},"region":{"startLine":652}}}],"partialFingerprints":{"codehealthFindingId/v1":"e074169f13f1cbf45f6f6dbb269a209777675008fa50c706c1979415bead04bb"}},{"ruleId":"D2","level":"warning","message":{"text":"executor.getOldRow (cognitive 27): executor.getOldRow has cognitive complexity 27 (threshold 15). Drivers by points: if/else 24, boolean chains 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":"pkg/executor/batch_checker.go"},"region":{"startLine":295}}}],"partialFingerprints":{"codehealthFindingId/v1":"39c7b427e2a33fe9d043787def24b32070201e7f1e4e4db49be5f8bc6240f2de"}},{"ruleId":"D2","level":"warning","message":{"text":"executor.insertRowsFromSelect (cognitive 27): executor.insertRowsFromSelect has cognitive complexity 27 (threshold 15). Drivers by points: if/else 22, loops 3, boolean chains 2 (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":"pkg/executor/insert_common.go"},"region":{"startLine":491}}}],"partialFingerprints":{"codehealthFindingId/v1":"edf8c88a3764cc91cc0340e5ef9aa316fd2e09c3daf30958a0169a1b4120b9b7"}},{"ruleId":"D2","level":"warning","message":{"text":"AnalyzeColumnsExec.handleNDVForSpecialIndexes (cognitive 27): AnalyzeColumnsExec.handleNDVForSpecialIndexes has cognitive complexity 27 (threshold 15). Drivers by points: if/else 18, loops 6, boolean chains 3 (nesting depth added 8). 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":"pkg/executor/analyze_col_sampling.go"},"region":{"startLine":420}}}],"partialFingerprints":{"codehealthFindingId/v1":"2f016fa2e74eb7b3b8d766571f7dc12c96b0191c4a19baf1c8091b136c79d3d9"}},{"ruleId":"D2","level":"warning","message":{"text":"indexMergeProcessWorker.fetchLoopIntersection (cognitive 27): indexMergeProcessWorker.fetchLoopIntersection has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15, match/switch 6, loops 5, boolean chains 1 (nesting depth added 9). Of this number, 21 points are the body\u0027s own statements and 6 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":"pkg/executor/index_merge_reader.go"},"region":{"startLine":1577}}}],"partialFingerprints":{"codehealthFindingId/v1":"0f98fd8c0429b0c13cef884c0a3333da5afd4c67e042c6306720617c0fe5a914"}},{"ruleId":"D2","level":"warning","message":{"text":"indexMergeTableScanWorker.executeTask (cognitive 27): indexMergeTableScanWorker.executeTask has cognitive complexity 27 (threshold 15). Drivers by points: if/else 17, loops 7, boolean chains 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":"pkg/executor/index_merge_reader.go"},"region":{"startLine":1988}}}],"partialFingerprints":{"codehealthFindingId/v1":"8a49d819c5733ad5f82bab18390e2d10937445ff613d19d7838ce295e7293a7b"}},{"ruleId":"D2","level":"warning","message":{"text":"InsertExec.exec (cognitive 27): InsertExec.exec has cognitive complexity 27 (threshold 15). Drivers by points: if/else 25, loops 2 (nesting depth added 12). 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":"pkg/executor/insert.go"},"region":{"startLine":58}}}],"partialFingerprints":{"codehealthFindingId/v1":"053a7d8329d7415b3b1a57e1d79db8960fccd3c88bf04f91a25a50d466d48cc1"}},{"ruleId":"D2","level":"warning","message":{"text":"thresholdCheckInspection.inspectThreshold2 (cognitive 27): thresholdCheckInspection.inspectThreshold2 has cognitive complexity 27 (threshold 15). Drivers by points: if/else 24, loops 3 (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":"pkg/executor/inspection_result.go"},"region":{"startLine":871}}}],"partialFingerprints":{"codehealthFindingId/v1":"350a893bd4360376af05c4fa8468d2370f3a73a8392ebd7acee9ada6227b845a"}},{"ruleId":"D2","level":"warning","message":{"text":"join.newTableMeta (cognitive 27): join.newTableMeta has cognitive complexity 27 (threshold 15). Drivers by points: if/else 18, loops 8, boolean chains 1 (nesting depth added 7). Of this number, 23 points are the body\u0027s own statements and 4 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":"pkg/executor/join/join_table_meta.go"},"region":{"startLine":184}}}],"partialFingerprints":{"codehealthFindingId/v1":"f7c4354241f593c8ec0d22bab71ee8fd0cb91562df955d217dbbe5eaa1ef990f"}},{"ruleId":"D2","level":"warning","message":{"text":"MetricsSummaryRetriever.retrieve (cognitive 27): MetricsSummaryRetriever.retrieve has cognitive complexity 27 (threshold 15). Drivers by points: if/else 18, loops 8, boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/metrics_reader.go"},"region":{"startLine":196}}}],"partialFingerprints":{"codehealthFindingId/v1":"dae55677a1a6ce85b52ab5ad790697d413a1c778a79bce5867d6fa694f13126d"}},{"ruleId":"D2","level":"warning","message":{"text":"PlanReplayerLoadInfo.createTable (cognitive 27): PlanReplayerLoadInfo.createTable has cognitive complexity 27 (threshold 15). Drivers by points: if/else 18, loops 8, boolean chains 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":"pkg/executor/plan_replayer.go"},"region":{"startLine":718}}}],"partialFingerprints":{"codehealthFindingId/v1":"615da8bfaeb5b4978418c3b50a8ef89fccb77bb584b0fa60eacebe881301237a"}},{"ruleId":"D2","level":"warning","message":{"text":"ShowExec.fetchShowStatsHistogram (cognitive 27): ShowExec.fetchShowStatsHistogram has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14, loops 12, boolean chains 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":"pkg/executor/show_stats.go"},"region":{"startLine":204}}}],"partialFingerprints":{"codehealthFindingId/v1":"48fca90fce41011fdf20e3e74c5c530dfd5eae0fcc254f82fbeb230da02f3970"}},{"ruleId":"D2","level":"warning","message":{"text":"slowQueryRetriever.getBatchLog (cognitive 27): slowQueryRetriever.getBatchLog has cognitive complexity 27 (threshold 15). Drivers by points: if/else 22, loops 3, boolean chains 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/slow_query.go"},"region":{"startLine":335}}}],"partialFingerprints":{"codehealthFindingId/v1":"ad03ce865a7ee99fcf2898b27a7737aa9cbb1c042d69b1f8f7398ada225fb47f"}},{"ruleId":"D2","level":"warning","message":{"text":"expression.newFunctionImpl (cognitive 27): expression.newFunctionImpl has cognitive complexity 27 (threshold 15). Drivers by points: if/else 24, match/switch 2, 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":"pkg/expression/scalar_function.go"},"region":{"startLine":207}}}],"partialFingerprints":{"codehealthFindingId/v1":"1dd937e9fb097ef25015e759245c57809755d74e0910caa23815ab9ac14decc5"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinCastStringAsJSONSig.vecEvalJSON (cognitive 27): builtinCastStringAsJSONSig.vecEvalJSON has cognitive complexity 27 (threshold 15). Drivers by points: if/else 20, loops 6, 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":"pkg/expression/builtin_cast_vec.go"},"region":{"startLine":834}}}],"partialFingerprints":{"codehealthFindingId/v1":"30e74507c22250adf08e42f136709cc7643361b22b53312168631be4f642dc7c"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinJSONMergeSig.vecEvalJSON (cognitive 27): builtinJSONMergeSig.vecEvalJSON has cognitive complexity 27 (threshold 15). Drivers by points: if/else 16, loops 10, boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/builtin_json_vec.go"},"region":{"startLine":1107}}}],"partialFingerprints":{"codehealthFindingId/v1":"4841ce8f9a66f8bfa527f8476441e15bde6e17cd84e5c37bbd2072d770adb68a"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinSubstringIndexSig.vecEvalString (cognitive 27): builtinSubstringIndexSig.vecEvalString has cognitive complexity 27 (threshold 15). Drivers by points: if/else 24, boolean chains 2, 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/expression/builtin_string_vec.go"},"region":{"startLine":774}}}],"partialFingerprints":{"codehealthFindingId/v1":"5f566a0c3be77c02cf568601305eea38289721c1fc1da525589fee8e71653ae9"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinTiDBBoundedStalenessSig.vecEvalTime (cognitive 27): builtinTiDBBoundedStalenessSig.vecEvalTime has cognitive complexity 27 (threshold 15). Drivers by points: if/else 25, 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":"pkg/expression/builtin_time_vec.go"},"region":{"startLine":833}}}],"partialFingerprints":{"codehealthFindingId/v1":"ea727ddedd56967e4ed2d7a0f62e14b113534a6460db7a4df87d4dd537c1b91b"}},{"ruleId":"D2","level":"warning","message":{"text":"propConstSolver.pickNewEQConds (cognitive 27): propConstSolver.pickNewEQConds has cognitive complexity 27 (threshold 15). Drivers by points: if/else 26, 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":"pkg/expression/constant_propagation.go"},"region":{"startLine":498}}}],"partialFingerprints":{"codehealthFindingId/v1":"ec972541a0010d3057891a6511ff36efcd75e8d360a44e57dd25932972ba6b28"}},{"ruleId":"D2","level":"warning","message":{"text":"InfoCache.getSchemaByTimestampNoLock (cognitive 27): InfoCache.getSchemaByTimestampNoLock has cognitive complexity 27 (threshold 15). Drivers by points: if/else 21, loops 5, boolean chains 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":"pkg/infoschema/cache.go"},"region":{"startLine":172}}}],"partialFingerprints":{"codehealthFindingId/v1":"af7561c3856945563ffb409c089204e415f0289aae410417ac568826cd8450af"}},{"ruleId":"D2","level":"warning","message":{"text":"Syncer.MDLCheckLoop (cognitive 27): Syncer.MDLCheckLoop has cognitive complexity 27 (threshold 15). Drivers by points: if/else 21, loops 3, match/switch 2, boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/infoschema/issyncer/syncer.go"},"region":{"startLine":215}}}],"partialFingerprints":{"codehealthFindingId/v1":"6c8847c47f970d76c5d167cb44b569de12435a4d9f160d05dc6ee90595ec7b39"}},{"ruleId":"D2","level":"warning","message":{"text":"common.isSingleRetryableError (cognitive 27): common.isSingleRetryableError has cognitive complexity 27 (threshold 15). Drivers by points: if/else 18, match/switch 6, boolean chains 3 (nesting depth added 12). 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":"pkg/lightning/common/retry.go"},"region":{"startLine":146}}}],"partialFingerprints":{"codehealthFindingId/v1":"f683f54949df5a7da319bc727c35453aee55d8996c5c302ed885aa6913a52a45"}},{"ruleId":"D2","level":"warning","message":{"text":"MydumperRuntime.adjust (cognitive 27): MydumperRuntime.adjust has cognitive complexity 27 (threshold 15). Drivers by points: if/else 18, loops 6, 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/lightning/config/config.go"},"region":{"startLine":921}}}],"partialFingerprints":{"codehealthFindingId/v1":"b848ac6280169d73f85c4516a07ab08fbc85c7390b273cb6df88113c68343163"}},{"ruleId":"D2","level":"warning","message":{"text":"Conflict.adjust (cognitive 27): Conflict.adjust has cognitive complexity 27 (threshold 15). Drivers by points: if/else 17, boolean chains 7, match/switch 3 (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":"pkg/lightning/config/config.go"},"region":{"startLine":1402}}}],"partialFingerprints":{"codehealthFindingId/v1":"95cd78caa96fc5f4567abde3c647e834eed0c415dc9e9baed33ac12aa51c1369"}},{"ruleId":"D2","level":"warning","message":{"text":"allocator.alloc4Sequence (cognitive 27): allocator.alloc4Sequence has cognitive complexity 27 (threshold 15). Drivers by points: if/else 26, boolean chains 1 (nesting depth added 9). Most of this is not in the body itself: 2 of the 27 points are its own statements and the rest belongs to one function literal inside it that branches (line 1100). 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":"pkg/meta/autoid/autoid.go"},"region":{"startLine":1087}}}],"partialFingerprints":{"codehealthFindingId/v1":"bdc7c3a60b4e48cc0789f2a4b8a704e49474cbe5dfe0ed26f3300fb7a514fa8f"}},{"ruleId":"D2","level":"warning","message":{"text":"Optimizer.findMoreEquiv (cognitive 27): Optimizer.findMoreEquiv has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15, loops 10, boolean chains 2 (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":"pkg/planner/cascades/old/optimize.go"},"region":{"startLine":174}}}],"partialFingerprints":{"codehealthFindingId/v1":"30f3167ee8ef276eecf2529c7c783ee9b71ccb267620bf9171f7d24e666b7113"}},{"ruleId":"D2","level":"warning","message":{"text":"core.extractSingeValueColNamesFromWhere (cognitive 27): core.extractSingeValueColNamesFromWhere has cognitive complexity 27 (threshold 15). Drivers by points: if/else 25, 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":"pkg/planner/core/logical_plan_builder.go"},"region":{"startLine":3754}}}],"partialFingerprints":{"codehealthFindingId/v1":"15f981340b8804bacfcc1530cfd5034cd024f01c6886e8c31dc6b6d620e7f6cd"}},{"ruleId":"D2","level":"warning","message":{"text":"core.GetPlanFromPlanCache (cognitive 27): core.GetPlanFromPlanCache has cognitive complexity 27 (threshold 15). Drivers by points: if/else 23, boolean chains 4 (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/planner/core/plan_cache.go"},"region":{"startLine":205}}}],"partialFingerprints":{"codehealthFindingId/v1":"63ebe1f2591032fab7e6b0e1e5526a713fc7e3fc6bdf71eb14560840df05358c"}},{"ruleId":"D2","level":"warning","message":{"text":"core.TryFastPlan (cognitive 27): core.TryFastPlan has cognitive complexity 27 (threshold 15). Drivers by points: if/else 24, boolean chains 2, match/switch 1 (nesting depth added 14). Of this number, 24 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":"pkg/planner/core/point_get_plan.go"},"region":{"startLine":82}}}],"partialFingerprints":{"codehealthFindingId/v1":"61976863914e718cd62fd4a657e4dabe3b22724dbbaa4d664f8b7e906c21b439"}},{"ruleId":"D2","level":"warning","message":{"text":"core.canInlineProjection (cognitive 27): core.canInlineProjection has cognitive complexity 27 (threshold 15). Drivers by points: if/else 19, loops 6, boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/rule_join_reorder_projection_inline.go"},"region":{"startLine":164}}}],"partialFingerprints":{"codehealthFindingId/v1":"c1c7d8c033ffa68f161b5d5433d423f30ec657239e728952a67cc5c6ffc939ca"}},{"ruleId":"D2","level":"warning","message":{"text":"LogicalAggregation.PruneColumns (cognitive 27): LogicalAggregation.PruneColumns has cognitive complexity 27 (threshold 15). Drivers by points: if/else 19, boolean chains 4, loops 4 (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/planner/core/operator/logicalop/logical_aggregation.go"},"region":{"startLine":113}}}],"partialFingerprints":{"codehealthFindingId/v1":"9eb25fa9572c1a53ac331493291265a18faa88706cc955e8ffcbe0df4be696cb"}},{"ruleId":"D2","level":"warning","message":{"text":"LogicalJoin.BuildKeyInfo (cognitive 27): LogicalJoin.BuildKeyInfo has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15, loops 9, boolean chains 2, match/switch 1 (nesting depth added 14). Most of this is not in the body itself: 11 of the 27 points are its own statements and the rest belongs to one function literal inside it that branches (line 383). 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":"pkg/planner/core/operator/logicalop/logical_join.go"},"region":{"startLine":365}}}],"partialFingerprints":{"codehealthFindingId/v1":"3dec49108186a4d9bf495eb8fd3e20b0f4bfb4a74202d5b7f54629aa34fc0a22"}},{"ruleId":"D2","level":"warning","message":{"text":"FrameBound.Equals (cognitive 27): FrameBound.Equals has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13, boolean chains 11, loops 3 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/operator/logicalop/logical_window.go"},"region":{"startLine":147}}}],"partialFingerprints":{"codehealthFindingId/v1":"e3cbe74148518a261f4f36a629682eb75e78f4a6c45b99f61989082e78d0c85a"}},{"ruleId":"D2","level":"warning","message":{"text":"Update.buildTbl2UpdateColumns (cognitive 27): Update.buildTbl2UpdateColumns has cognitive complexity 27 (threshold 15). Drivers by points: if/else 16, loops 9, boolean chains 2 (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":"pkg/planner/core/operator/physicalop/foreign_key.go"},"region":{"startLine":376}}}],"partialFingerprints":{"codehealthFindingId/v1":"859b2482cba22dc2a4ccc4b64bd48ac375bbdfdd4457e0a893156e1360b0e498"}},{"ruleId":"D2","level":"warning","message":{"text":"PhysicalWindow.ResolveIndices (cognitive 27): PhysicalWindow.ResolveIndices has cognitive complexity 27 (threshold 15). Drivers by points: if/else 17, loops 10 (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":"pkg/planner/core/operator/physicalop/physical_window.go"},"region":{"startLine":230}}}],"partialFingerprints":{"codehealthFindingId/v1":"087c2dcb97ae336fc2502ef05b7c8526245001b590d670c71676a7a98a419156"}},{"ruleId":"D2","level":"warning","message":{"text":"PlanBuilder.checkOnlyFullGroupByWithOutGroupClause (cognitive 27): PlanBuilder.checkOnlyFullGroupByWithOutGroupClause has cognitive complexity 27 (threshold 15). Drivers by points: if/else 19, loops 5, boolean chains 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":"pkg/planner/core/logical_plan_builder.go"},"region":{"startLine":3876}}}],"partialFingerprints":{"codehealthFindingId/v1":"648cb2c2bbbc391d951d6b193a477092ef3e997cbb4fa47824756a0aa4bb4fc5"}},{"ruleId":"D2","level":"warning","message":{"text":"columnStatsUsageCollector.collectInterestingColumnsForDataSource (cognitive 27): columnStatsUsageCollector.collectInterestingColumnsForDataSource has cognitive complexity 27 (threshold 15). Drivers by points: if/else 19, loops 8 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/rule/collect_column_stats_usage.go"},"region":{"startLine":207}}}],"partialFingerprints":{"codehealthFindingId/v1":"f91b6460eb73337eeaf7bd989cb031a61f8d147485081777be9eae2d55c49798"}},{"ruleId":"D2","level":"warning","message":{"text":"rule.CollectDependingVirtualCols (cognitive 27): rule.CollectDependingVirtualCols has cognitive complexity 27 (threshold 15). Drivers by points: if/else 17, loops 9, boolean chains 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":"pkg/planner/core/rule/rule_collect_plan_stats.go"},"region":{"startLine":420}}}],"partialFingerprints":{"codehealthFindingId/v1":"fdd0d1bba9593c058ba2b66d555f6b63fb4e994c6b4f277bba130e509649a1cd"}},{"ruleId":"D2","level":"warning","message":{"text":"listPartitionPruner.findUsedListPartitions (cognitive 27): listPartitionPruner.findUsedListPartitions has cognitive complexity 27 (threshold 15). Drivers by points: if/else 22, loops 3, boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/rule/rule_partition_processor.go"},"region":{"startLine":775}}}],"partialFingerprints":{"codehealthFindingId/v1":"c1b8237abd77329239cfd57c7a397c9566b37f2d60efbaedb69b51fc25d465d5"}},{"ruleId":"D2","level":"warning","message":{"text":"RangePruner.extractDataForPrune (cognitive 27): RangePruner.extractDataForPrune has cognitive complexity 27 (threshold 15). Drivers by points: if/else 21, boolean chains 5, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/rule/rule_partition_processor.go"},"region":{"startLine":1577}}}],"partialFingerprints":{"codehealthFindingId/v1":"7378c1f832e5b2c49325e82206f3e0266ed124b2f6139d71161d4a2aeb2d996a"}},{"ruleId":"D2","level":"warning","message":{"text":"autoAdmin.calculateBestIndexes (cognitive 27): autoAdmin.calculateBestIndexes has cognitive complexity 27 (threshold 15). Drivers by points: if/else 23, loops 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":"pkg/planner/indexadvisor/algorithm.go"},"region":{"startLine":68}}}],"partialFingerprints":{"codehealthFindingId/v1":"78ba2f07592b5b3d73b27ace1f0d1ed12f84eb70e7b309d5ffc19b90991b4fb5"}},{"ruleId":"D2","level":"warning","message":{"text":"MySQLPrivilege.decodeGlobalPrivTableRow (cognitive 27): MySQLPrivilege.decodeGlobalPrivTableRow has cognitive complexity 27 (threshold 15). Drivers by points: if/else 26, loops 1 (nesting depth added 16). Most of this is not in the body itself: 0 of the 27 points are its own statements and the rest belongs to one function literal inside it that branches (line 1128). 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":"pkg/privilege/privileges/cache.go"},"region":{"startLine":1127}}}],"partialFingerprints":{"codehealthFindingId/v1":"ef4469786410d78bb16fde231d80d11d935c162e089b10b15a5d2f856c37ce87"}},{"ruleId":"D2","level":"warning","message":{"text":"clientConn.dispatch (cognitive 27): clientConn.dispatch has cognitive complexity 27 (threshold 15). Drivers by points: if/else 23, boolean chains 2, match/switch 2 (nesting depth added 7). Of this number, 25 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":"pkg/server/conn.go"},"region":{"startLine":1437}}}],"partialFingerprints":{"codehealthFindingId/v1":"0bd4f4a4b887bd28a46fcf6a75e0fb4d4130300aa7c89b21b8d24f99d7f5049d"}},{"ruleId":"D2","level":"warning","message":{"text":"DeleteKeyHandler.ServeHTTP (cognitive 27): DeleteKeyHandler.ServeHTTP has cognitive complexity 27 (threshold 15). Drivers by points: if/else 21, loops 6 (nesting depth added 9). 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: 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":"pkg/server/handler/tikvhandler/tikv_handler.go"},"region":{"startLine":2044}}}],"partialFingerprints":{"codehealthFindingId/v1":"7b2bdd99778fb40b1ce2b395fdaf9b3913cc500f620b13be95122c72cb99d555"}},{"ruleId":"D2","level":"warning","message":{"text":"Refresher.AnalyzeHighestPriorityTables (cognitive 27): Refresher.AnalyzeHighestPriorityTables has cognitive complexity 27 (threshold 15). Drivers by points: if/else 25, boolean chains 1, 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/statistics/handle/autoanalyze/refresher/refresher.go"},"region":{"startLine":93}}}],"partialFingerprints":{"codehealthFindingId/v1":"a3e6286166da4b2b6f35e1bcb1d37c3c5e7b193e957097e74029a622e75521b0"}},{"ruleId":"D2","level":"warning","message":{"text":"storage.loadNeededColumnHistograms (cognitive 27): storage.loadNeededColumnHistograms has cognitive complexity 27 (threshold 15). Drivers by points: if/else 23, boolean chains 4 (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/statistics/handle/storage/read.go"},"region":{"startLine":627}}}],"partialFingerprints":{"codehealthFindingId/v1":"dbc8c7162a2f7b9fd51459087115fe42a2abecfaa8d895a6424a1b41e78469a4"}},{"ruleId":"D2","level":"warning","message":{"text":"RegionCache.SplitKeyRangesByLocations (cognitive 27): RegionCache.SplitKeyRangesByLocations has cognitive complexity 27 (threshold 15). Drivers by points: if/else 22, boolean chains 3, loops 2 (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/store/copr/region_cache.go"},"region":{"startLine":668}}}],"partialFingerprints":{"codehealthFindingId/v1":"07af3b30deab0cb3c61aed76a9ac2330a0bf3cb22b1e34a690cff7931f2ac93a"}},{"ruleId":"D2","level":"warning","message":{"text":"tables.checkHandleConsistency (cognitive 27): tables.checkHandleConsistency has cognitive complexity 27 (threshold 15). Drivers by points: if/else 25, boolean chains 1, 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":"pkg/table/tables/mutation_checker.go"},"region":{"startLine":137}}}],"partialFingerprints":{"codehealthFindingId/v1":"2913e193b4c92000fd52584ba88a6c0b811ed92e7695b574b0c37a90eee047aa"}},{"ruleId":"D2","level":"warning","message":{"text":"index.Exist (cognitive 27): index.Exist has cognitive complexity 27 (threshold 15). Drivers by points: if/else 24, boolean chains 2, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/table/tables/index.go"},"region":{"startLine":717}}}],"partialFingerprints":{"codehealthFindingId/v1":"cd70dacfb4979ce25d836098538984ab9b19aea129503b641785184b6ca4ae8a"}},{"ruleId":"D2","level":"warning","message":{"text":"tablecodec.genIndexValueVersion0 (cognitive 27): tablecodec.genIndexValueVersion0 has cognitive complexity 27 (threshold 15). Drivers by points: if/else 23, boolean chains 2, loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/tablecodec/tablecodec.go"},"region":{"startLine":1738}}}],"partialFingerprints":{"codehealthFindingId/v1":"d219435cc35bda139b02bb010fe7fe70e480f0aca8832faa32ee65acb0ee32e3"}},{"ruleId":"D2","level":"warning","message":{"text":"telemetry.getTTLUsageInfo (cognitive 27): telemetry.getTTLUsageInfo has cognitive complexity 27 (threshold 15). Drivers by points: if/else 18, loops 7, boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/telemetry/ttl.go"},"region":{"startLine":108}}}],"partialFingerprints":{"codehealthFindingId/v1":"53015c5f8a0394f7a8dfbe624e7c80ab13553d7125f0ae44286a795614e0fb44"}},{"ruleId":"D2","level":"warning","message":{"text":"TimerGroupRuntime.tryTriggerTimerEvents (cognitive 27): TimerGroupRuntime.tryTriggerTimerEvents has cognitive complexity 27 (threshold 15). Drivers by points: if/else 17, loops 5, boolean chains 3, match/switch 2 (nesting depth added 9). Of this number, 16 points are the body\u0027s own statements and 11 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":"pkg/timer/runtime/runtime.go"},"region":{"startLine":254}}}],"partialFingerprints":{"codehealthFindingId/v1":"3d4c9191a4c9b271fd6b56d2c945e7a86e845937ea246adfb8f4cdc7ad619a11"}},{"ruleId":"D2","level":"warning","message":{"text":"BinaryJSON.Walk (cognitive 27): BinaryJSON.Walk has cognitive complexity 27 (threshold 15). Drivers by points: if/else 17, loops 6, boolean chains 4 (nesting depth added 10). Most of this is not in the body itself: 10 of the 27 points are its own statements and the rest belongs to one function literal inside it that branches (line 1367). 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":"pkg/types/json_binary_functions.go"},"region":{"startLine":1363}}}],"partialFingerprints":{"codehealthFindingId/v1":"b0d7e9ae11b8bda14a8aa717148ae654b31259a46338d0946938692db6bdab81"}},{"ruleId":"D2","level":"warning","message":{"text":"cgroup.getCgroupCPU (cognitive 27): cgroup.getCgroupCPU has cognitive complexity 27 (threshold 15). Drivers by points: if/else 25, match/switch 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/util/cgroup/cgroup_cpu.go"},"region":{"startLine":27}}}],"partialFingerprints":{"codehealthFindingId/v1":"ad0524339591df330df3278c988fdf2baa55b07f96583c82d9d16b5a7f3543f1"}},{"ruleId":"D2","level":"warning","message":{"text":"chunk.CopySelectedJoinRowsDirect (cognitive 27): chunk.CopySelectedJoinRowsDirect has cognitive complexity 27 (threshold 15). Drivers by points: if/else 17, loops 9, 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":"pkg/util/chunk/chunk_util.go"},"region":{"startLine":33}}}],"partialFingerprints":{"codehealthFindingId/v1":"3590bf81758ecbc577360362c89fb784cf4ebb13ddec72f198d2ed1bd1e7a12d"}},{"ruleId":"D2","level":"warning","message":{"text":"ranger.convertPointsInPlace (cognitive 27): ranger.convertPointsInPlace has cognitive complexity 27 (threshold 15). Drivers by points: if/else 25, boolean chains 1, 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":"pkg/util/ranger/ranger.go"},"region":{"startLine":65}}}],"partialFingerprints":{"codehealthFindingId/v1":"088a9a808149c903eb28334898de1c869006406e5d6029609fb1176b9ebc4cc8"}},{"ruleId":"D2","level":"warning","message":{"text":"CreateUserStmt.Restore (cognitive 27): CreateUserStmt.Restore has cognitive complexity 27 (threshold 15). Drivers by points: if/else 23, loops 4 (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/parser/ast/misc.go"},"region":{"startLine":1875}}}],"partialFingerprints":{"codehealthFindingId/v1":"e235f4cde09e274a9b74912c1b049f16e7036db1180e8300fb0341ad76bf7c1f"}},{"ruleId":"D2","level":"warning","message":{"text":"BRIEStmt.Restore (cognitive 27): BRIEStmt.Restore has cognitive complexity 27 (threshold 15). Drivers by points: if/else 17, loops 7, match/switch 3 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/parser/ast/misc.go"},"region":{"startLine":3873}}}],"partialFingerprints":{"codehealthFindingId/v1":"69f5f13042909236b85ba119e0094abe70d8ec7eb80d7e1f26d80dab99af036e"}},{"ruleId":"D2","level":"warning","message":{"text":"FieldType.RestoreAsCastType (cognitive 27): FieldType.RestoreAsCastType has cognitive complexity 27 (threshold 15). Drivers by points: if/else 22, boolean chains 4, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/parser/types/field_type.go"},"region":{"startLine":623}}}],"partialFingerprints":{"codehealthFindingId/v1":"a5cd57d92d46166929aa7ae4308de350b7b4a9e8ee3d2f889a30d8c051a45745"}},{"ruleId":"D2","level":"warning","message":{"text":"EC2Session.CreateVolumes (cognitive 26): EC2Session.CreateVolumes has cognitive complexity 26 (threshold 15). Drivers by points: if/else 20, loops 6 (nesting depth added 14). Most of this is not in the body itself: 5 of the 26 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 594, 581). 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":"br/pkg/aws/ebs.go"},"region":{"startLine":566}}}],"partialFingerprints":{"codehealthFindingId/v1":"88ccb84b8b38935ff1186d362dd6231dc43e6db8ab5ec9665c3df28eccade5f7"}},{"ruleId":"D2","level":"warning","message":{"text":"backup.BuildBackupRangeAndInitSchema (cognitive 26): backup.BuildBackupRangeAndInitSchema has cognitive complexity 26 (threshold 15). Drivers by points: if/else 20, loops 5, boolean chains 1 (nesting depth added 11). Of this number, 18 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":"br/pkg/backup/client.go"},"region":{"startLine":754}}}],"partialFingerprints":{"codehealthFindingId/v1":"983392f3ecbf226b1529e44ba4a6ea5386b3a5d390f97ea5985410d4872e0a69"}},{"ruleId":"D2","level":"warning","message":{"text":"LogClient.RestoreKVFiles (cognitive 26): LogClient.RestoreKVFiles has cognitive complexity 26 (threshold 15). Drivers by points: if/else 20, loops 5, boolean chains 1 (nesting depth added 11). Most of this is not in the body itself: 4 of the 26 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 1056, 1119, 1031). 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":"br/pkg/restore/log_client/client.go"},"region":{"startLine":1013}}}],"partialFingerprints":{"codehealthFindingId/v1":"e5a43a864620203f0ee6558c404b63784a524688ce2039496479c0cfcbb69109"}},{"ruleId":"D2","level":"warning","message":{"text":"task.waitUntilAllScheduleStopped (cognitive 26): task.waitUntilAllScheduleStopped has cognitive complexity 26 (threshold 15). Drivers by points: if/else 22, loops 3, boolean chains 1 (nesting depth added 15). Most of this is not in the body itself: 3 of the 26 points are its own statements and the rest belongs to one function literal inside it that branches (line 363). 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":"br/pkg/task/backup_ebs.go"},"region":{"startLine":345}}}],"partialFingerprints":{"codehealthFindingId/v1":"bb4b4db7be95661a53e5b89c6b1b136645a1fb8851bf0412b4dc0dabccf5b500"}},{"ruleId":"D2","level":"warning","message":{"text":"column.parseRule (cognitive 26): column.parseRule has cognitive complexity 26 (threshold 15). Drivers by points: if/else 22, boolean chains 2, loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/importer/parser.go"},"region":{"startLine":59}}}],"partialFingerprints":{"codehealthFindingId/v1":"af7fd7f9084175c7376a6de6a027a2ab9913f631c16209b88bad1be560f233c2"}},{"ruleId":"D2","level":"warning","message":{"text":"dupDetector.addKeysByChunk (cognitive 26): dupDetector.addKeysByChunk has cognitive complexity 26 (threshold 15). Drivers by points: if/else 21, loops 5 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lightning/pkg/importer/dup_detect.go"},"region":{"startLine":201}}}],"partialFingerprints":{"codehealthFindingId/v1":"0eb6bee69b848fbc8d1cb92276be64325aa3091060ad0e3cb800d61cdda34b57"}},{"ruleId":"D2","level":"warning","message":{"text":"checkpointCheckItem.checkpointIsValid (cognitive 26): checkpointCheckItem.checkpointIsValid has cognitive complexity 26 (threshold 15). Drivers by points: if/else 22, match/switch 2, boolean chains 1, 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":"lightning/pkg/importer/precheck_impl.go"},"region":{"startLine":683}}}],"partialFingerprints":{"codehealthFindingId/v1":"452125880383d8d70680c30414b01530da80e041bb08ccb1e671d4fd7dd3a294"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.processJobs (cognitive 26): ddl.processJobs has cognitive complexity 26 (threshold 15). Drivers by points: if/else 19, loops 7 (nesting depth added 13). Of this number, 23 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":"pkg/ddl/ddl.go"},"region":{"startLine":1515}}}],"partialFingerprints":{"codehealthFindingId/v1":"926470cb66b83dbb2d43ac18ccc58aebda3e1aafccb40b9506b358521c9eb183"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.checkTableForeignKeyValidInOwner (cognitive 26): ddl.checkTableForeignKeyValidInOwner has cognitive complexity 26 (threshold 15). Drivers by points: if/else 21, boolean chains 3, loops 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/foreign_key.go"},"region":{"startLine":214}}}],"partialFingerprints":{"codehealthFindingId/v1":"cf27dd3827acf6ba4ff6964c82e063377542a60085283b99ab18b4c643806a58"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.checkDuplicateForUniqueIndex (cognitive 26): ddl.checkDuplicateForUniqueIndex has cognitive complexity 26 (threshold 15). Drivers by points: if/else 25, loops 1 (nesting depth added 16). Of this number, 24 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/index.go"},"region":{"startLine":3016}}}],"partialFingerprints":{"codehealthFindingId/v1":"284d291dd69e321a06da237b76b5cc185cb5e3392541ad737314794b7acd37e7"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.checkAndGetColumnsTypeAndValuesMatch (cognitive 26): ddl.checkAndGetColumnsTypeAndValuesMatch has cognitive complexity 26 (threshold 15). Drivers by points: match/switch 14, if/else 11, loops 1 (nesting depth added 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. 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/ddl/partition.go"},"region":{"startLine":1200}}}],"partialFingerprints":{"codehealthFindingId/v1":"8dd6892c3be4c8c0c29b70a2cb2776a656c1b2d27a8299b3a6d21b5a500f31d4"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.getPlacementPolicyDependedObjectsIDs (cognitive 26): ddl.getPlacementPolicyDependedObjectsIDs has cognitive complexity 26 (threshold 15). Drivers by points: if/else 16, loops 7, boolean chains 3 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/placement_policy.go"},"region":{"startLine":412}}}],"partialFingerprints":{"codehealthFindingId/v1":"330e518ca2d91204d08643af0d09a1c7beeaf6d30c3f8b5ae355ff73234ecce1"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.handleSequenceOptions (cognitive 26): ddl.handleSequenceOptions has cognitive complexity 26 (threshold 15). Drivers by points: if/else 22, match/switch 2, 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":"pkg/ddl/sequence.go"},"region":{"startLine":85}}}],"partialFingerprints":{"codehealthFindingId/v1":"165f508ca03547ebce7b245e92c0bbab2852f83b429f72cd9ed5f1469c52be36"}},{"ruleId":"D2","level":"warning","message":{"text":"executor.AddTablePartitions (cognitive 26): executor.AddTablePartitions has cognitive complexity 26 (threshold 15). Drivers by points: if/else 20, boolean chains 4, match/switch 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":"pkg/ddl/executor.go"},"region":{"startLine":2285}}}],"partialFingerprints":{"codehealthFindingId/v1":"fc5dcd81c332513a83d7f74566431fa716b5056f2bc518fa15e921341b7bbe3e"}},{"ruleId":"D2","level":"warning","message":{"text":"worker.onAddColumn (cognitive 26): worker.onAddColumn has cognitive complexity 26 (threshold 15). Drivers by points: if/else 24, boolean chains 1, match/switch 1 (nesting depth added 10). Of this number, 25 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":"pkg/ddl/add_column.go"},"region":{"startLine":54}}}],"partialFingerprints":{"codehealthFindingId/v1":"35f7991f9cdeb8f17fe7699c418193eba8158ab297081b2d0db3cedc11e10338"}},{"ruleId":"D2","level":"warning","message":{"text":"Domain.serverIDKeeper (cognitive 26): Domain.serverIDKeeper has cognitive complexity 26 (threshold 15). Drivers by points: if/else 22, match/switch 2, boolean chains 1, loops 1 (nesting depth added 15). Of this number, 24 points are the body\u0027s own statements and 2 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":"pkg/domain/domain.go"},"region":{"startLine":2801}}}],"partialFingerprints":{"codehealthFindingId/v1":"b8bb181717a5812f616cc52601992ea49f62c73dc6f9f982568bcfb049f47535"}},{"ruleId":"D2","level":"warning","message":{"text":"ExecStmt.LogSlowQuery (cognitive 26): ExecStmt.LogSlowQuery has cognitive complexity 26 (threshold 15). Drivers by points: if/else 22, boolean chains 4 (nesting depth added 5). Of this number, 23 points are the body\u0027s own statements and 3 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":"pkg/executor/adapter.go"},"region":{"startLine":1952}}}],"partialFingerprints":{"codehealthFindingId/v1":"d78028128c50e9531d254ac045d18baa7f0d7de2acf170a166ea15328164bae8"}},{"ruleId":"D2","level":"warning","message":{"text":"groupConcatDistinctOrder.UpdatePartialResult (cognitive 26): groupConcatDistinctOrder.UpdatePartialResult has cognitive complexity 26 (threshold 15). Drivers by points: if/else 20, loops 6 (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":"pkg/executor/aggfuncs/func_group_concat.go"},"region":{"startLine":649}}}],"partialFingerprints":{"codehealthFindingId/v1":"e8ab46de29bc84f8c963e0011f1c59a2b5403c3299a3ae37c1d6f90b3840ad43"}},{"ruleId":"D2","level":"warning","message":{"text":"AnalyzeIndexExec.buildStatsFromResult (cognitive 26): AnalyzeIndexExec.buildStatsFromResult has cognitive complexity 26 (threshold 15). Drivers by points: if/else 19, loops 3, boolean chains 2, match/switch 2 (nesting depth added 9). Of this number, 18 points are the body\u0027s own statements and 8 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":"pkg/executor/analyze_idx.go"},"region":{"startLine":185}}}],"partialFingerprints":{"codehealthFindingId/v1":"9d394cb16bd157ac7a5494841d8d9c2b68383b748b4dc6aed1a9735bd1df00b3"}},{"ruleId":"D2","level":"warning","message":{"text":"executorBuilder.buildBatchPointGet (cognitive 26): executorBuilder.buildBatchPointGet has cognitive complexity 26 (threshold 15). Drivers by points: if/else 20, boolean chains 3, loops 3 (nesting depth added 4). Of this number, 24 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: 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":"pkg/executor/builder.go"},"region":{"startLine":5727}}}],"partialFingerprints":{"codehealthFindingId/v1":"05913a99a108a00d9d6bc2e0ea2737f107998d20ab11ca1bd3dc061d6de1afef"}},{"ruleId":"D2","level":"warning","message":{"text":"Compiler.Compile (cognitive 26): Compiler.Compile has cognitive complexity 26 (threshold 15). Drivers by points: if/else 23, boolean chains 3 (nesting depth added 6). Of this number, 21 points are the body\u0027s own statements and 5 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":"pkg/executor/compiler.go"},"region":{"startLine":50}}}],"partialFingerprints":{"codehealthFindingId/v1":"3bbb815a3708ac8d4ea62580f77df6e9a21d77f5577d7742c7433ddbbe48f32d"}},{"ruleId":"D2","level":"warning","message":{"text":"TableKVEncoder.parserData2TableData (cognitive 26): TableKVEncoder.parserData2TableData has cognitive complexity 26 (threshold 15). Drivers by points: if/else 18, loops 5, boolean chains 3 (nesting depth added 8). Of this number, 23 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":"pkg/executor/importer/kv_encode.go"},"region":{"startLine":109}}}],"partialFingerprints":{"codehealthFindingId/v1":"aec38675fece646e68d91daec723d28de8c9054dbf96f84002d5c048a0137f40"}},{"ruleId":"D2","level":"warning","message":{"text":"IndexMergeReaderExecutor.startPartialIndexWorker (cognitive 26): IndexMergeReaderExecutor.startPartialIndexWorker has cognitive complexity 26 (threshold 15). Drivers by points: if/else 18, boolean chains 3, loops 3, match/switch 2 (nesting depth added 8). Most of this is not in the body itself: 3 of the 26 points are its own statements and the rest belongs to one function literal inside it that branches (line 407). 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":"pkg/executor/index_merge_reader.go"},"region":{"startLine":380}}}],"partialFingerprints":{"codehealthFindingId/v1":"75c3bb4c469a370eb824bc0639476188dff195f733702e96ad576398b3a87f07"}},{"ruleId":"D2","level":"warning","message":{"text":"InsertRuntimeStat.String (cognitive 26): InsertRuntimeStat.String has cognitive complexity 26 (threshold 15). Drivers by points: if/else 25, boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/insert_common.go"},"region":{"startLine":1518}}}],"partialFingerprints":{"codehealthFindingId/v1":"9775ff39e1a64f1374ee69abda609a4b16d4d95958e5e7c6908ddbdcc3289e43"}},{"ruleId":"D2","level":"warning","message":{"text":"innerWorker.constructDatumLookupKey (cognitive 26): innerWorker.constructDatumLookupKey has cognitive complexity 26 (threshold 15). Drivers by points: if/else 20, boolean chains 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":"pkg/executor/join/index_lookup_join.go"},"region":{"startLine":654}}}],"partialFingerprints":{"codehealthFindingId/v1":"f41c1d9fb9fea7677fda887f6e3506d681d8dade27db11e0024cb79f04b98516"}},{"ruleId":"D2","level":"warning","message":{"text":"outerJoinProbe.buildResultForMatchedRowsAfterOtherCondition (cognitive 26): outerJoinProbe.buildResultForMatchedRowsAfterOtherCondition has cognitive complexity 26 (threshold 15). Drivers by points: if/else 19, loops 7 (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/executor/join/outer_join_probe.go"},"region":{"startLine":155}}}],"partialFingerprints":{"codehealthFindingId/v1":"0ba636c0f27affddef4b828f636968283333a77532a04161aeac0b22e0103d3c"}},{"ruleId":"D2","level":"warning","message":{"text":"memIndexMergeReader.getHandles (cognitive 26): memIndexMergeReader.getHandles has cognitive complexity 26 (threshold 15). Drivers by points: if/else 16, loops 6, match/switch 3, boolean chains 1 (nesting depth added 14). Of this number, 22 points are the body\u0027s own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body 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/executor/mem_reader.go"},"region":{"startLine":1044}}}],"partialFingerprints":{"codehealthFindingId/v1":"3acc3786ce61518f92cc42cf8e8ebc2e3601a0682f15ddf2d30158910177c985"}},{"ruleId":"D2","level":"warning","message":{"text":"clusterLogRetriever.retrieve (cognitive 26): clusterLogRetriever.retrieve has cognitive complexity 26 (threshold 15). Drivers by points: if/else 20, boolean chains 3, loops 3 (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":"pkg/executor/memtable_reader.go"},"region":{"startLine":552}}}],"partialFingerprints":{"codehealthFindingId/v1":"9cb2a9b85126c98e5685d4492b64819124f4ed3944ad95436e3ef39f9c8a190c"}},{"ruleId":"D2","level":"warning","message":{"text":"sumIntFunction.Update (cognitive 26): sumIntFunction.Update has cognitive complexity 26 (threshold 15). Drivers by points: if/else 25, boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/aggregation/sum_int.go"},"region":{"startLine":29}}}],"partialFingerprints":{"codehealthFindingId/v1":"46ebdada284fc9a35ace5d988e317b79a8fef8a5b003b9764778290f962b00b3"}},{"ruleId":"D2","level":"warning","message":{"text":"expression.replaceEqCondtionWithTrue (cognitive 26): expression.replaceEqCondtionWithTrue has cognitive complexity 26 (threshold 15). Drivers by points: if/else 17, boolean chains 4, match/switch 3, loops 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/constant_propagation.go"},"region":{"startLine":165}}}],"partialFingerprints":{"codehealthFindingId/v1":"bbd6187119b93c93418ea255ec6e3f8d9b81e6417a12a1adde85b216676d14e8"}},{"ruleId":"D2","level":"warning","message":{"text":"expression.tryToReplaceCond (cognitive 26): expression.tryToReplaceCond has cognitive complexity 26 (threshold 15). Drivers by points: if/else 23, boolean chains 2, 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/expression/constant_propagation.go"},"region":{"startLine":240}}}],"partialFingerprints":{"codehealthFindingId/v1":"76e5c905c79368d4f653650d53d24bb737a2d4c97e2352b8ead152d18f0556f3"}},{"ruleId":"D2","level":"warning","message":{"text":"expression.extractFiltersFromDNF (cognitive 26): expression.extractFiltersFromDNF has cognitive complexity 26 (threshold 15). Drivers by points: if/else 18, loops 8 (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/expression/util.go"},"region":{"startLine":1222}}}],"partialFingerprints":{"codehealthFindingId/v1":"8442f2b5379e23f4956d8d9d5a445001dabe875fb0da2e92f331bbd061b0b622"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinSHA2Sig.vecEvalString (cognitive 26): builtinSHA2Sig.vecEvalString has cognitive complexity 26 (threshold 15). Drivers by points: if/else 22, match/switch 2, boolean chains 1, 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":"pkg/expression/builtin_encryption_vec.go"},"region":{"startLine":457}}}],"partialFingerprints":{"codehealthFindingId/v1":"ed3a1be225f6becd23fd0fd7b22807038adbc09dcf073f9b63070c695dfc71e2"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinJSONSearchSig.evalJSON (cognitive 26): builtinJSONSearchSig.evalJSON has cognitive complexity 26 (threshold 15). Drivers by points: if/else 18, boolean chains 6, 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":"pkg/expression/builtin_json.go"},"region":{"startLine":1656}}}],"partialFingerprints":{"codehealthFindingId/v1":"98b5a5fba2f32829fa4d0795a577d9cd85ee567d809164e92df2cb117b10d9db"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinInet6AtonSig.vecEvalString (cognitive 26): builtinInet6AtonSig.vecEvalString has cognitive complexity 26 (threshold 15). Drivers by points: if/else 23, boolean chains 2, 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/expression/builtin_miscellaneous_vec.go"},"region":{"startLine":577}}}],"partialFingerprints":{"codehealthFindingId/v1":"c705564b7b29c3367d4b980d02d6815aa991c25fae52211959bdd306cde50f6c"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinTimestamp2ArgsSig.vecEvalTime (cognitive 26): builtinTimestamp2ArgsSig.vecEvalTime has cognitive complexity 26 (threshold 15). Drivers by points: if/else 25, 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/expression/builtin_time_vec.go"},"region":{"startLine":2698}}}],"partialFingerprints":{"codehealthFindingId/v1":"ddf45621baef6e7dd5d53a0d7d17d4ebe02dfbc3c27221fa8b2f53b7791f6af3"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinTimestampAddSig.vecEvalString (cognitive 26): builtinTimestampAddSig.vecEvalString has cognitive complexity 26 (threshold 15). Drivers by points: if/else 24, boolean chains 1, 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/expression/builtin_time_vec.go"},"region":{"startLine":1697}}}],"partialFingerprints":{"codehealthFindingId/v1":"93bb622ca4829f6b30d2f82ee42c391d4dbd10a0095c9e07000656ec6526343b"}},{"ruleId":"D2","level":"warning","message":{"text":"engineManager.close (cognitive 26): engineManager.close has cognitive complexity 26 (threshold 15). Drivers by points: if/else 21, boolean chains 3, loops 2 (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/ingestor/ingestctrl/engine_mgr.go"},"region":{"startLine":529}}}],"partialFingerprints":{"codehealthFindingId/v1":"32009d86ace9311fd9de5350117b8da244c60bc23785df9f93e791c17f9354a7"}},{"ruleId":"D2","level":"warning","message":{"text":"TableKVDecoder.IterRawIndexKeys (cognitive 26): TableKVDecoder.IterRawIndexKeys has cognitive complexity 26 (threshold 15). Drivers by points: if/else 20, 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":"pkg/lightning/backend/kv/kv2sql.go"},"region":{"startLine":74}}}],"partialFingerprints":{"codehealthFindingId/v1":"8b2d93c8586ec734dc9d9c631e128322d9a693a76215e801a7bbf05a50ecb20c"}},{"ruleId":"D2","level":"warning","message":{"text":"mydump.ExportStatement (cognitive 26): mydump.ExportStatement has cognitive complexity 26 (threshold 15). Drivers by points: if/else 22, boolean chains 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":"pkg/lightning/mydump/reader.go"},"region":{"startLine":89}}}],"partialFingerprints":{"codehealthFindingId/v1":"351f280ee15bab09882abe156cf573eb7e18601a94ce05217acc544cf30db758"}},{"ruleId":"D2","level":"warning","message":{"text":"TableInfo.GetPrimaryKey (cognitive 26): TableInfo.GetPrimaryKey has cognitive complexity 26 (threshold 15). Drivers by points: if/else 20, loops 4, boolean chains 2 (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":"pkg/meta/model/table.go"},"region":{"startLine":504}}}],"partialFingerprints":{"codehealthFindingId/v1":"8eb34515e2fa2a0fa544447e2c81057805a59e5be0f41ed2e16f6dd91e6a3cf3"}},{"ruleId":"D2","level":"warning","message":{"text":"core.generateANDIndexMerge4ComposedIndex (cognitive 26): core.generateANDIndexMerge4ComposedIndex has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14, boolean chains 6, loops 6 (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":"pkg/planner/core/indexmerge_path.go"},"region":{"startLine":627}}}],"partialFingerprints":{"codehealthFindingId/v1":"44f726db121ba206c4e8d5cfda86b78606265b2c86b1dc981537128ca15e0054"}},{"ruleId":"D2","level":"warning","message":{"text":"core.checkIsAllSpecialGlobalIndex (cognitive 26): core.checkIsAllSpecialGlobalIndex has cognitive complexity 26 (threshold 15). Drivers by points: if/else 20, loops 4, boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/planbuilder.go"},"region":{"startLine":2642}}}],"partialFingerprints":{"codehealthFindingId/v1":"1136c6c07b1b967e4934537c5868f8fa375de007c0ceeb939175450d0eabefe0"}},{"ruleId":"D2","level":"warning","message":{"text":"core.getPushedDownTopN (cognitive 26): core.getPushedDownTopN has cognitive complexity 26 (threshold 15). Drivers by points: loops 13, if/else 10, boolean chains 3 (nesting depth added 9). 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":"pkg/planner/core/task.go"},"region":{"startLine":861}}}],"partialFingerprints":{"codehealthFindingId/v1":"b98c2850a20661c5c4dee5a2ceda46bbd899f093e8098c11f6f6123de31c8028"}},{"ruleId":"D2","level":"warning","message":{"text":"FullTextIndexResolverProjection.onEnterDataSource (cognitive 26): FullTextIndexResolverProjection.onEnterDataSource has cognitive complexity 26 (threshold 15). Drivers by points: if/else 18, boolean chains 3, loops 3, 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":"pkg/planner/core/fts_resolve_index.go"},"region":{"startLine":289}}}],"partialFingerprints":{"codehealthFindingId/v1":"175f2beca0f65e1bea167b4f47ed7ded33c28e90bd3a7380f43f1abbf4380030"}},{"ruleId":"D2","level":"warning","message":{"text":"partidx.checkIsNullRejected (cognitive 26): partidx.checkIsNullRejected has cognitive complexity 26 (threshold 15). Drivers by points: if/else 18, boolean chains 4, loops 4 (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/planner/core/partidx/check_constraint.go"},"region":{"startLine":182}}}],"partialFingerprints":{"codehealthFindingId/v1":"6c702e48519ea8768f38309af4d919dca31bb1f10d59febe41dfeeb67876ac49"}},{"ruleId":"D2","level":"warning","message":{"text":"PlanBuilder.buildWindowFunctions (cognitive 26): PlanBuilder.buildWindowFunctions has cognitive complexity 26 (threshold 15). Drivers by points: if/else 18, loops 8 (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":"pkg/planner/core/logical_plan_builder.go"},"region":{"startLine":7063}}}],"partialFingerprints":{"codehealthFindingId/v1":"58ab9e1992f79fe8596c3d7d9d868a81a6aa2d1d342af8cfa2626d95f0880978"}},{"ruleId":"D2","level":"warning","message":{"text":"privileges.compareHost (cognitive 26): privileges.compareHost has cognitive complexity 26 (threshold 15). Drivers by points: if/else 16, boolean chains 8, match/switch 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/privilege/privileges/cache.go"},"region":{"startLine":768}}}],"partialFingerprints":{"codehealthFindingId/v1":"080f9ae279d774fcc65dbbb51566fd0e1c9fcc1ded7841ef3179614a994ea3fd"}},{"ruleId":"D2","level":"warning","message":{"text":"clientConn.handleStmt (cognitive 26): clientConn.handleStmt has cognitive complexity 26 (threshold 15). Drivers by points: if/else 24, boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/server/conn.go"},"region":{"startLine":2217}}}],"partialFingerprints":{"codehealthFindingId/v1":"e4608b18f152700359bd86e73af563c3bfa94c7559548146504c0aeb761f1a10"}},{"ruleId":"D2","level":"warning","message":{"text":"session.cleanRetryInfo (cognitive 26): session.cleanRetryInfo has cognitive complexity 26 (threshold 15). Drivers by points: if/else 24, 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":"pkg/session/session.go"},"region":{"startLine":331}}}],"partialFingerprints":{"codehealthFindingId/v1":"cbb96b48e2ab69d5b442d08dbd36fe52229c74e5abd1cda6220b934a676ca579"}},{"ruleId":"D2","level":"warning","message":{"text":"session.handleAssertionFailure (cognitive 26): session.handleAssertionFailure has cognitive complexity 26 (threshold 15). Drivers by points: if/else 21, loops 3, boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/session/session.go"},"region":{"startLine":641}}}],"partialFingerprints":{"codehealthFindingId/v1":"59e26bfae033c46f5e1a5a0152899a2e78121d0b640a1050ef22910eef9e01b3"}},{"ruleId":"D2","level":"warning","message":{"text":"statistics.buildHist (cognitive 26): statistics.buildHist has cognitive complexity 26 (threshold 15). Drivers by points: if/else 22, loops 3, boolean chains 1 (nesting depth added 10). Of this number, 25 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":"pkg/statistics/builder.go"},"region":{"startLine":223}}}],"partialFingerprints":{"codehealthFindingId/v1":"fb88979f4ae31ac7a51cb0ec65eceb23d63649c1d98e58f41f77a91abf3ca97e"}},{"ruleId":"D2","level":"warning","message":{"text":"storage.TableStatsFromStorage (cognitive 26): storage.TableStatsFromStorage has cognitive complexity 26 (threshold 15). Drivers by points: if/else 22, boolean chains 3, loops 1 (nesting depth added 7). Of this number, 22 points are the body\u0027s own statements and 4 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":"pkg/statistics/handle/storage/read.go"},"region":{"startLine":455}}}],"partialFingerprints":{"codehealthFindingId/v1":"586473275ecde5cd1622095e7a89b613203a242f16a4a78623f4ac14b9445d0a"}},{"ruleId":"D2","level":"warning","message":{"text":"gcworker.doGCPlacementRules (cognitive 26): gcworker.doGCPlacementRules has cognitive complexity 26 (threshold 15). Drivers by points: if/else 22, loops 3, match/switch 1 (nesting depth added 8). Of this number, 24 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/store/gcworker/gc_worker.go"},"region":{"startLine":1665}}}],"partialFingerprints":{"codehealthFindingId/v1":"1c3f7469bde9040cfa11d3c9941774ba74ea520eeccd30edb87bb39515a8effd"}},{"ruleId":"D2","level":"warning","message":{"text":"streamAggExec.Next (cognitive 26): streamAggExec.Next has cognitive complexity 26 (threshold 15). Drivers by points: if/else 22, loops 3, boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/store/mockstore/mockcopr/aggregate.go"},"region":{"startLine":317}}}],"partialFingerprints":{"codehealthFindingId/v1":"3e1933451db7ea334185caa110826b570a12b21c4fd6e4f756c346a5eaf56ceb"}},{"ruleId":"D2","level":"warning","message":{"text":"MVCCStore.BatchGet (cognitive 26): MVCCStore.BatchGet has cognitive complexity 26 (threshold 15). Drivers by points: if/else 21, loops 4, boolean chains 1 (nesting depth added 11). Of this number, 22 points are the body\u0027s own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body 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/store/mockstore/unistore/tikv/mvcc.go"},"region":{"startLine":1866}}}],"partialFingerprints":{"codehealthFindingId/v1":"ca837708844e16059838f45522a630b3084d713f2c9b280678fac1b660ae7178"}},{"ruleId":"D2","level":"warning","message":{"text":"cet.insertWeights (cognitive 26): cet.insertWeights has cognitive complexity 26 (threshold 15). Drivers by points: if/else 16, loops 7, match/switch 2, boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/util/collate/ucadata/generator/main.go"},"region":{"startLine":177}}}],"partialFingerprints":{"codehealthFindingId/v1":"e67e85a37c521be581e7298dbe3553e397d1ca6dff0af6ff277e780970acbfeb"}},{"ruleId":"D2","level":"warning","message":{"text":"CopRuntimeStats.String (cognitive 26): CopRuntimeStats.String has cognitive complexity 26 (threshold 15). Drivers by points: if/else 26 (nesting depth added 12). Most of this is not in the body itself: 12 of the 26 points are its own statements and the rest belongs to one function literal inside it that branches (line 243). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal\u0027s work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/util/execdetails/runtime_stats.go"},"region":{"startLine":237}}}],"partialFingerprints":{"codehealthFindingId/v1":"b133a81715e40d7b3e0f47ee2e9e172c460b00db3e4c0d717e02012252cb2e24"}},{"ruleId":"D2","level":"warning","message":{"text":"hint.checkInsertStmtHintDuplicated (cognitive 26): hint.checkInsertStmtHintDuplicated has cognitive complexity 26 (threshold 15). Drivers by points: if/else 18, loops 7, match/switch 1 (nesting depth added 18). 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":"pkg/util/hint/hint_processor.go"},"region":{"startLine":165}}}],"partialFingerprints":{"codehealthFindingId/v1":"e61dec8164469406bb00a69073f9f1caf32f4418f92f3b94dd2a7ba3037b8f66"}},{"ruleId":"D2","level":"warning","message":{"text":"Reporter.ReportAdminCheckInconsistent (cognitive 26): Reporter.ReportAdminCheckInconsistent has cognitive complexity 26 (threshold 15). Drivers by points: if/else 20, loops 4, boolean chains 2 (nesting depth added 13). Of this number, 16 points are the body\u0027s own statements and 10 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/util/logutil/consistency/reporter.go"},"region":{"startLine":260}}}],"partialFingerprints":{"codehealthFindingId/v1":"1ec3dc931fc0144a170715c627e043670b2f08f62d7b16e7e81494dd57a367c7"}},{"ruleId":"D2","level":"warning","message":{"text":"rangeDetacher.buildRangeOnColsByCNFCond (cognitive 26): rangeDetacher.buildRangeOnColsByCNFCond has cognitive complexity 26 (threshold 15). Drivers by points: if/else 23, loops 2, 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":"pkg/util/ranger/ranger.go"},"region":{"startLine":553}}}],"partialFingerprints":{"codehealthFindingId/v1":"6ea6c11e5fa1f8fac67b1d2b195e84a2fd3b489d26af15da745b6dea22470b82"}},{"ruleId":"D2","level":"warning","message":{"text":"ChunkDecoder.DecodeToChunk (cognitive 26): ChunkDecoder.DecodeToChunk has cognitive complexity 26 (threshold 15). Drivers by points: if/else 24, boolean chains 1, 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":"pkg/util/rowcodec/decoder.go"},"region":{"startLine":207}}}],"partialFingerprints":{"codehealthFindingId/v1":"e3a8f3736deb825ddd3abff821675a14b42d4711454bfacd44c35bfa4995fae5"}},{"ruleId":"D2","level":"warning","message":{"text":"auth.hashCrypt (cognitive 26): auth.hashCrypt has cognitive complexity 26 (threshold 15). Drivers by points: if/else 19, loops 7 (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":"pkg/parser/auth/caching_sha2.go"},"region":{"startLine":72}}}],"partialFingerprints":{"codehealthFindingId/v1":"bc1e07516c65f117a78fc9f39c1603e59ac65d0aff893cdcce164a6f0f996bfa"}},{"ruleId":"D2","level":"warning","message":{"text":"SimpleRestorer.GoRestore (cognitive 25): SimpleRestorer.GoRestore has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14, loops 11 (nesting depth added 17). Most of this is not in the body itself: 3 of the 25 points are its own statements and the rest belongs to one function literal inside it that branches (line 192). 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":"br/pkg/restore/restorer.go"},"region":{"startLine":188}}}],"partialFingerprints":{"codehealthFindingId/v1":"6c2f3dd4bc049033b997cfee5fb2a70e5097ea8f2492d26f8167dda44eca69f8"}},{"ruleId":"D2","level":"warning","message":{"text":"SnapClient.GetFilesInRawRange (cognitive 25): SnapClient.GetFilesInRawRange has cognitive complexity 25 (threshold 15). Drivers by points: if/else 16, boolean chains 6, loops 3 (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":"br/pkg/restore/snap_client/client.go"},"region":{"startLine":921}}}],"partialFingerprints":{"codehealthFindingId/v1":"3fe75cef15de5efd513f62a2014fabfeb04b3f48b62a4edf4587a2740cc7ffa2"}},{"ruleId":"D2","level":"warning","message":{"text":"SnapClient.setMergeOptionForTables (cognitive 25): SnapClient.setMergeOptionForTables has cognitive complexity 25 (threshold 15). Drivers by points: if/else 16, loops 8, boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"br/pkg/restore/snap_client/client.go"},"region":{"startLine":1253}}}],"partialFingerprints":{"codehealthFindingId/v1":"006f21c7b94954458c7341e5153be8cf08d5f4742885ee67e351726ecbb25709"}},{"ruleId":"D2","level":"warning","message":{"text":"RawWriteCFValue.ParseFrom (cognitive 25): RawWriteCFValue.ParseFrom has cognitive complexity 25 (threshold 15). Drivers by points: if/else 21, match/switch 2, jumps 1, 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":"br/pkg/stream/meta_kv.go"},"region":{"startLine":154}}}],"partialFingerprints":{"codehealthFindingId/v1":"5972870e9f0a8a3ea4c58ef0a81f3fac50f35cc3c2e832c185eceb954a365728"}},{"ruleId":"D2","level":"warning","message":{"text":"MigrationExt.MergeAndMigrateTo (cognitive 25): MigrationExt.MergeAndMigrateTo has cognitive complexity 25 (threshold 15). Drivers by points: if/else 18, loops 5, boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"br/pkg/stream/stream_metas.go"},"region":{"startLine":932}}}],"partialFingerprints":{"codehealthFindingId/v1":"3dd1ca59e1f97781f57a8c790063c5a5360fef5f2f0eb5d0172b37d92037401a"}},{"ruleId":"D2","level":"warning","message":{"text":"export.GetPartitionTableIDs (cognitive 25): export.GetPartitionTableIDs has cognitive complexity 25 (threshold 15). Drivers by points: if/else 24, loops 1 (nesting depth added 12). Of this number, 15 points are the body\u0027s own statements and 10 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":"dumpling/export/sql.go"},"region":{"startLine":1480}}}],"partialFingerprints":{"codehealthFindingId/v1":"d9242216b4043ae24cf875f5c3ba9a3c7eb8b72c620cac179b5c1a74b0973ff8"}},{"ruleId":"D2","level":"warning","message":{"text":"Controller.enforceDiskQuota (cognitive 25): Controller.enforceDiskQuota has cognitive complexity 25 (threshold 15). Drivers by points: if/else 18, loops 3, match/switch 3, boolean chains 1 (nesting depth added 11). Most of this is not in the body itself: 1 of the 25 points is its own statement and the rest belongs to one function literal inside it that branches (line 1742). 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":"lightning/pkg/importer/import.go"},"region":{"startLine":1734}}}],"partialFingerprints":{"codehealthFindingId/v1":"b46e7e49a568f1809686e09408d88180dc976401d796ec2170fe95244a534f8f"}},{"ruleId":"D2","level":"warning","message":{"text":"bindingOperator.CreateBinding (cognitive 25): bindingOperator.CreateBinding has cognitive complexity 25 (threshold 15). Drivers by points: if/else 21, boolean chains 2, loops 2 (nesting depth added 9). Most of this is not in the body itself: 5 of the 25 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 81, 70). 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":"pkg/bindinfo/binding_operator.go"},"region":{"startLine":64}}}],"partialFingerprints":{"codehealthFindingId/v1":"644b2ca19721fed5250fbfb98dbe0482e474820f9821da5b341cf24b8aed330c"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.GetCharsetAndCollateInTableOption (cognitive 25): ddl.GetCharsetAndCollateInTableOption has cognitive complexity 25 (threshold 15). Drivers by points: if/else 22, match/switch 2, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/executor.go"},"region":{"startLine":1582}}}],"partialFingerprints":{"codehealthFindingId/v1":"cf199b998aa5e6e15f8d85ac934bda03bf363865303dfae75bf146276544d4ff"}},{"ruleId":"D2","level":"warning","message":{"text":"txnBackfillExecutor.adjustWorkerSize (cognitive 25): txnBackfillExecutor.adjustWorkerSize 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":"pkg/ddl/backfilling_txn_executor.go"},"region":{"startLine":255}}}],"partialFingerprints":{"codehealthFindingId/v1":"81e56c760f442e824b06a8208063eaae0a1a0f906c2d7d3d4aed2ebe363cda0a"}},{"ruleId":"D2","level":"warning","message":{"text":"executor.createIndex (cognitive 25): executor.createIndex has cognitive complexity 25 (threshold 15). Drivers by points: if/else 20, boolean chains 4, match/switch 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":"pkg/ddl/executor.go"},"region":{"startLine":5090}}}],"partialFingerprints":{"codehealthFindingId/v1":"649075c48bcd85c7120f9278e873e3e524cc560437cacd34cb4c40cef9331220"}},{"ruleId":"D2","level":"warning","message":{"text":"jobsubmit.GenGIDAndInsertJobsWithRetry (cognitive 25): jobsubmit.GenGIDAndInsertJobsWithRetry has cognitive complexity 25 (threshold 15). Drivers by points: if/else 23, boolean chains 1, loops 1 (nesting depth added 12). Most of this is not in the body itself: 4 of the 25 points are its own statements and the rest belongs to one function literal inside it that branches (line 152). 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":"pkg/ddl/jobsubmit/submit.go"},"region":{"startLine":143}}}],"partialFingerprints":{"codehealthFindingId/v1":"ffd0824defe569422d722d85fbd0b084123dbed606db084c9509faac24c90336"}},{"ruleId":"D2","level":"warning","message":{"text":"distsql.indexRangesToKVWithoutSplit (cognitive 25): distsql.indexRangesToKVWithoutSplit has cognitive complexity 25 (threshold 15). Drivers by points: if/else 19, loops 4, boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/distsql/request_builder.go"},"region":{"startLine":794}}}],"partialFingerprints":{"codehealthFindingId/v1":"e4acc9cf5e2bcb7b45c5f48490cc7f1bf620927c8a81c9ef73d2754ed4ae0356"}},{"ruleId":"D2","level":"warning","message":{"text":"RequestBuilder.Build (cognitive 25): RequestBuilder.Build has cognitive complexity 25 (threshold 15). Drivers by points: if/else 17, boolean chains 4, match/switch 4 (nesting depth added 10). Of this number, 18 points are the body\u0027s own statements and 7 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":"pkg/distsql/request_builder.go"},"region":{"startLine":61}}}],"partialFingerprints":{"codehealthFindingId/v1":"19e73bfca6b5bf43ea94089883f4519556bada2602594f862c5341cb01bb7f7d"}},{"ruleId":"D2","level":"warning","message":{"text":"selectResultIter.Next (cognitive 25): selectResultIter.Next has cognitive complexity 25 (threshold 15). Drivers by points: if/else 18, loops 6, boolean chains 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":"pkg/distsql/select_result.go"},"region":{"startLine":958}}}],"partialFingerprints":{"codehealthFindingId/v1":"3aac1a7c801af88fe81ceecddcd7735992d1fbf4729e9a102183a900d2d20cef"}},{"ruleId":"D2","level":"warning","message":{"text":"executor.loadSetTiFlashReplica (cognitive 25): executor.loadSetTiFlashReplica has cognitive complexity 25 (threshold 15). Drivers by points: if/else 20, loops 4, boolean chains 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":"pkg/executor/plan_replayer.go"},"region":{"startLine":418}}}],"partialFingerprints":{"codehealthFindingId/v1":"77d5e341e451b6b4cd63891ce0ce51f1bb56664ae9bf1fbe9bb6ecf2c95d58d5"}},{"ruleId":"D2","level":"warning","message":{"text":"executor.showCommentsFromJob (cognitive 25): executor.showCommentsFromJob has cognitive complexity 25 (threshold 15). Drivers by points: if/else 20, match/switch 3, boolean chains 2 (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/executor/show_ddl_jobs.go"},"region":{"startLine":302}}}],"partialFingerprints":{"codehealthFindingId/v1":"0dda8cac10d0daa57a894e90d26e7ff850aaa01cc5e001b56c7ea00814a09d5d"}},{"ruleId":"D2","level":"warning","message":{"text":"aggfuncs.evalAndEncode (cognitive 25): aggfuncs.evalAndEncode has cognitive complexity 25 (threshold 15). Drivers by points: if/else 16, boolean chains 8, match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction \u2014 a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full \u2014 so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/aggfuncs/func_count_distinct.go"},"region":{"startLine":622}}}],"partialFingerprints":{"codehealthFindingId/v1":"c35f203500ebf3b64fe7420344c388a5983b7e3742c58a207c491acb8eda782c"}},{"ruleId":"D2","level":"warning","message":{"text":"chunkEncoder.encodeLoop (cognitive 25): chunkEncoder.encodeLoop has cognitive complexity 25 (threshold 15). Drivers by points: if/else 22, loops 2, boolean chains 1 (nesting depth added 8). Of this number, 14 points are the body\u0027s own statements and 11 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/executor/importer/chunk_process.go"},"region":{"startLine":262}}}],"partialFingerprints":{"codehealthFindingId/v1":"128e9595acf0bd1cf0448c5018c88b04177294d1e18bf2ae9043fc43b3967258"}},{"ruleId":"D2","level":"warning","message":{"text":"LimitExec.Next (cognitive 25): LimitExec.Next has cognitive complexity 25 (threshold 15). Drivers by points: if/else 24, 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/executor/select.go"},"region":{"startLine":474}}}],"partialFingerprints":{"codehealthFindingId/v1":"52a14e10c6ae4fc14baf379c9196ca6da96dd6a847d0559aebe80a1eb60733ea"}},{"ruleId":"D2","level":"warning","message":{"text":"ShowExec.fetchShowColumnStatsUsage (cognitive 25): ShowExec.fetchShowColumnStatsUsage has cognitive complexity 25 (threshold 15). Drivers by points: if/else 17, loops 8 (nesting depth added 10). Of this number, 13 points are the body\u0027s own statements and 12 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/show_stats.go"},"region":{"startLine":553}}}],"partialFingerprints":{"codehealthFindingId/v1":"229dff5e95551026980231afce3aea1b5152d13813f73cfb8d1a158582286f49"}},{"ruleId":"D2","level":"warning","message":{"text":"ShuffleExec.fetchDataAndSplit (cognitive 25): ShuffleExec.fetchDataAndSplit has cognitive complexity 25 (threshold 15). Drivers by points: if/else 16, loops 5, match/switch 4 (nesting depth added 12). Of this number, 22 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":"pkg/executor/shuffle.go"},"region":{"startLine":278}}}],"partialFingerprints":{"codehealthFindingId/v1":"37838dc4591e579963c7334d601a207651cffbbcf3e60fd8c2be17f4060a2004"}},{"ruleId":"D2","level":"warning","message":{"text":"UpdateExec.mergeNonGenerated (cognitive 25): UpdateExec.mergeNonGenerated has cognitive complexity 25 (threshold 15). Drivers by points: if/else 21, loops 4 (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":"pkg/executor/update.go"},"region":{"startLine":138}}}],"partialFingerprints":{"codehealthFindingId/v1":"457bd7c371a51a458268ed640bc3d32c80b4033049f4e569730077ebc3a3f242"}},{"ruleId":"D2","level":"warning","message":{"text":"aggregation.NewWindowFuncDesc (cognitive 25): aggregation.NewWindowFuncDesc has cognitive complexity 25 (threshold 15). Drivers by points: if/else 16, boolean chains 6, match/switch 3 (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/expression/aggregation/window_func.go"},"region":{"startLine":33}}}],"partialFingerprints":{"codehealthFindingId/v1":"a1bd40e80d76024228493323dcc0e1ec79af718a9cbde101ece60f14f1374c98"}},{"ruleId":"D2","level":"warning","message":{"text":"expression.evalOneColumn (cognitive 25): expression.evalOneColumn has cognitive complexity 25 (threshold 15). Drivers by points: loops 16, boolean chains 8, match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction \u2014 a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full \u2014 so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/chunk_executor.go"},"region":{"startLine":215}}}],"partialFingerprints":{"codehealthFindingId/v1":"b637102e79eb6012724b2a772f778dca119d999ff7df769fe273e0bba243c371"}},{"ruleId":"D2","level":"warning","message":{"text":"expression.deriveCollation (cognitive 25): expression.deriveCollation has cognitive complexity 25 (threshold 15). Drivers by points: if/else 21, loops 3, match/switch 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/collation.go"},"region":{"startLine":245}}}],"partialFingerprints":{"codehealthFindingId/v1":"7356561297b9e39e9af2b4e96d5ad9c35099643dea87bcbef90c828dae556e2b"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinArithmeticDivideDecimalSig.vecEvalDecimal (cognitive 25): builtinArithmeticDivideDecimalSig.vecEvalDecimal has cognitive complexity 25 (threshold 15). Drivers by points: if/else 24, 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/expression/builtin_arithmetic_vec.go"},"region":{"startLine":67}}}],"partialFingerprints":{"codehealthFindingId/v1":"cb5e77fe6b8a3e33ad5a209d99b199bddd12e940c8f1c6c6c4f26d27511bf9eb"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinCastJSONAsDurationSig.vecEvalDuration (cognitive 25): builtinCastJSONAsDurationSig.vecEvalDuration has cognitive complexity 25 (threshold 15). Drivers by points: if/else 22, match/switch 2, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/builtin_cast_vec.go"},"region":{"startLine":1954}}}],"partialFingerprints":{"codehealthFindingId/v1":"0ed1a6085fbc5b559dd2fd39ff5f627bc8b30239dab38477254ddb84a6cc119a"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinJSONSchemaValidSig.evalInt (cognitive 25): builtinJSONSchemaValidSig.evalInt has cognitive complexity 25 (threshold 15). Drivers by points: if/else 25 (nesting depth added 9). Of this number, 18 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/expression/builtin_json.go"},"region":{"startLine":2068}}}],"partialFingerprints":{"codehealthFindingId/v1":"b04e8ce85b0875ea96dd45c2dfce247f234a63fe884d58bfee8acfab22fd9e56"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinLpadUTF8Sig.vecEvalString (cognitive 25): builtinLpadUTF8Sig.vecEvalString has cognitive complexity 25 (threshold 15). Drivers by points: if/else 21, boolean chains 3, 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":"pkg/expression/builtin_string_vec.go"},"region":{"startLine":1048}}}],"partialFingerprints":{"codehealthFindingId/v1":"944e9420aa80cf63da0b606312123aca031c55b310a5ed8e145e532090bb98a7"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinRpadUTF8Sig.vecEvalString (cognitive 25): builtinRpadUTF8Sig.vecEvalString has cognitive complexity 25 (threshold 15). Drivers by points: if/else 21, boolean chains 3, 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":"pkg/expression/builtin_string_vec.go"},"region":{"startLine":2605}}}],"partialFingerprints":{"codehealthFindingId/v1":"87745671787ab59823f407ff1bccf757b164107be0c75b3c002c6f8f3fad1fe8"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinUnixTimestampIntSig.vecEvalInt (cognitive 25): builtinUnixTimestampIntSig.vecEvalInt has cognitive complexity 25 (threshold 15). Drivers by points: if/else 21, loops 4 (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":"pkg/expression/builtin_time_vec.go"},"region":{"startLine":2320}}}],"partialFingerprints":{"codehealthFindingId/v1":"45c1f56789ed941ea9a48db5f29799b13926474299a940d806376f824281cb23"}},{"ruleId":"D2","level":"warning","message":{"text":"ScalarFunction.GetSingleColumn (cognitive 25): ScalarFunction.GetSingleColumn has cognitive complexity 25 (threshold 15). Drivers by points: match/switch 13, if/else 12 (nesting depth added 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. 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/expression/scalar_function.go"},"region":{"startLine":857}}}],"partialFingerprints":{"codehealthFindingId/v1":"b3928dbdb9630ed961e6941bea121ff0d0958a70135cbb80c4a173b9966bd393"}},{"ruleId":"D2","level":"warning","message":{"text":"infoschema.applyCreateTable (cognitive 25): infoschema.applyCreateTable has cognitive complexity 25 (threshold 15). Drivers by points: if/else 18, loops 5, boolean chains 2 (nesting depth added 6). Of this number, 21 points are the body\u0027s own statements and 4 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":"pkg/infoschema/builder.go"},"region":{"startLine":840}}}],"partialFingerprints":{"codehealthFindingId/v1":"30429c4d32a3446125ac30bc0aead41412f2e3199c9a36a199efb2f497c2bebb"}},{"ruleId":"D2","level":"warning","message":{"text":"Loader.LoadWithTS (cognitive 25): Loader.LoadWithTS has cognitive complexity 25 (threshold 15). Drivers by points: if/else 23, boolean chains 2 (nesting depth added 4). 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: 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":"pkg/infoschema/issyncer/loader.go"},"region":{"startLine":145}}}],"partialFingerprints":{"codehealthFindingId/v1":"56b3b18c498a5e2f0f4b63098d062e3df8cb549239d6f0acf3b57626e03512b3"}},{"ruleId":"D2","level":"warning","message":{"text":"Backend.forceTableSplitRange (cognitive 25): Backend.forceTableSplitRange has cognitive complexity 25 (threshold 15). Drivers by points: if/else 18, loops 4, match/switch 2, boolean chains 1 (nesting depth added 9). Most of this is not in the body itself: 6 of the 25 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 955, 1009, 995). 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":"pkg/ingestor/ingestctrl/local.go"},"region":{"startLine":921}}}],"partialFingerprints":{"codehealthFindingId/v1":"73aefa4b7dc9f9425d5e0c1036f4dac9e8c2943dc90fb3206199e2616f0d6d15"}},{"ruleId":"D2","level":"warning","message":{"text":"simplesst.doRemoveDuplicates (cognitive 25): simplesst.doRemoveDuplicates has cognitive complexity 25 (threshold 15). Drivers by points: if/else 20, loops 4, boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ingestor/simplesst/util.go"},"region":{"startLine":99}}}],"partialFingerprints":{"codehealthFindingId/v1":"513bcfeaa251bae51564c31be3b6265b49fa840ef410b5b6eb210edd02072023"}},{"ruleId":"D2","level":"warning","message":{"text":"objstore.parseBackend (cognitive 25): objstore.parseBackend has cognitive complexity 25 (threshold 15). Drivers by points: if/else 24, match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/objstore/parse.go"},"region":{"startLine":71}}}],"partialFingerprints":{"codehealthFindingId/v1":"70ed7008ae8a067ebdb475253ab8e25a72a514f217a66efb061284ace5a49dab"}},{"ruleId":"D2","level":"warning","message":{"text":"core.preferHashJoin (cognitive 25): core.preferHashJoin has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13, boolean chains 12 (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":"pkg/planner/core/exhaust_physical_plans.go"},"region":{"startLine":1629}}}],"partialFingerprints":{"codehealthFindingId/v1":"e70b0b68397f7c2e9c5f594c158058f5c53104a8996e405b2899c12b998a33ea"}},{"ruleId":"D2","level":"warning","message":{"text":"expressionRewriter.buildSemiApplyFromEqualSubq (cognitive 25): expressionRewriter.buildSemiApplyFromEqualSubq has cognitive complexity 25 (threshold 15). Drivers by points: if/else 19, boolean chains 3, loops 3 (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":"pkg/planner/core/expression_rewriter.go"},"region":{"startLine":776}}}],"partialFingerprints":{"codehealthFindingId/v1":"07bf13162dce47afd3cd2b29a4e8602afd4a7c4a1d65e6b244578d15294c5f92"}},{"ruleId":"D2","level":"warning","message":{"text":"ConflictDetector.CheckConnection (cognitive 25): ConflictDetector.CheckConnection has cognitive complexity 25 (threshold 15). Drivers by points: if/else 16, boolean chains 7, 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":"pkg/planner/core/joinorder/conflict_detector.go"},"region":{"startLine":585}}}],"partialFingerprints":{"codehealthFindingId/v1":"df7eb702cbaa9b0b0e92dd0a551fbc1269987ad4bca0b2e73f5f96645e1445ab"}},{"ruleId":"D2","level":"warning","message":{"text":"joinorder.alignEQConds (cognitive 25): joinorder.alignEQConds has cognitive complexity 25 (threshold 15). Drivers by points: if/else 21, boolean chains 3, 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":"pkg/planner/core/joinorder/conflict_detector.go"},"region":{"startLine":727}}}],"partialFingerprints":{"codehealthFindingId/v1":"bbf7abc963a4a17197bd43b1fc38c89e1ec2619e90554b827f38bb1c81a24be8"}},{"ruleId":"D2","level":"warning","message":{"text":"physicalop.getHashAggs (cognitive 25): physicalop.getHashAggs has cognitive complexity 25 (threshold 15). Drivers by points: if/else 22, boolean chains 2, 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":"pkg/planner/core/operator/physicalop/physical_hash_agg.go"},"region":{"startLine":52}}}],"partialFingerprints":{"codehealthFindingId/v1":"91d67762a5f651b4166de58785c0fb6459b2b24da7c9e36f427a2fc427b6f300"}},{"ruleId":"D2","level":"warning","message":{"text":"PlanBuilder.getInsertColExpr (cognitive 25): PlanBuilder.getInsertColExpr has cognitive complexity 25 (threshold 15). Drivers by points: if/else 21, boolean chains 3, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/planbuilder.go"},"region":{"startLine":4277}}}],"partialFingerprints":{"codehealthFindingId/v1":"b809d92222c61d6ba471ff4ec17f736750dcfeabc56ae0d39f2606842833bb5f"}},{"ruleId":"D2","level":"warning","message":{"text":"rule.discountedHandlePrefixCols (cognitive 25): rule.discountedHandlePrefixCols has cognitive complexity 25 (threshold 15). Drivers by points: if/else 21, 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":"pkg/planner/core/rule/rule_prune_indexes.go"},"region":{"startLine":316}}}],"partialFingerprints":{"codehealthFindingId/v1":"ae7dc6936ccdd12484bc8e4f37a9640183b129347414477920ec461ef4c06f14"}},{"ruleId":"D2","level":"warning","message":{"text":"MaxMinEliminator.eliminateMaxMin (cognitive 25): MaxMinEliminator.eliminateMaxMin has cognitive complexity 25 (threshold 15). Drivers by points: if/else 16, loops 7, boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/rule/rule_max_min_eliminate.go"},"region":{"startLine":215}}}],"partialFingerprints":{"codehealthFindingId/v1":"3416018fb23005b4cff7aa273ec235ff83ff6389236cb18e013676ac77c941e6"}},{"ruleId":"D2","level":"warning","message":{"text":"planner.optimize (cognitive 25): planner.optimize has cognitive complexity 25 (threshold 15). Drivers by points: if/else 21, boolean chains 2, loops 2 (nesting depth added 7). Of this number, 15 points are the body\u0027s own statements and 10 belong to 4 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":"pkg/planner/optimize.go"},"region":{"startLine":716}}}],"partialFingerprints":{"codehealthFindingId/v1":"12448717e29dbd9d3384159d9296578bf21818946f645cdb9fe99921563136ef"}},{"ruleId":"D2","level":"warning","message":{"text":"session.PrepareStmt (cognitive 25): session.PrepareStmt has cognitive complexity 25 (threshold 15). Drivers by points: if/else 25 (nesting depth added 11). 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":"pkg/session/session.go"},"region":{"startLine":3182}}}],"partialFingerprints":{"codehealthFindingId/v1":"5313308fbc093f1da1938127d31718744684393dd1842e23003fb0d848250f79"}},{"ruleId":"D2","level":"warning","message":{"text":"session.recordOnTransactionExecution (cognitive 25): session.recordOnTransactionExecution has cognitive complexity 25 (threshold 15). Drivers by points: if/else 25 (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/session/session.go"},"region":{"startLine":5308}}}],"partialFingerprints":{"codehealthFindingId/v1":"8981c0ba47e84b9e9d6f875f93323c9c10b7a6d7cb5e701292e9c59f4e808dec"}},{"ruleId":"D2","level":"warning","message":{"text":"DynamicPartitionedTableAnalysisJob.ValidateAndPrepare (cognitive 25): DynamicPartitionedTableAnalysisJob.ValidateAndPrepare has cognitive complexity 25 (threshold 15). Drivers by points: if/else 18, loops 6, boolean chains 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":"pkg/statistics/handle/autoanalyze/priorityqueue/dynamic_partitioned_table_analysis_job.go"},"region":{"startLine":161}}}],"partialFingerprints":{"codehealthFindingId/v1":"1b8dd60344ddaf6bf5168aea77da0130321f0c7247b31eb88694aec8aab4f0b7"}},{"ruleId":"D2","level":"warning","message":{"text":"StatsTableRowCache.GetDataAndIndexLength (cognitive 25): StatsTableRowCache.GetDataAndIndexLength has cognitive complexity 25 (threshold 15). Drivers by points: if/else 19, loops 4, boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/statistics/handle/cache/stats_table_row_cache.go"},"region":{"startLine":173}}}],"partialFingerprints":{"codehealthFindingId/v1":"3f1443460cca45872c8b7c85e0997c63004bc03d160dc4f972dd21847270945a"}},{"ruleId":"D2","level":"warning","message":{"text":"storage.DeleteTableStatsFromKV (cognitive 25): storage.DeleteTableStatsFromKV has cognitive complexity 25 (threshold 15). Drivers by points: if/else 24, 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":"pkg/statistics/handle/storage/gc.go"},"region":{"startLine":135}}}],"partialFingerprints":{"codehealthFindingId/v1":"60bb48624666db3eb3a4538530026fb3732a3302c7475a3de6f2914883a50cf0"}},{"ruleId":"D2","level":"warning","message":{"text":"Histogram.SplitRange (cognitive 25): Histogram.SplitRange has cognitive complexity 25 (threshold 15). Drivers by points: if/else 21, loops 4 (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":"pkg/statistics/histogram.go"},"region":{"startLine":830}}}],"partialFingerprints":{"codehealthFindingId/v1":"954573f3407c5f215a7af02c72edfc7b9defe5ea0024cb62b8a10daa00526a37"}},{"ruleId":"D2","level":"warning","message":{"text":"copIteratorWorker.collectCopRuntimeStats (cognitive 25): copIteratorWorker.collectCopRuntimeStats has cognitive complexity 25 (threshold 15). Drivers by points: if/else 24, boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/store/copr/coprocessor.go"},"region":{"startLine":2671}}}],"partialFingerprints":{"codehealthFindingId/v1":"527aeb2cf2c0e00c971610da55fa8cd605cbb01f98b02864a53dd8b11a80f0c2"}},{"ruleId":"D2","level":"warning","message":{"text":"Helper.GetTablesInfoWithKeyRange (cognitive 25): Helper.GetTablesInfoWithKeyRange has cognitive complexity 25 (threshold 15). Drivers by points: loops 14, if/else 10, boolean chains 1 (nesting depth added 14). 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":"pkg/store/helper/helper.go"},"region":{"startLine":744}}}],"partialFingerprints":{"codehealthFindingId/v1":"88858a2e1a2484731831482c1ef6b0b64b363df44923cfa72bde2b2d2f15e2ec"}},{"ruleId":"D2","level":"warning","message":{"text":"indexLookUpExec.next (cognitive 25): indexLookUpExec.next has cognitive complexity 25 (threshold 15). Drivers by points: if/else 19, boolean chains 3, loops 3 (nesting depth added 10). Most of this is not in the body itself: 8 of the 25 points are its own statements and the rest belongs to one function literal inside it that branches (line 484). 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":"pkg/store/mockstore/unistore/cophandler/mpp_exec.go"},"region":{"startLine":468}}}],"partialFingerprints":{"codehealthFindingId/v1":"d089450e261893ae97e68d8d171b73b8231b92e0aa3f7e03be35965db9e51503"}},{"ruleId":"D2","level":"warning","message":{"text":"tables.TableFromMetaWithCollate (cognitive 25): tables.TableFromMetaWithCollate has cognitive complexity 25 (threshold 15). Drivers by points: if/else 24, loops 1 (nesting depth added 12). Of this number, 22 points are the body\u0027s own statements and 3 belong to one function literal inside it that branches. To reduce it, 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/table/tables/tables.go"},"region":{"startLine":173}}}],"partialFingerprints":{"codehealthFindingId/v1":"c786e2dedc6023f3754d1c2c08cdbe300434d828217a097657f23ce00d1a15b5"}},{"ruleId":"D2","level":"warning","message":{"text":"TableCommon.addIndices (cognitive 25): TableCommon.addIndices has cognitive complexity 25 (threshold 15). Drivers by points: if/else 22, boolean chains 2, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/table/tables/tables.go"},"region":{"startLine":998}}}],"partialFingerprints":{"codehealthFindingId/v1":"3340b9be7b9d7f8a9d7f5487adb31359c975d139eb784680dac725f7979d4a33"}},{"ruleId":"D2","level":"warning","message":{"text":"types.jsonMarshalStringTo (cognitive 25): types.jsonMarshalStringTo has cognitive complexity 25 (threshold 15). Drivers by points: if/else 19, match/switch 3, boolean chains 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":"pkg/types/json_binary.go"},"region":{"startLine":420}}}],"partialFingerprints":{"codehealthFindingId/v1":"6ea0dbd22a4405a27469af826c64574b780cfcbc11dc4a39557d5b9aba9603c7"}},{"ruleId":"D2","level":"warning","message":{"text":"types.ContainsBinaryJSON (cognitive 25): types.ContainsBinaryJSON has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15, loops 8, boolean chains 1, match/switch 1 (nesting depth added 15). 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":"pkg/types/json_binary_functions.go"},"region":{"startLine":1095}}}],"partialFingerprints":{"codehealthFindingId/v1":"f80fd50be6874e24add416ed36b54bd231b3406dfbd968867496b9aeeb13b054"}},{"ruleId":"D2","level":"warning","message":{"text":"types.parseJSONPathArray (cognitive 25): types.parseJSONPathArray has cognitive complexity 25 (threshold 15). Drivers by points: if/else 23, boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/types/json_path_expr.go"},"region":{"startLine":442}}}],"partialFingerprints":{"codehealthFindingId/v1":"c332e728ab27e79916ac3711e60efacca7de23dc63c322526c03c34ad19a5c13"}},{"ruleId":"D2","level":"warning","message":{"text":"types.ExtractDurationValue (cognitive 25): types.ExtractDurationValue has cognitive complexity 25 (threshold 15). Drivers by points: if/else 24, match/switch 1 (nesting depth added 12). 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":"pkg/types/time.go"},"region":{"startLine":2558}}}],"partialFingerprints":{"codehealthFindingId/v1":"9cb9c550044b0dd801c9e2a847b6be7c13d2d2c842e83b84f49b571d69181279"}},{"ruleId":"D2","level":"warning","message":{"text":"Datum.convertToMysqlDuration (cognitive 25): Datum.convertToMysqlDuration has cognitive complexity 25 (threshold 15). Drivers by points: if/else 23, boolean chains 1, match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/types/datum.go"},"region":{"startLine":1500}}}],"partialFingerprints":{"codehealthFindingId/v1":"ea37091a7a9488e02813eddc962bdcf1aa972145c020c346a57be357f76703ce"}},{"ruleId":"D2","level":"warning","message":{"text":"util.LoadTLSCertificates (cognitive 25): util.LoadTLSCertificates has cognitive complexity 25 (threshold 15). Drivers by points: if/else 20, match/switch 3, boolean chains 1, loops 1 (nesting depth added 8). Of this number, 22 points are the body\u0027s own statements and 3 belong to one function literal inside it that branches. To reduce it, 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/util/misc.go"},"region":{"startLine":385}}}],"partialFingerprints":{"codehealthFindingId/v1":"b2e3439deaecbd0547de2069532249ae620d2ae76eb525df269fea3194c72182"}},{"ruleId":"D2","level":"warning","message":{"text":"MemArbitrator.tryToUpdateBuffer (cognitive 25): MemArbitrator.tryToUpdateBuffer has cognitive complexity 25 (threshold 15). Drivers by points: if/else 17, boolean chains 5, loops 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/util/memory/arbitrator.go"},"region":{"startLine":1132}}}],"partialFingerprints":{"codehealthFindingId/v1":"f800899b874770aeaa423516d6e568e8231beaaf2e47728d37de8e83a3b76d43"}},{"ruleId":"D2","level":"warning","message":{"text":"main.main (cognitive 25): main.main has cognitive complexity 25 (threshold 15). Drivers by points: if/else 23, boolean chains 2 (nesting depth added 10). 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 37). 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/tazel/main.go"},"region":{"startLine":31}}}],"partialFingerprints":{"codehealthFindingId/v1":"aa821fcedf8e070a92a891d26f3ec45bedca458f04d3a13e64482aca800a8737"}},{"ruleId":"D2","level":"warning","message":{"text":"PartitionDefinitionClauseIn.restore (cognitive 25): PartitionDefinitionClauseIn.restore has cognitive complexity 25 (threshold 15). Drivers by points: if/else 20, loops 4, boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/parser/ast/ddl.go"},"region":{"startLine":4538}}}],"partialFingerprints":{"codehealthFindingId/v1":"844cc58a10f5b2af536479b38381af83278a6c1f41ed833b66e1a61d2abe7730"}},{"ruleId":"D2","level":"warning","message":{"text":"AggregateFuncExpr.Restore (cognitive 25): AggregateFuncExpr.Restore has cognitive complexity 25 (threshold 15). Drivers by points: if/else 20, loops 4, match/switch 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":"pkg/parser/ast/functions.go"},"region":{"startLine":882}}}],"partialFingerprints":{"codehealthFindingId/v1":"85059bc3167e84e6a9cdc019c13ce5271eedf576ccf5d9fb0626763213194b03"}},{"ruleId":"D2","level":"warning","message":{"text":"sqlDigester.reduceLit (cognitive 25): sqlDigester.reduceLit has cognitive complexity 25 (threshold 15). Drivers by points: if/else 19, boolean chains 2, loops 2, match/switch 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/parser/digester.go"},"region":{"startLine":317}}}],"partialFingerprints":{"codehealthFindingId/v1":"553a82143be206d574ab7ed1e414f3eaa509246aa23b01c2f3ef47fa9ba0fdcd"}},{"ruleId":"D2","level":"warning","message":{"text":"EC2Session.WaitSnapshotsCreated (cognitive 24): EC2Session.WaitSnapshotsCreated has cognitive complexity 24 (threshold 15). Drivers by points: if/else 20, loops 4 (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":"br/pkg/aws/ebs.go"},"region":{"startLine":246}}}],"partialFingerprints":{"codehealthFindingId/v1":"cd77dcd79e4b20dc385894879c0f348a9dce8e0b7f1346f4d53c03fa170adc28"}},{"ruleId":"D2","level":"warning","message":{"text":"metautil.DecodeStatsFile (cognitive 24): metautil.DecodeStatsFile has cognitive complexity 24 (threshold 15). Drivers by points: if/else 21, 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":"br/pkg/metautil/debug.go"},"region":{"startLine":39}}}],"partialFingerprints":{"codehealthFindingId/v1":"db45dd7d26eef947a10ff74cf16514cdd08678ab939fccaeda83cc1cb78d9fba"}},{"ruleId":"D2","level":"warning","message":{"text":"constructor.getConstructorList (cognitive 24): constructor.getConstructorList has cognitive complexity 24 (threshold 15). Drivers by points: if/else 22, boolean chains 1, 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":"build/linter/constructor/analyzer.go"},"region":{"startLine":52}}}],"partialFingerprints":{"codehealthFindingId/v1":"0d0ada7adf502f33717cc0ec58939f63d8aea289aeda391220332074ac95df1a"}},{"ruleId":"D2","level":"warning","message":{"text":"Dumper.concurrentDumpTable (cognitive 24): Dumper.concurrentDumpTable has cognitive complexity 24 (threshold 15). Drivers by points: if/else 17, boolean chains 6, loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"dumpling/export/dump.go"},"region":{"startLine":784}}}],"partialFingerprints":{"codehealthFindingId/v1":"82175b65eeefedbab70e4e8da4d1cd7ac17c44c8bf0fca6dec4b7b5eda34962f"}},{"ruleId":"D2","level":"warning","message":{"text":"importer.simplifyTable (cognitive 24): importer.simplifyTable has cognitive complexity 24 (threshold 15). Drivers by points: loops 12, if/else 11, boolean chains 1 (nesting depth added 11). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lightning/pkg/importer/dup_detect.go"},"region":{"startLine":306}}}],"partialFingerprints":{"codehealthFindingId/v1":"610ba22a45a4441811dbb77a25a86585450e7f8ab58ff59f171cd5df7e82263a"}},{"ruleId":"D2","level":"warning","message":{"text":"importer.parseColumnPermutations (cognitive 24): importer.parseColumnPermutations has cognitive complexity 24 (threshold 15). Drivers by points: if/else 19, loops 4, 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":"lightning/pkg/importer/table_import.go"},"region":{"startLine":1266}}}],"partialFingerprints":{"codehealthFindingId/v1":"07acd57870678257572f8570293f32e1b9bcd7bb38f959d15e340595b5530a1f"}},{"ruleId":"D2","level":"warning","message":{"text":"dbTableMetaMgr.CheckAndUpdateLocalChecksum (cognitive 24): dbTableMetaMgr.CheckAndUpdateLocalChecksum has cognitive complexity 24 (threshold 15). Drivers by points: if/else 21, boolean chains 2, loops 1 (nesting depth added 7). Most of this is not in the body itself: 5 of the 24 points are its own statements and the rest belongs to one function literal inside it that branches (line 430). 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":"lightning/pkg/importer/meta_manager.go"},"region":{"startLine":404}}}],"partialFingerprints":{"codehealthFindingId/v1":"ad26d07ad23b5d7603239b533408c7f0d46ae0de5b45d02f2e53f71cce6287e6"}},{"ruleId":"D2","level":"warning","message":{"text":"dbTaskMetaMgr.CheckAndFinishRestore (cognitive 24): dbTaskMetaMgr.CheckAndFinishRestore has cognitive complexity 24 (threshold 15). Drivers by points: if/else 23, loops 1 (nesting depth added 8). Most of this is not in the body itself: 2 of the 24 points are its own statements and the rest belongs to one function literal inside it that branches (line 908). 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":"lightning/pkg/importer/meta_manager.go"},"region":{"startLine":890}}}],"partialFingerprints":{"codehealthFindingId/v1":"e06c5b620b4156b63cc3df22a5790bc078e8b47bc381ec1312b556ac9d2be6f1"}},{"ruleId":"D2","level":"warning","message":{"text":"TableImporter.executeDDL (cognitive 24): TableImporter.executeDDL has cognitive complexity 24 (threshold 15). Drivers by points: if/else 17, match/switch 5, boolean chains 1, 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":"lightning/pkg/importer/table_import.go"},"region":{"startLine":1532}}}],"partialFingerprints":{"codehealthFindingId/v1":"4bbba19139028e6464cb723cd558511725e0346897e2ced6729fb590ea863847"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.BuildAddedPartitionInfo (cognitive 24): ddl.BuildAddedPartitionInfo has cognitive complexity 24 (threshold 15). Drivers by points: if/else 21, match/switch 3 (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":"pkg/ddl/executor.go"},"region":{"startLine":5695}}}],"partialFingerprints":{"codehealthFindingId/v1":"bed3f590e5190df58c3c4ed13bd2e56dae7282f456fe3f36df294ed56019e862"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.noReorgDataStrict (cognitive 24): ddl.noReorgDataStrict has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 9, if/else 8, match/switch 7 (nesting depth added 6). Of this number, 19 points are the body\u0027s own statements and 5 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":"pkg/ddl/modify_column.go"},"region":{"startLine":2043}}}],"partialFingerprints":{"codehealthFindingId/v1":"6e8b726bc1fc10cea0329c9d7d23ad2cfdb215d5dbc16447e50f040e5f8d9afc"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.checkAutoRandom (cognitive 24): ddl.checkAutoRandom has cognitive complexity 24 (threshold 15). Drivers by points: if/else 21, boolean chains 2, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/modify_column.go"},"region":{"startLine":2375}}}],"partialFingerprints":{"codehealthFindingId/v1":"94150ffa8979502944e6b9f773a98e8abf86e101480574f7449dbcd30a83cc30"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.comparePartitionAstAndModel (cognitive 24): ddl.comparePartitionAstAndModel has cognitive complexity 24 (threshold 15). Drivers by points: if/else 19, boolean chains 4, loops 1 (nesting depth added 9). Of this number, 22 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/partition.go"},"region":{"startLine":967}}}],"partialFingerprints":{"codehealthFindingId/v1":"8570dca1b8c38d7f0f20c57a6934b7edba1b65ed66f43929cfd100fceb3ad575"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.checkStorageClassPartitionScope (cognitive 24): ddl.checkStorageClassPartitionScope has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15, loops 7, boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/storage_class.go"},"region":{"startLine":459}}}],"partialFingerprints":{"codehealthFindingId/v1":"b0306b1da0fb418590bb6e1839f469ab903a8e122fb954626fac693034ae9ce6"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.onLockTables (cognitive 24): ddl.onLockTables has cognitive complexity 24 (threshold 15). Drivers by points: if/else 20, loops 2, match/switch 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/table_lock.go"},"region":{"startLine":25}}}],"partialFingerprints":{"codehealthFindingId/v1":"44d80319a149c4f062189dc48f5cabba2287b275d4a898fb6b142c0d06f116bf"}},{"ruleId":"D2","level":"warning","message":{"text":"executor.AlterSchema (cognitive 24): executor.AlterSchema has cognitive complexity 24 (threshold 15). Drivers by points: if/else 21, match/switch 2, 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/ddl/executor.go"},"region":{"startLine":703}}}],"partialFingerprints":{"codehealthFindingId/v1":"ed1c0642a34cf4d978b8607e6badd3744202e78bc1e88a4b9275dc69a8e5f230"}},{"ruleId":"D2","level":"warning","message":{"text":"jobScheduler.processJobDuringUpgrade (cognitive 24): jobScheduler.processJobDuringUpgrade has cognitive complexity 24 (threshold 15). Drivers by points: if/else 21, boolean chains 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":"pkg/ddl/job_scheduler.go"},"region":{"startLine":208}}}],"partialFingerprints":{"codehealthFindingId/v1":"6feec0c0920eaf22afa0e4051a05ce41c0b09b2adcaccd9258376c12c3589df6"}},{"ruleId":"D2","level":"warning","message":{"text":"worker.onCreateMaskingPolicy (cognitive 24): worker.onCreateMaskingPolicy has cognitive complexity 24 (threshold 15). Drivers by points: if/else 22, loops 1, match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/masking_policy.go"},"region":{"startLine":40}}}],"partialFingerprints":{"codehealthFindingId/v1":"eccc99c8056cd63c58d9881aa37abd7c5c4c8d9af879c07dab0109241f3ab298"}},{"ruleId":"D2","level":"warning","message":{"text":"InfoSyncer.ReportMinStartTS (cognitive 24): InfoSyncer.ReportMinStartTS has cognitive complexity 24 (threshold 15). Drivers by points: if/else 17, boolean chains 5, loops 2 (nesting depth added 7). Of this number, 20 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":"pkg/domain/infosync/info.go"},"region":{"startLine":629}}}],"partialFingerprints":{"codehealthFindingId/v1":"f7e10d461f61caea2c9ff3b3865c7ac5760bc3259479c0229f6fde5ac4189a3f"}},{"ruleId":"D2","level":"warning","message":{"text":"executor.ConvertConfigItem2JSON (cognitive 24): executor.ConvertConfigItem2JSON has cognitive complexity 24 (threshold 15). Drivers by points: if/else 19, boolean chains 4, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/set_config.go"},"region":{"startLine":187}}}],"partialFingerprints":{"codehealthFindingId/v1":"a6c5d113709d6c8cd3dcc0a0a77e7c0258aaf53a4db19f97cdb4acfd76a0444f"}},{"ruleId":"D2","level":"warning","message":{"text":"executor.FillOneImportJobInfo (cognitive 24): executor.FillOneImportJobInfo has cognitive complexity 24 (threshold 15). Drivers by points: if/else 22, loops 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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":"pkg/executor/show.go"},"region":{"startLine":2505}}}],"partialFingerprints":{"codehealthFindingId/v1":"1964b027c4b52223604c358f5721613682030b1eb256aca2d28f795b0f1ea2c8"}},{"ruleId":"D2","level":"warning","message":{"text":"executor.getColumnValueFactoryByName (cognitive 24): executor.getColumnValueFactoryByName has cognitive complexity 24 (threshold 15). Drivers by points: if/else 23, match/switch 1 (nesting depth added 12). Most of this is not in the body itself: 1 of the 24 points is its own statement and the rest belongs to 8 function literals inside it that branch (lines 1083, 1188, 1099, \u2026). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals\u0027 work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/slow_query.go"},"region":{"startLine":1080}}}],"partialFingerprints":{"codehealthFindingId/v1":"1f89de408cd44c541670960ec58119dbcd7df5642a3dc25713993c2bdd9367e3"}},{"ruleId":"D2","level":"warning","message":{"text":"CleanupIndexExec.fetchIndex (cognitive 24): CleanupIndexExec.fetchIndex has cognitive complexity 24 (threshold 15). Drivers by points: if/else 21, loops 3 (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":"pkg/executor/admin.go"},"region":{"startLine":695}}}],"partialFingerprints":{"codehealthFindingId/v1":"d85cd88e340a251d7f17901419a5c2540e922a9ad46f02240407a396dbfe5398"}},{"ruleId":"D2","level":"warning","message":{"text":"HashAggExec.fetchChildData (cognitive 24): HashAggExec.fetchChildData has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13, loops 8, match/switch 2, boolean chains 1 (nesting depth added 10). Of this number, 12 points are the body\u0027s own statements and 12 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/aggregate/agg_hash_executor.go"},"region":{"startLine":451}}}],"partialFingerprints":{"codehealthFindingId/v1":"5f5d28605e8d6774d6b3076c40209ba317f3899f0dc7ce1e1288bd546373640a"}},{"ruleId":"D2","level":"warning","message":{"text":"executorBuilder.buildIndexLookUpJoin (cognitive 24): executorBuilder.buildIndexLookUpJoin has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14, loops 9, boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/builder.go"},"region":{"startLine":3507}}}],"partialFingerprints":{"codehealthFindingId/v1":"95609e574dcc5c5a59903b8e516840989d6522bbfe1d2e0a781061194cee50d7"}},{"ruleId":"D2","level":"warning","message":{"text":"cteProducer.nextChunkLimit (cognitive 24): cteProducer.nextChunkLimit has cognitive complexity 24 (threshold 15). Drivers by points: if/else 21, loops 2, 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":"pkg/executor/cte.go"},"region":{"startLine":305}}}],"partialFingerprints":{"codehealthFindingId/v1":"3d918d62b00301f4b8bd511689e442ae8cef6a97335cb375e891a927f964206d"}},{"ruleId":"D2","level":"warning","message":{"text":"indexWorker.fetchHandlesRolling (cognitive 24): indexWorker.fetchHandlesRolling has cognitive complexity 24 (threshold 15). Drivers by points: if/else 20, loops 3, boolean chains 1 (nesting depth added 8). Of this number, 17 points are the body\u0027s own statements and 7 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":"pkg/executor/distsql.go"},"region":{"startLine":1476}}}],"partialFingerprints":{"codehealthFindingId/v1":"9c0a61a20f92aa5e709085fc14711db8f3a23e28dcd420d901c8df684076a14b"}},{"ruleId":"D2","level":"warning","message":{"text":"intersectionCollectWorker.doIntersectionLimitAndDispatch (cognitive 24): intersectionCollectWorker.doIntersectionLimitAndDispatch has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14, match/switch 9, 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":"pkg/executor/index_merge_reader.go"},"region":{"startLine":1360}}}],"partialFingerprints":{"codehealthFindingId/v1":"c4f9f1bded8f2f73d6b9eadf9088f7f4a04164b4834dcb2e8e7b54ff68bd783a"}},{"ruleId":"D2","level":"warning","message":{"text":"InsertValues.fillColValue (cognitive 24): InsertValues.fillColValue has cognitive complexity 24 (threshold 15). Drivers by points: if/else 22, boolean chains 2 (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/executor/insert_common.go"},"region":{"startLine":643}}}],"partialFingerprints":{"codehealthFindingId/v1":"cad4f6caf3133befb791d86b3f9903b26bd2a95f9afb9dcd7618af3120de67e2"}},{"ruleId":"D2","level":"warning","message":{"text":"InsertValues.adjustAutoRandomDatum (cognitive 24): InsertValues.adjustAutoRandomDatum has cognitive complexity 24 (threshold 15). Drivers by points: if/else 23, 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":"pkg/executor/insert_common.go"},"region":{"startLine":1043}}}],"partialFingerprints":{"codehealthFindingId/v1":"0f1696859fe67837cc0a6916781d0e25d7a1811859033b88f43a3ed69f8dd6f0"}},{"ruleId":"D2","level":"warning","message":{"text":"memRowsIterForTable.Next (cognitive 24): memRowsIterForTable.Next 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":"pkg/executor/mem_reader.go"},"region":{"startLine":913}}}],"partialFingerprints":{"codehealthFindingId/v1":"3d69f0dcd79f1be71f87b1f71030a8b76cc45ae84a350a0f1ed4cf531929934e"}},{"ruleId":"D2","level":"warning","message":{"text":"hotRegionsHistoryRetriver.retrieve (cognitive 24): hotRegionsHistoryRetriver.retrieve has cognitive complexity 24 (threshold 15). Drivers by points: if/else 18, boolean chains 3, loops 3 (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/executor/memtable_reader.go"},"region":{"startLine":786}}}],"partialFingerprints":{"codehealthFindingId/v1":"08db189adc62f2811583071e6cfcff2e8d8037b7dc64c69d5b5bf96d30a817bc"}},{"ruleId":"D2","level":"warning","message":{"text":"ReplaceExec.replaceRow (cognitive 24): ReplaceExec.replaceRow has cognitive complexity 24 (threshold 15). Drivers by points: if/else 23, 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/executor/replace.go"},"region":{"startLine":66}}}],"partialFingerprints":{"codehealthFindingId/v1":"fdaa5ea94b338b463e03c03937de79231d1fbee17c7c8b7c72c928c282fcf732"}},{"ruleId":"D2","level":"warning","message":{"text":"ShowExec.fetchShowTables (cognitive 24): ShowExec.fetchShowTables has cognitive complexity 24 (threshold 15). Drivers by points: if/else 18, boolean chains 4, loops 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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":"pkg/executor/show.go"},"region":{"startLine":573}}}],"partialFingerprints":{"codehealthFindingId/v1":"58f5a445f56dbcae65bcfed78c6c150a9bdbae6cb35d7ba52303babe462b852d"}},{"ruleId":"D2","level":"warning","message":{"text":"regionKeyDecoder.decodeRegionKey (cognitive 24): regionKeyDecoder.decodeRegionKey has cognitive complexity 24 (threshold 15). Drivers by points: if/else 21, boolean chains 3 (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/executor/split.go"},"region":{"startLine":567}}}],"partialFingerprints":{"codehealthFindingId/v1":"de39cd6e11d8ff6c67f8b0f2a6a2d3f57bec25d109192fa97a6a1d30e6f3009f"}},{"ruleId":"D2","level":"warning","message":{"text":"expression.InferType4ControlFuncs (cognitive 24): expression.InferType4ControlFuncs has cognitive complexity 24 (threshold 15). Drivers by points: if/else 19, match/switch 3, boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/builtin_control.go"},"region":{"startLine":242}}}],"partialFingerprints":{"codehealthFindingId/v1":"f3739326bb04bb7d279fd525218d2db07adcf3dda7c94790e1af90cb8ab51973"}},{"ruleId":"D2","level":"warning","message":{"text":"expression.pushNotAcrossExpr (cognitive 24): expression.pushNotAcrossExpr has cognitive complexity 24 (threshold 15). Drivers by points: if/else 21, match/switch 2, 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":"pkg/expression/util.go"},"region":{"startLine":1078}}}],"partialFingerprints":{"codehealthFindingId/v1":"2795f93befd2997717c0d9c56725c77ce0daebeb987f4e26e57ee6f56241651d"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinCastIntAsJSONSig.vecEvalJSON (cognitive 24): builtinCastIntAsJSONSig.vecEvalJSON has cognitive complexity 24 (threshold 15). Drivers by points: if/else 17, loops 6, 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":"pkg/expression/builtin_cast_vec.go"},"region":{"startLine":1132}}}],"partialFingerprints":{"codehealthFindingId/v1":"40ea36fffba89f13bdb40ba51bf963234078cc6c3e7983090d5b0bbea28878d2"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinCastStringAsIntSig.vecEvalInt (cognitive 24): builtinCastStringAsIntSig.vecEvalInt has cognitive complexity 24 (threshold 15). Drivers by points: if/else 18, boolean chains 5, 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":"pkg/expression/builtin_cast_vec.go"},"region":{"startLine":944}}}],"partialFingerprints":{"codehealthFindingId/v1":"c5675bfacf40c6b3dde420c4eb4d72ef310ab27f4f720e0509196146ca2375c6"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinAesDecryptIVSig.vecEvalString (cognitive 24): builtinAesDecryptIVSig.vecEvalString has cognitive complexity 24 (threshold 15). Drivers by points: if/else 21, boolean chains 1, loops 1, match/switch 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":"pkg/expression/builtin_encryption_vec.go"},"region":{"startLine":292}}}],"partialFingerprints":{"codehealthFindingId/v1":"da54480266f138399c5960f0f015a8bc998e42fb34b9cd42b0735bb3366af32e"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinAesEncryptIVSig.vecEvalString (cognitive 24): builtinAesEncryptIVSig.vecEvalString has cognitive complexity 24 (threshold 15). Drivers by points: if/else 21, boolean chains 1, loops 1, match/switch 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":"pkg/expression/builtin_encryption_vec.go"},"region":{"startLine":119}}}],"partialFingerprints":{"codehealthFindingId/v1":"ee57b7f4808c1f255e548be8dcbf106768f50ccb24487d86cee07b70afd54624"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinJSONRemoveSig.vecEvalJSON (cognitive 24): builtinJSONRemoveSig.vecEvalJSON has cognitive complexity 24 (threshold 15). Drivers by points: if/else 20, loops 4 (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/expression/builtin_json_vec.go"},"region":{"startLine":1044}}}],"partialFingerprints":{"codehealthFindingId/v1":"e4690b15ee2ca7448697cf328a14075f8b8216e55379f84bb54cec8353bf80de"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinLpadSig.vecEvalString (cognitive 24): builtinLpadSig.vecEvalString has cognitive complexity 24 (threshold 15). Drivers by points: if/else 21, boolean chains 2, 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":"pkg/expression/builtin_string_vec.go"},"region":{"startLine":972}}}],"partialFingerprints":{"codehealthFindingId/v1":"334520cde1814fa3b63ab69923853b0cd9b3015fc85e7659c924a4e5eb98b4a4"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinRpadSig.vecEvalString (cognitive 24): builtinRpadSig.vecEvalString has cognitive complexity 24 (threshold 15). Drivers by points: if/else 21, boolean chains 2, 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":"pkg/expression/builtin_string_vec.go"},"region":{"startLine":1459}}}],"partialFingerprints":{"codehealthFindingId/v1":"ba7388aba316be56a3b2a4a127dc0a3016242bae6ba43fb8515a7adcac6da73b"}},{"ruleId":"D2","level":"warning","message":{"text":"extractFunctionClass.getFunction (cognitive 24): extractFunctionClass.getFunction has cognitive complexity 24 (threshold 15). Drivers by points: if/else 22, 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":"pkg/expression/builtin_time.go"},"region":{"startLine":2761}}}],"partialFingerprints":{"codehealthFindingId/v1":"c265ee0c2ca17a920338483a8a752088a00d60421ba2feb351da423d42fa4fac"}},{"ruleId":"D2","level":"warning","message":{"text":"propOuterJoinConstSolver.pickEQCondsOnOuterCol (cognitive 24): propOuterJoinConstSolver.pickEQCondsOnOuterCol has cognitive complexity 24 (threshold 15). Drivers by points: if/else 23, 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":"pkg/expression/constant_propagation.go"},"region":{"startLine":728}}}],"partialFingerprints":{"codehealthFindingId/v1":"da29fb884e34fc49dc4e27b31d41bef7d80be66356cb65b9c7231e812ea3b3f1"}},{"ruleId":"D2","level":"warning","message":{"text":"extension.newManifestWithSetup (cognitive 24): extension.newManifestWithSetup has cognitive complexity 24 (threshold 15). Drivers by points: if/else 20, loops 4 (nesting depth added 8). Most of this is not in the body itself: 11 of the 24 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 184, 148, 140, \u2026). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals\u0027 work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/extension/manifest.go"},"region":{"startLine":138}}}],"partialFingerprints":{"codehealthFindingId/v1":"4e820147936b80e399b2ba75bc22304fada38bc10a490380993ce72278c49795"}},{"ruleId":"D2","level":"warning","message":{"text":"Loader.tryLoadSchemaDiffs (cognitive 24): Loader.tryLoadSchemaDiffs has cognitive complexity 24 (threshold 15). Drivers by points: if/else 19, loops 4, match/switch 1 (nesting depth added 10). Of this number, 17 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/infoschema/issyncer/loader.go"},"region":{"startLine":325}}}],"partialFingerprints":{"codehealthFindingId/v1":"eb74f7aef52b7913d7fb2bb6e3d08d5798627bec6de0e463b4f934b391822032"}},{"ruleId":"D2","level":"warning","message":{"text":"Backend.doIngest (cognitive 24): Backend.doIngest has cognitive complexity 24 (threshold 15). Drivers by points: if/else 19, boolean chains 2, match/switch 2, loops 1 (nesting depth added 8). Of this number, 22 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ingestor/ingestctrl/region_job.go"},"region":{"startLine":695}}}],"partialFingerprints":{"codehealthFindingId/v1":"e0fa8ecf5239fba46b575699d9562321d49d9bc7b3feddf4248ca20c537ca6fa"}},{"ruleId":"D2","level":"warning","message":{"text":"TableInfo.MoveColumnInfo (cognitive 24): TableInfo.MoveColumnInfo has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14, loops 10 (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/meta/model/table.go"},"region":{"startLine":434}}}],"partialFingerprints":{"codehealthFindingId/v1":"4902b0e62e2f781c48ea9cfb4bb16f19216ae6edaff77f5a3d2217cda259fdd8"}},{"ruleId":"D2","level":"warning","message":{"text":"MemStorage.WalkDir (cognitive 24): MemStorage.WalkDir has cognitive complexity 24 (threshold 15). Drivers by points: if/else 20, loops 2, match/switch 2 (nesting depth added 14). Most of this is not in the body itself: 7 of the 24 points are its own statements and the rest belongs to one function literal inside it that branches (line 186). 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":"pkg/objstore/memstore.go"},"region":{"startLine":185}}}],"partialFingerprints":{"codehealthFindingId/v1":"b1892463204218b3dc50c86da4b651269a86825e50ca7df9fe675b53e276ff00"}},{"ruleId":"D2","level":"warning","message":{"text":"core.convertToPointGet (cognitive 24): core.convertToPointGet has cognitive complexity 24 (threshold 15). Drivers by points: if/else 18, boolean chains 4, 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":"pkg/planner/core/find_best_task.go"},"region":{"startLine":2994}}}],"partialFingerprints":{"codehealthFindingId/v1":"e994a4ed8830a57c3e64001181cc5b14ea8fd1fc887a79d0d5d00e8d45b271d4"}},{"ruleId":"D2","level":"warning","message":{"text":"core.GenHintsFromFlatPlan (cognitive 24): core.GenHintsFromFlatPlan has cognitive complexity 24 (threshold 15). Drivers by points: if/else 17, loops 4, boolean chains 2, match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/hint_utils.go"},"region":{"startLine":28}}}],"partialFingerprints":{"codehealthFindingId/v1":"c0ebe5d6b87a0b6ef3d02d7ef89026502f66756aec69a71c8ee1f2889febc888"}},{"ruleId":"D2","level":"warning","message":{"text":"core.generateIndexMergePath (cognitive 24): core.generateIndexMergePath has cognitive complexity 24 (threshold 15). Drivers by points: if/else 18, boolean chains 4, loops 2 (nesting depth added 6). Of this number, 22 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/indexmerge_path.go"},"region":{"startLine":47}}}],"partialFingerprints":{"codehealthFindingId/v1":"9f86dc8993032fc2fcec0a3ee6444bc60fd93f89c16bd39e9d9011b6d2c25f48"}},{"ruleId":"D2","level":"warning","message":{"text":"core.CollectFilters4MVIndexMutations (cognitive 24): core.CollectFilters4MVIndexMutations has cognitive complexity 24 (threshold 15). Drivers by points: if/else 19, loops 4, 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":"pkg/planner/core/indexmerge_path.go"},"region":{"startLine":1111}}}],"partialFingerprints":{"codehealthFindingId/v1":"6fb0d4c8a96efe9a8331001dc8b77b7147a9994b5e6c420dcf251cc2ae4203ec"}},{"ruleId":"D2","level":"warning","message":{"text":"core.planCachePreprocess (cognitive 24): core.planCachePreprocess has cognitive complexity 24 (threshold 15). Drivers by points: if/else 20, 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":"pkg/planner/core/plan_cache.go"},"region":{"startLine":107}}}],"partialFingerprints":{"codehealthFindingId/v1":"1d9254ddd46755dc4cd8b148fee16a36d45b0d7baef0c04a7f6a4897ffa34548"}},{"ruleId":"D2","level":"warning","message":{"text":"core.checkTableCacheable (cognitive 24): core.checkTableCacheable has cognitive complexity 24 (threshold 15). Drivers by points: if/else 20, boolean chains 2, loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/plan_cacheable_checker.go"},"region":{"startLine":672}}}],"partialFingerprints":{"codehealthFindingId/v1":"a8cce28a333c327f12b5da253483092c64bb10c69f48547d5fd5434fbbbb278d"}},{"ruleId":"D2","level":"warning","message":{"text":"Explain.prepareSchema (cognitive 24): Explain.prepareSchema has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12, boolean chains 10, loops 1, match/switch 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":"pkg/planner/core/common_plans.go"},"region":{"startLine":689}}}],"partialFingerprints":{"codehealthFindingId/v1":"1fd645fdd824002501f2563275a31295ed6bb8f4d6818c7e4e7e33ee0f040a70"}},{"ruleId":"D2","level":"warning","message":{"text":"expressionRewriter.patternLikeOrIlikeToExpression (cognitive 24): expressionRewriter.patternLikeOrIlikeToExpression has cognitive complexity 24 (threshold 15). Drivers by points: if/else 21, boolean chains 3 (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/planner/core/expression_rewriter.go"},"region":{"startLine":2375}}}],"partialFingerprints":{"codehealthFindingId/v1":"692f08a17a5f2a31a566ddf13c5493957527aad3a43fcf673eaa1a959bd955de"}},{"ruleId":"D2","level":"warning","message":{"text":"joinorder.alignNotNullWithSchema (cognitive 24): joinorder.alignNotNullWithSchema has cognitive complexity 24 (threshold 15). Drivers by points: if/else 17, loops 5, boolean chains 1, match/switch 1 (nesting depth added 11). Of this number, 20 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":"pkg/planner/core/joinorder/conflict_detector.go"},"region":{"startLine":821}}}],"partialFingerprints":{"codehealthFindingId/v1":"ad60d05446f8163903647583a7194a035cf5442828b41b663f5c1893cb359ea1"}},{"ruleId":"D2","level":"warning","message":{"text":"physicalop.getPhysTopN (cognitive 24): physicalop.getPhysTopN has cognitive complexity 24 (threshold 15). Drivers by points: if/else 19, 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":"pkg/planner/core/operator/physicalop/physical_topn.go"},"region":{"startLine":272}}}],"partialFingerprints":{"codehealthFindingId/v1":"dd97e9266b77f9ffd345e4d890d6e9f58a0e0a1566db698c51abeb91a4910663"}},{"ruleId":"D2","level":"warning","message":{"text":"mppTaskGenerator.constructMPPTasksImpl (cognitive 24): mppTaskGenerator.constructMPPTasksImpl has cognitive complexity 24 (threshold 15). Drivers by points: if/else 19, loops 5 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/operator/physicalop/fragment.go"},"region":{"startLine":659}}}],"partialFingerprints":{"codehealthFindingId/v1":"c0ce4e034b0c56babf3819205077daab06cd538fa1f06e8b06899f8aad84778a"}},{"ruleId":"D2","level":"warning","message":{"text":"Insert.BuildOnInsertFKTriggers (cognitive 24): Insert.BuildOnInsertFKTriggers has cognitive complexity 24 (threshold 15). Drivers by points: if/else 22, boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/operator/physicalop/foreign_key.go"},"region":{"startLine":165}}}],"partialFingerprints":{"codehealthFindingId/v1":"e3aa5729f39feda88fb6f6e908172f5217f55f4fe24f2b2f461e3b48ecd59198"}},{"ruleId":"D2","level":"warning","message":{"text":"PhysicalIndexScan.AddSelectionConditionForGlobalIndex (cognitive 24): PhysicalIndexScan.AddSelectionConditionForGlobalIndex has cognitive complexity 24 (threshold 15). Drivers by points: if/else 16, loops 7, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/operator/physicalop/physical_index_scan.go"},"region":{"startLine":451}}}],"partialFingerprints":{"codehealthFindingId/v1":"1fa0820ad5e7aa6e0b97dee6227d483efc6fffd7cb8539b3899623292137c785"}},{"ruleId":"D2","level":"warning","message":{"text":"PhysicalTableReader.AccessObject (cognitive 24): PhysicalTableReader.AccessObject has cognitive complexity 24 (threshold 15). Drivers by points: if/else 20, boolean chains 3, 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":"pkg/planner/core/operator/physicalop/physical_table_reader.go"},"region":{"startLine":168}}}],"partialFingerprints":{"codehealthFindingId/v1":"019f09fc9bc018dd6ee5991f108401091b4248e9a13d94b90d8e0b38f2d00341"}},{"ruleId":"D2","level":"warning","message":{"text":"PhysicalTableReader.adjustReadReqType (cognitive 24): PhysicalTableReader.adjustReadReqType has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9, match/switch 8, loops 7 (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":"pkg/planner/core/operator/physicalop/physical_table_reader.go"},"region":{"startLine":299}}}],"partialFingerprints":{"codehealthFindingId/v1":"ddbf16b4513254537b4a46ebf90620060eea511d7a56cf1f7136a94e3bb169eb"}},{"ruleId":"D2","level":"warning","message":{"text":"indexadvisor.prepareRecommendation (cognitive 24): indexadvisor.prepareRecommendation 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":"pkg/planner/indexadvisor/indexadvisor.go"},"region":{"startLine":211}}}],"partialFingerprints":{"codehealthFindingId/v1":"c7068ae80b580da8268d5b3db74faf4a9d46eb9bf436df11ad0ccff5eaaead3b"}},{"ruleId":"D2","level":"warning","message":{"text":"planner.getPlanFromNonPreparedPlanCache (cognitive 24): planner.getPlanFromNonPreparedPlanCache has cognitive complexity 24 (threshold 15). Drivers by points: if/else 18, boolean chains 6 (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":"pkg/planner/optimize.go"},"region":{"startLine":68}}}],"partialFingerprints":{"codehealthFindingId/v1":"dceb5f21829fa529a493cbdebd64364831367240ec870db4b6995029d59d9d8e"}},{"ruleId":"D2","level":"warning","message":{"text":"plugin.Init (cognitive 24): plugin.Init has cognitive complexity 24 (threshold 15). Drivers by points: if/else 20, loops 3, boolean chains 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":"pkg/plugin/plugin.go"},"region":{"startLine":203}}}],"partialFingerprints":{"codehealthFindingId/v1":"4738c6687590515697e997e4ef53cac1526f2e11e5c26b814d7cecf2cca90cb8"}},{"ruleId":"D2","level":"warning","message":{"text":"clientConn.HandleStmtPrepare (cognitive 24): clientConn.HandleStmtPrepare has cognitive complexity 24 (threshold 15). Drivers by points: if/else 20, loops 4 (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":"pkg/server/conn_stmt.go"},"region":{"startLine":73}}}],"partialFingerprints":{"codehealthFindingId/v1":"d2112bd0b85344c7fd200c62b663c5a2658cda259f0cbce2052187edbbef734b"}},{"ruleId":"D2","level":"warning","message":{"text":"Server.onConn (cognitive 24): Server.onConn has cognitive complexity 24 (threshold 15). Drivers by points: if/else 21, match/switch 2, boolean chains 1 (nesting depth added 7). Of this number, 17 points are the body\u0027s own statements and 7 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":"pkg/server/server.go"},"region":{"startLine":766}}}],"partialFingerprints":{"codehealthFindingId/v1":"9479177ae9ac6961c61dd9b159befe066e7bfb0e5feebca0892d6ddf8bbb79c8"}},{"ruleId":"D2","level":"warning","message":{"text":"session.checkConstraint (cognitive 24): session.checkConstraint has cognitive complexity 24 (threshold 15). Drivers by points: if/else 20, boolean chains 3, match/switch 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":"pkg/session/nontransactional.go"},"region":{"startLine":191}}}],"partialFingerprints":{"codehealthFindingId/v1":"8ebbf17d69310f9f1269f653bacaa8bf218b07a60357b65164e6dd34e1cd4f6c"}},{"ruleId":"D2","level":"warning","message":{"text":"storage.UpdateStatsMeta (cognitive 24): storage.UpdateStatsMeta has cognitive complexity 24 (threshold 15). Drivers by points: if/else 23, 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":"pkg/statistics/handle/storage/update.go"},"region":{"startLine":67}}}],"partialFingerprints":{"codehealthFindingId/v1":"81ef888097b423917a96e312fa61c8543b389c8266a4c04b515a354f6ca3ae05"}},{"ruleId":"D2","level":"warning","message":{"text":"closureExecutor.indexScanProcessCore (cognitive 24): closureExecutor.indexScanProcessCore has cognitive complexity 24 (threshold 15). Drivers by points: if/else 17, loops 5, 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":"pkg/store/mockstore/unistore/cophandler/closure_exec.go"},"region":{"startLine":894}}}],"partialFingerprints":{"codehealthFindingId/v1":"8cb42b06186f070135dfa71feb20aa83b3a5d4c60d5e551a3d8df30c98bcffc0"}},{"ruleId":"D2","level":"warning","message":{"text":"tablecodec.GenIndexValueForClusteredIndexVersion1 (cognitive 24): tablecodec.GenIndexValueForClusteredIndexVersion1 has cognitive complexity 24 (threshold 15). Drivers by points: if/else 21, loops 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":"pkg/tablecodec/tablecodec.go"},"region":{"startLine":1673}}}],"partialFingerprints":{"codehealthFindingId/v1":"809d11e22c30ef382530022ce04b1820b6339e663c5a1f68806d3ff7fb4796e6"}},{"ruleId":"D2","level":"warning","message":{"text":"tablestore.buildUpdateCriteria (cognitive 24): tablestore.buildUpdateCriteria has cognitive complexity 24 (threshold 15). Drivers by points: if/else 24 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/timer/tablestore/sql.go"},"region":{"startLine":365}}}],"partialFingerprints":{"codehealthFindingId/v1":"e5bcf11bf04bc3597daeca6a3215331055d3a8ca3e033083e8b130cb5dd467a8"}},{"ruleId":"D2","level":"warning","message":{"text":"etcdNotifier.notifyLoop (cognitive 24): etcdNotifier.notifyLoop has cognitive complexity 24 (threshold 15). Drivers by points: if/else 16, match/switch 6, jumps 1, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/timer/tablestore/notifier.go"},"region":{"startLine":224}}}],"partialFingerprints":{"codehealthFindingId/v1":"9b1928e8809b712fee001135e444834354b2ffa6df100b21d5e813be9c485d1f"}},{"ruleId":"D2","level":"warning","message":{"text":"etcdClient.waitCmdResponse (cognitive 24): etcdClient.waitCmdResponse has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15, loops 4, jumps 3, match/switch 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ttl/client/command.go"},"region":{"startLine":160}}}],"partialFingerprints":{"codehealthFindingId/v1":"eba1341a6290b0d99ebbb84f820c62766a5ae0de54290b60db80d7abbe27e562"}},{"ruleId":"D2","level":"warning","message":{"text":"TTLTimersSyncer.syncOneTimer (cognitive 24): TTLTimersSyncer.syncOneTimer has cognitive complexity 24 (threshold 15). Drivers by points: if/else 22, boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ttl/ttlworker/timer_sync.go"},"region":{"startLine":280}}}],"partialFingerprints":{"codehealthFindingId/v1":"3e1de589b0f8c133e712b3f7a4ffde4a75be9e1c765c4c00f6da98c76dd3802d"}},{"ruleId":"D2","level":"warning","message":{"text":"types.datumsToString (cognitive 24): types.datumsToString has cognitive complexity 24 (threshold 15). Drivers by points: if/else 19, match/switch 3, boolean chains 1, 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/types/datum.go"},"region":{"startLine":2451}}}],"partialFingerprints":{"codehealthFindingId/v1":"de9ac84f93c8cb31dc8e77d8dc36e892b5a53c82f1dd1ba659a9bc53079cc554"}},{"ruleId":"D2","level":"warning","message":{"text":"Time.convertDateFormat (cognitive 24): Time.convertDateFormat has cognitive complexity 24 (threshold 15). Drivers by points: if/else 19, match/switch 3, boolean chains 2 (nesting depth added 8). The drivers above price the dispatch low by construction \u2014 a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full \u2014 so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/types/time.go"},"region":{"startLine":2790}}}],"partialFingerprints":{"codehealthFindingId/v1":"6414af8be454fa0b7811f5bf876b9ad0118330ce36561d2fe3fe3d0fab78eec5"}},{"ruleId":"D2","level":"warning","message":{"text":"Column.resize (cognitive 24): Column.resize has cognitive complexity 24 (threshold 15). Drivers by points: if/else 19, loops 4, 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":"pkg/util/chunk/column.go"},"region":{"startLine":440}}}],"partialFingerprints":{"codehealthFindingId/v1":"cddc0cae0d1f25e59956d2303e0df34845edc5efbf66b9c23893cec348cdd8b2"}},{"ruleId":"D2","level":"warning","message":{"text":"extsort.buildCompactions (cognitive 24): extsort.buildCompactions has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15, loops 6, 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/util/extsort/disk_sorter.go"},"region":{"startLine":1151}}}],"partialFingerprints":{"codehealthFindingId/v1":"691cb875beac9e9c0360bfbcc59e3da063406560591d7cdc7bf5bf01f4e98dc1"}},{"ruleId":"D2","level":"warning","message":{"text":"consistency.DecodeIndexMvccData (cognitive 24): consistency.DecodeIndexMvccData has cognitive complexity 24 (threshold 15). Drivers by points: if/else 20, loops 4 (nesting depth added 15). Most of this is not in the body itself: 0 of the 24 points are its own statements and the rest belongs to one function literal inside it that branches (line 145). 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":"pkg/util/logutil/consistency/reporter.go"},"region":{"startLine":144}}}],"partialFingerprints":{"codehealthFindingId/v1":"306c9d6d72ffb3f7df3820dc5d8912e598713519e59de87a70348e99276fb5e6"}},{"ruleId":"D2","level":"warning","message":{"text":"topLevelJSONTokenIter.next (cognitive 24): topLevelJSONTokenIter.next has cognitive complexity 24 (threshold 15). Drivers by points: if/else 19, match/switch 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":"pkg/util/partialjson/extract.go"},"region":{"startLine":73}}}],"partialFingerprints":{"codehealthFindingId/v1":"522c3f3cc66bc6a8efb8445e75ad681ddd0fd47a88dafe58ad81adb926ac77c4"}},{"ruleId":"D2","level":"warning","message":{"text":"DatumMapDecoder.decodeColDatum (cognitive 24): DatumMapDecoder.decodeColDatum has cognitive complexity 24 (threshold 15). Drivers by points: if/else 22, boolean chains 1, match/switch 1 (nesting depth added 11). 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":"pkg/util/rowcodec/decoder.go"},"region":{"startLine":102}}}],"partialFingerprints":{"codehealthFindingId/v1":"3e112fe252a0f3b9973d21a84d961ccf0885b7139e4f602f916aebece6115451"}},{"ruleId":"D2","level":"warning","message":{"text":"DumpTriggerConfig.Compile (cognitive 24): DumpTriggerConfig.Compile has cognitive complexity 24 (threshold 15). Drivers by points: if/else 19, loops 4, match/switch 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":"pkg/util/traceevent/flightrecorder.go"},"region":{"startLine":195}}}],"partialFingerprints":{"codehealthFindingId/v1":"9ebad0d0df9d366ca7abc384c732447d5d3b641567e7d8c5e59c2456b7697dfb"}},{"ruleId":"D2","level":"warning","message":{"text":"PartitionDefinitionClauseIn.Validate (cognitive 24): PartitionDefinitionClauseIn.Validate has cognitive complexity 24 (threshold 15). Drivers by points: if/else 17, boolean chains 4, match/switch 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/parser/ast/ddl.go"},"region":{"startLine":4591}}}],"partialFingerprints":{"codehealthFindingId/v1":"7691a49309321aaccc9ee166605d25970f0b29de9ebaf3edafef76dd4848aed1"}},{"ruleId":"D2","level":"warning","message":{"text":"SetOprSelectList.Restore (cognitive 24): SetOprSelectList.Restore has cognitive complexity 24 (threshold 15). Drivers by points: if/else 21, match/switch 2, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/parser/ast/dml.go"},"region":{"startLine":1689}}}],"partialFingerprints":{"codehealthFindingId/v1":"684daa8d05f994906b0089254ac38c2afa170e876dd2f7b6fcdf01fbf1cd75f9"}},{"ruleId":"D2","level":"warning","message":{"text":"RecommendIndexStmt.Restore (cognitive 24): RecommendIndexStmt.Restore has cognitive complexity 24 (threshold 15). Drivers by points: if/else 18, loops 5, match/switch 1 (nesting depth added 15). 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":"pkg/parser/ast/misc.go"},"region":{"startLine":2233}}}],"partialFingerprints":{"codehealthFindingId/v1":"455d3d1b554306ddb399719eb4f6b764c875630c5b6f78320ad2220d87c77545"}},{"ruleId":"D2","level":"warning","message":{"text":"sqlDigester.reduceOptimizerHint (cognitive 24): sqlDigester.reduceOptimizerHint has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15, loops 4, match/switch 3, boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/parser/digester.go"},"region":{"startLine":281}}}],"partialFingerprints":{"codehealthFindingId/v1":"c5d64d021f51d917df1a8bc757e06ffb84a7362ca030734810c3baeef87db4d8"}},{"ruleId":"D2","level":"warning","message":{"text":"restore.AssertUserDBsEmpty (cognitive 23): restore.AssertUserDBsEmpty has cognitive complexity 23 (threshold 15). Drivers by points: if/else 18, loops 3, jumps 2 (nesting depth added 11). Of this number, 22 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":"br/pkg/restore/misc.go"},"region":{"startLine":300}}}],"partialFingerprints":{"codehealthFindingId/v1":"d3b7121fec61da7d59157129efe3e22c0463268c2dafa94a18842cd1f613005a"}},{"ruleId":"D2","level":"warning","message":{"text":"ingestrec.NewForeignKeyRecordManagerForTables (cognitive 23): ingestrec.NewForeignKeyRecordManagerForTables has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15, boolean chains 4, loops 4 (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":"br/pkg/restore/ingestrec/foreign_key.go"},"region":{"startLine":76}}}],"partialFingerprints":{"codehealthFindingId/v1":"f72c2d641e3a148161d031fa30ac03f41ddbb35f827b8d66cfc804171588c641"}},{"ruleId":"D2","level":"warning","message":{"text":"LogClient.FailpointDoChecksumForLogRestore (cognitive 23): LogClient.FailpointDoChecksumForLogRestore has cognitive complexity 23 (threshold 15). Drivers by points: if/else 18, loops 5 (nesting depth added 10). Of this number, 18 points are the body\u0027s own statements and 5 belong to 2 function literals inside it that branch. To reduce it, 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":"br/pkg/restore/log_client/client.go"},"region":{"startLine":2413}}}],"partialFingerprints":{"codehealthFindingId/v1":"3240f7cfa6129f2a88ea0b0a2876624ab762c246a571aa6a293f16e364812a55"}},{"ruleId":"D2","level":"warning","message":{"text":"subscription.listenOver (cognitive 23): subscription.listenOver has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15, match/switch 5, loops 3 (nesting depth added 12). Of this number, 21 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":"br/pkg/streamhelper/flush_subscriber.go"},"region":{"startLine":322}}}],"partialFingerprints":{"codehealthFindingId/v1":"ad09c23b6542d3e91f1a67ee0eaa8bc1f417a1c0598f081f9aeb8e47c0326dc3"}},{"ruleId":"D2","level":"warning","message":{"text":"util.SkipAnalyzer (cognitive 23): util.SkipAnalyzer has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12, loops 6, match/switch 4, boolean chains 1 (nesting depth added 12). Most of this is not in the body itself: 0 of the 23 points are its own statements and the rest belongs to one function literal inside it that branches (line 107). 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":"build/linter/util/util.go"},"region":{"startLine":104}}}],"partialFingerprints":{"codehealthFindingId/v1":"c0ee272c8a94d1b77e611c69b59c8a3df934a7de38f0ea2ec17e7738a3ca6d6a"}},{"ruleId":"D2","level":"warning","message":{"text":"Dumper.checkPartitionsFlag (cognitive 23): Dumper.checkPartitionsFlag has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13, loops 9, boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"dumpling/export/dump.go"},"region":{"startLine":499}}}],"partialFingerprints":{"codehealthFindingId/v1":"e7f919eab8780a506521f93a6d3555916368af73a6fdd4953a808ba53523488b"}},{"ruleId":"D2","level":"warning","message":{"text":"main.main (cognitive 23): main.main has cognitive complexity 23 (threshold 15). Drivers by points: if/else 20, boolean chains 3 (nesting depth added 4). Of this number, 21 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":"lightning/cmd/tidb-lightning/main.go"},"region":{"startLine":34}}}],"partialFingerprints":{"codehealthFindingId/v1":"d3824de81e774bd4b478260b48cea463d38895337c6ffa3bf26ceb4b3f32b14d"}},{"ruleId":"D2","level":"warning","message":{"text":"Controller.keepPauseGCForDupeRes (cognitive 23): Controller.keepPauseGCForDupeRes has cognitive complexity 23 (threshold 15). Drivers by points: if/else 19, loops 2, match/switch 2 (nesting depth added 11). Most of this is not in the body itself: 11 of the 23 points are its own statements and the rest belongs to one function literal inside it that branches (line 1264). 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":"lightning/pkg/importer/import.go"},"region":{"startLine":1213}}}],"partialFingerprints":{"codehealthFindingId/v1":"66d61e19fd28a4b4c465258b81b99c9a64c63401aaae7b3750c5b82d3be644b6"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.onCreateView (cognitive 23): ddl.onCreateView has cognitive complexity 23 (threshold 15). Drivers by points: if/else 20, boolean chains 2, match/switch 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":"pkg/ddl/create_table.go"},"region":{"startLine":371}}}],"partialFingerprints":{"codehealthFindingId/v1":"e105a36acf76a856d9b4e4b179d29bcf7f4a4f4bee099085ac450b3451e11e0c"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.buildColumnsAndConstraints (cognitive 23): ddl.buildColumnsAndConstraints has cognitive complexity 23 (threshold 15). Drivers by points: if/else 16, loops 3, match/switch 3, boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/create_table.go"},"region":{"startLine":1042}}}],"partialFingerprints":{"codehealthFindingId/v1":"c864a4024b6532c27ad3baae80af3fe8bf73b2e3de6aa0e777fc1d40aad5206a"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.ProcessModifyColumnOptions (cognitive 23): ddl.ProcessModifyColumnOptions has cognitive complexity 23 (threshold 15). Drivers by points: if/else 16, loops 4, match/switch 2, 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":"pkg/ddl/modify_column.go"},"region":{"startLine":2297}}}],"partialFingerprints":{"codehealthFindingId/v1":"af2b1414bb40249b1e6aace9cfef992144f589de617a7c578ebcfc84edaeef5d"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.AppendPartitionInfo (cognitive 23): ddl.AppendPartitionInfo has cognitive complexity 23 (threshold 15). Drivers by points: if/else 19, 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":"pkg/ddl/partition.go"},"region":{"startLine":5139}}}],"partialFingerprints":{"codehealthFindingId/v1":"fa1c75c12d562ec84c70676f94adf0b9eea0ddfaf90a3148ad63d686176e1fbd"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.SetDirectResourceGroupSettings (cognitive 23): ddl.SetDirectResourceGroupSettings has cognitive complexity 23 (threshold 15). Drivers by points: if/else 16, loops 4, match/switch 3 (nesting depth added 11). 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":"pkg/ddl/resource_group.go"},"region":{"startLine":201}}}],"partialFingerprints":{"codehealthFindingId/v1":"7b70067037eecdb8a376d0a532949f51e58592b38ef313235478eb32c7c0f00a"}},{"ruleId":"D2","level":"warning","message":{"text":"executor.CreateTable (cognitive 23): executor.CreateTable has cognitive complexity 23 (threshold 15). Drivers by points: if/else 21, 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":"pkg/ddl/executor.go"},"region":{"startLine":1003}}}],"partialFingerprints":{"codehealthFindingId/v1":"53ff2382c516a77fadd52b8ef556cd28cf2b73a05d4fd41c5f1a4f705a05fcbf"}},{"ruleId":"D2","level":"warning","message":{"text":"worker.onSetTableFlashReplica (cognitive 23): worker.onSetTableFlashReplica has cognitive complexity 23 (threshold 15). Drivers by points: if/else 23 (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":"pkg/ddl/table.go"},"region":{"startLine":1140}}}],"partialFingerprints":{"codehealthFindingId/v1":"52ee0e7183e95ee906e1e5eb23f0b55786206ac6e80f79a1b51fc7630a94e444"}},{"ruleId":"D2","level":"warning","message":{"text":"Domain.LoadPrivilegeLoop (cognitive 23): Domain.LoadPrivilegeLoop has cognitive complexity 23 (threshold 15). Drivers by points: if/else 19, match/switch 2, boolean chains 1, loops 1 (nesting depth added 12). Most of this is not in the body itself: 2 of the 23 points are its own statements and the rest belongs to one function literal inside it that branches (line 1405). 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":"pkg/domain/domain.go"},"region":{"startLine":1389}}}],"partialFingerprints":{"codehealthFindingId/v1":"eadd84ace92b654624a63c7f8e36bde6d012b8518a1595c6dbcc4c079592b768"}},{"ruleId":"D2","level":"warning","message":{"text":"executor.SetSlowLogItems (cognitive 23): executor.SetSlowLogItems has cognitive complexity 23 (threshold 15). Drivers by points: if/else 19, 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":"pkg/executor/adapter_slow_log.go"},"region":{"startLine":191}}}],"partialFingerprints":{"codehealthFindingId/v1":"e82bfcafd231130dbb5b61a6b3823426a676a03894af0f450099f33ff148aa6d"}},{"ruleId":"D2","level":"warning","message":{"text":"executor.iterTxnMemBuffer (cognitive 23): executor.iterTxnMemBuffer has cognitive complexity 23 (threshold 15). Drivers by points: if/else 20, loops 3 (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":"pkg/executor/mem_reader.go"},"region":{"startLine":585}}}],"partialFingerprints":{"codehealthFindingId/v1":"aa356953a9b5e13b2576c181510de6117ba74c7fb503f6ba5a48d7fdaee4dd51"}},{"ruleId":"D2","level":"warning","message":{"text":"CleanupIndexExec.deleteDanglingIdx (cognitive 23): CleanupIndexExec.deleteDanglingIdx has cognitive complexity 23 (threshold 15). Drivers by points: if/else 19, loops 4 (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":"pkg/executor/admin.go"},"region":{"startLine":651}}}],"partialFingerprints":{"codehealthFindingId/v1":"876f104ade36daca41fe9f097afff917b953c748e8ee0c140103dd1b7ec7cecf"}},{"ruleId":"D2","level":"warning","message":{"text":"groupConcatOrder.UpdatePartialResult (cognitive 23): groupConcatOrder.UpdatePartialResult has cognitive complexity 23 (threshold 15). Drivers by points: if/else 18, loops 5 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/aggfuncs/func_group_concat.go"},"region":{"startLine":545}}}],"partialFingerprints":{"codehealthFindingId/v1":"65390c1e972bc6ce3ba45f546d0dd8fdec0bdf9b57c42c485f1cbe265cd60284"}},{"ruleId":"D2","level":"warning","message":{"text":"AnalyzeExec.handleGlobalStats (cognitive 23): AnalyzeExec.handleGlobalStats has cognitive complexity 23 (threshold 15). Drivers by points: if/else 18, loops 5 (nesting depth added 13). Of this number, 13 points are the body\u0027s own statements and 10 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/executor/analyze_global_stats.go"},"region":{"startLine":40}}}],"partialFingerprints":{"codehealthFindingId/v1":"01d2221393c04424d4d25048234d9b3448eb3b97a5524009afcefce44b1097a4"}},{"ruleId":"D2","level":"warning","message":{"text":"executorBuilder.buildHashAggFromChildExec (cognitive 23): executorBuilder.buildHashAggFromChildExec has cognitive complexity 23 (threshold 15). Drivers by points: if/else 18, boolean chains 3, loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/builder.go"},"region":{"startLine":2133}}}],"partialFingerprints":{"codehealthFindingId/v1":"625a7a76e0051e8f10621de86a1f69198a47ddb997621d733d8c2047bda668a6"}},{"ruleId":"D2","level":"warning","message":{"text":"executorBuilder.buildIndexMergeReader (cognitive 23): executorBuilder.buildIndexMergeReader has cognitive complexity 23 (threshold 15). Drivers by points: if/else 19, loops 3, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/builder.go"},"region":{"startLine":4797}}}],"partialFingerprints":{"codehealthFindingId/v1":"e28be38f2c43c9a1aabfd107856c3e1b694f58a68b6e6a5904a9c64d4cc0e244"}},{"ruleId":"D2","level":"warning","message":{"text":"IndexReaderExecutor.open (cognitive 23): IndexReaderExecutor.open has cognitive complexity 23 (threshold 15). Drivers by points: if/else 19, loops 4 (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":"pkg/executor/distsql.go"},"region":{"startLine":384}}}],"partialFingerprints":{"codehealthFindingId/v1":"67325f52d90c4a4ee7cabe13d1fa29247411acd8a6fd89b3c3772133a64f9446"}},{"ruleId":"D2","level":"warning","message":{"text":"ImportIntoExec.Next (cognitive 23): ImportIntoExec.Next has cognitive complexity 23 (threshold 15). Drivers by points: if/else 23 (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/executor/import_into.go"},"region":{"startLine":83}}}],"partialFingerprints":{"codehealthFindingId/v1":"e4579a5f93b17244ffb69349c38be075aeb130f7f16510ebca48e86b6725e9c5"}},{"ruleId":"D2","level":"warning","message":{"text":"TableImporter.CheckDiskQuota (cognitive 23): TableImporter.CheckDiskQuota has cognitive complexity 23 (threshold 15). Drivers by points: if/else 17, loops 3, match/switch 2, boolean chains 1 (nesting depth added 11). Of this number, 21 points are the body\u0027s own statements and 2 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":"pkg/executor/importer/table_import.go"},"region":{"startLine":644}}}],"partialFingerprints":{"codehealthFindingId/v1":"d725da3a55c944d8fb4551a769691a0157a50798425ad824bf5cde40325c5a5c"}},{"ruleId":"D2","level":"warning","message":{"text":"testutil.BuildMockDataSource (cognitive 23): testutil.BuildMockDataSource has cognitive complexity 23 (threshold 15). Drivers by points: loops 15, if/else 5, match/switch 3 (nesting depth added 11). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/internal/testutil/testutil.go"},"region":{"startLine":269}}}],"partialFingerprints":{"codehealthFindingId/v1":"67ad58b76d29553c9d28321474a9d638dac45bab21f730396a2085e69690ed6d"}},{"ruleId":"D2","level":"warning","message":{"text":"outerJoinProbe.probeForOuterSideBuild (cognitive 23): outerJoinProbe.probeForOuterSideBuild has cognitive complexity 23 (threshold 15). Drivers by points: if/else 18, loops 3, boolean chains 2 (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/executor/join/outer_join_probe.go"},"region":{"startLine":308}}}],"partialFingerprints":{"codehealthFindingId/v1":"fac78bb3c4ac5051ae69f0b0e68971fa9185306bf3e81036f8b080311ec12253"}},{"ruleId":"D2","level":"warning","message":{"text":"commitWorker.checkAndInsertOneBatch (cognitive 23): commitWorker.checkAndInsertOneBatch has cognitive complexity 23 (threshold 15). Drivers by points: if/else 18, boolean chains 2, loops 2, 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":"pkg/executor/load_data.go"},"region":{"startLine":663}}}],"partialFingerprints":{"codehealthFindingId/v1":"505a762ba42e86ca90eeeb3b73048be9973d8e4cb239ab07315bebb23dc766c8"}},{"ruleId":"D2","level":"warning","message":{"text":"tikvRegionPeersRetriever.packTiKVRegionPeersRows (cognitive 23): tikvRegionPeersRetriever.packTiKVRegionPeersRows has cognitive complexity 23 (threshold 15). Drivers by points: if/else 16, loops 7 (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/executor/memtable_reader.go"},"region":{"startLine":992}}}],"partialFingerprints":{"codehealthFindingId/v1":"f9b40d1f0ce0807ead45c52496c214f4c995abc2261cad26f6a8be1970c8cfc9"}},{"ruleId":"D2","level":"warning","message":{"text":"PrepareExec.Next (cognitive 23): PrepareExec.Next has cognitive complexity 23 (threshold 15). Drivers by points: if/else 21, loops 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":"pkg/executor/prepared.go"},"region":{"startLine":82}}}],"partialFingerprints":{"codehealthFindingId/v1":"64601e44336c53245363f999fc00e9cbf4252786ff1c222b717fdf6b272086ab"}},{"ruleId":"D2","level":"warning","message":{"text":"ShowNextRowIDExec.Next (cognitive 23): ShowNextRowIDExec.Next has cognitive complexity 23 (threshold 15). Drivers by points: if/else 20, match/switch 2, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/show_next_row_id.go"},"region":{"startLine":38}}}],"partialFingerprints":{"codehealthFindingId/v1":"566e03e3ae64119b02c0251239e4dcac1ce5b88c86f0447d220a78bb43bd24f1"}},{"ruleId":"D2","level":"warning","message":{"text":"SimpleExec.executeGrantRole (cognitive 23): SimpleExec.executeGrantRole has cognitive complexity 23 (threshold 15). Drivers by points: if/else 18, loops 5 (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/executor/simple.go"},"region":{"startLine":2314}}}],"partialFingerprints":{"codehealthFindingId/v1":"564ba5cf858fa128b4b97841e101ae4ba9c1d8328b53825cf29323916c80d714"}},{"ruleId":"D2","level":"warning","message":{"text":"expression.setFlenFromArgs (cognitive 23): expression.setFlenFromArgs has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13, loops 6, match/switch 3, boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/builtin_control.go"},"region":{"startLine":69}}}],"partialFingerprints":{"codehealthFindingId/v1":"e86e521f12f19d0fe720dd523a2e75ecbc936235594905439a966c8d25ef6e56"}},{"ruleId":"D2","level":"warning","message":{"text":"expression.roundFormatArgs (cognitive 23): expression.roundFormatArgs has cognitive complexity 23 (threshold 15). Drivers by points: if/else 17, loops 4, boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/builtin_string.go"},"region":{"startLine":3614}}}],"partialFingerprints":{"codehealthFindingId/v1":"8af3c4f2e14f952974f74d414890939386c6e92ddf4fe0ec43bf92630b3da907"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinConcatSig.vecEvalString (cognitive 23): builtinConcatSig.vecEvalString has cognitive complexity 23 (threshold 15). Drivers by points: if/else 19, loops 4 (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":"pkg/expression/builtin_string_vec.go"},"region":{"startLine":352}}}],"partialFingerprints":{"codehealthFindingId/v1":"f58c5c282e28bc59c9d63036a3facbb3c75a8d81edfbbcf5825d347db8cb3919"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinInsertSig.vecEvalString (cognitive 23): builtinInsertSig.vecEvalString has cognitive complexity 23 (threshold 15). Drivers by points: if/else 19, boolean chains 3, 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/expression/builtin_string_vec.go"},"region":{"startLine":553}}}],"partialFingerprints":{"codehealthFindingId/v1":"f74a637d83ba4bcd521b769513ef7cc025dd121fe15af2ca4a0e42a9467add8d"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinInsertUTF8Sig.vecEvalString (cognitive 23): builtinInsertUTF8Sig.vecEvalString has cognitive complexity 23 (threshold 15). Drivers by points: if/else 19, boolean chains 3, 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/expression/builtin_string_vec.go"},"region":{"startLine":1885}}}],"partialFingerprints":{"codehealthFindingId/v1":"2925403e8bbd6cbac484757ebc2373ccb449c2bc5b8dc328be63a1cbceae0c0b"}},{"ruleId":"D2","level":"warning","message":{"text":"baseDateArithmetical.vecGetIntervalFromDecimal (cognitive 23): baseDateArithmetical.vecGetIntervalFromDecimal has cognitive complexity 23 (threshold 15). Drivers by points: if/else 16, boolean chains 3, match/switch 3, loops 1 (nesting depth added 8). Of this number, 18 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":"pkg/expression/builtin_time.go"},"region":{"startLine":3487}}}],"partialFingerprints":{"codehealthFindingId/v1":"59a529ce4862586594383c911076b47a1470f8f48b8a7a619f89e58857d047c8"}},{"ruleId":"D2","level":"warning","message":{"text":"GroupingSets.DistinctSizeWithThreshold (cognitive 23): GroupingSets.DistinctSizeWithThreshold has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13, loops 10 (nesting depth added 13). Of this number, 18 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":"pkg/expression/grouping_sets.go"},"region":{"startLine":563}}}],"partialFingerprints":{"codehealthFindingId/v1":"d44d7810161d9ddf4c2e0db47590a7a4703a4e6d5268cb4aaed1d2e2739ebc5f"}},{"ruleId":"D2","level":"warning","message":{"text":"core.resolveRedundantColumnFromNaturalUsingJoinPlan (cognitive 23): core.resolveRedundantColumnFromNaturalUsingJoinPlan has cognitive complexity 23 (threshold 15). Drivers by points: if/else 16, loops 4, boolean chains 2, match/switch 1 (nesting depth added 12). 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":"pkg/planner/core/expression_rewriter.go"},"region":{"startLine":3200}}}],"partialFingerprints":{"codehealthFindingId/v1":"e273b26be07399b4181d39b1054e5585b1a55d68659833559e5be3f83c220a39"}},{"ruleId":"D2","level":"warning","message":{"text":"core.accessPathsForConds (cognitive 23): core.accessPathsForConds has cognitive complexity 23 (threshold 15). Drivers by points: if/else 22, 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":"pkg/planner/core/indexmerge_path.go"},"region":{"startLine":213}}}],"partialFingerprints":{"codehealthFindingId/v1":"1e46cede1b9f3903a442d24f98ec4ce7062f7398c1ff0e1a61a8d2084a3b3d23"}},{"ruleId":"D2","level":"warning","message":{"text":"core.collectVisitInfoFromRevokeStmt (cognitive 23): core.collectVisitInfoFromRevokeStmt has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13, boolean chains 4, loops 3, match/switch 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/planner/core/planbuilder.go"},"region":{"startLine":3878}}}],"partialFingerprints":{"codehealthFindingId/v1":"953662a072df7a78d256959ff57ded6c987f2887ceb9ca996b9028ed57f7485e"}},{"ruleId":"D2","level":"warning","message":{"text":"core.tryPointGetPlan (cognitive 23): core.tryPointGetPlan has cognitive complexity 23 (threshold 15). Drivers by points: if/else 18, boolean chains 4, 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":"pkg/planner/core/point_get_plan.go"},"region":{"startLine":523}}}],"partialFingerprints":{"codehealthFindingId/v1":"dffe2bd533acca2e1057dfb34e733712036498bd388ce11fa5273a801da58fb8"}},{"ruleId":"D2","level":"warning","message":{"text":"core.collectGenerateColumn (cognitive 23): core.collectGenerateColumn has cognitive complexity 23 (threshold 15). Drivers by points: if/else 17, loops 4, boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/rule_generate_column_substitute.go"},"region":{"startLine":56}}}],"partialFingerprints":{"codehealthFindingId/v1":"de5c5fd2d54fc5f0d4f5053a9e1028b4a80d56bace5211a60460f3572b0bbce3"}},{"ruleId":"D2","level":"warning","message":{"text":"logicalop.DeriveOtherConditions (cognitive 23): logicalop.DeriveOtherConditions has cognitive complexity 23 (threshold 15). Drivers by points: if/else 21, boolean chains 1, 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":"pkg/planner/core/operator/logicalop/logical_join.go"},"region":{"startLine":2109}}}],"partialFingerprints":{"codehealthFindingId/v1":"562fefc2b3a51cab32c20b5f473ef63de06da5003db3d607c8213e910bcac3d5"}},{"ruleId":"D2","level":"warning","message":{"text":"LogicalAggregation.splitCondForAggregation (cognitive 23): LogicalAggregation.splitCondForAggregation has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15, loops 8 (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":"pkg/planner/core/operator/logicalop/logical_aggregation.go"},"region":{"startLine":629}}}],"partialFingerprints":{"codehealthFindingId/v1":"ee3d6ee1e24d1fde8c859d1fb1744141c8656ff13d79d49f3325c4b1ce76c8d2"}},{"ruleId":"D2","level":"warning","message":{"text":"DataSource.BuildKeyInfo (cognitive 23): DataSource.BuildKeyInfo has cognitive complexity 23 (threshold 15). Drivers by points: if/else 16, boolean chains 4, loops 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/operator/logicalop/logical_datasource.go"},"region":{"startLine":278}}}],"partialFingerprints":{"codehealthFindingId/v1":"14b1c60eae22c3e1f62c720aa08896bb8adbb162d9caa98bd819fe2ab20a4997"}},{"ruleId":"D2","level":"warning","message":{"text":"LogicalUnionAll.PruneColumns (cognitive 23): LogicalUnionAll.PruneColumns has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11, loops 11, 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":"pkg/planner/core/operator/logicalop/logical_union_all.go"},"region":{"startLine":59}}}],"partialFingerprints":{"codehealthFindingId/v1":"e96599b10610d61443527dbfbf4b54b7bbbc0616b5c0e18f5ee3a30048450386"}},{"ruleId":"D2","level":"warning","message":{"text":"PhysicalMergeJoin.ResolveIndices (cognitive 23): PhysicalMergeJoin.ResolveIndices has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15, loops 6, boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/operator/physicalop/physical_merge_join.go"},"region":{"startLine":350}}}],"partialFingerprints":{"codehealthFindingId/v1":"e666387838730c210b119cc9c115e3768336096d8b8a6c320f11b58591378423"}},{"ruleId":"D2","level":"warning","message":{"text":"CopTask.convertToRootTaskImpl (cognitive 23): CopTask.convertToRootTaskImpl has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14, loops 4, boolean chains 3, match/switch 2 (nesting depth added 6). Of this number, 21 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":"pkg/planner/core/operator/physicalop/task_base.go"},"region":{"startLine":509}}}],"partialFingerprints":{"codehealthFindingId/v1":"34e5c9cf5b307dbf8aeed673da18e84d3eacb8e9c16dc4f6a34c027b1d1fa69f"}},{"ruleId":"D2","level":"warning","message":{"text":"preprocessor.handleTableName (cognitive 23): preprocessor.handleTableName has cognitive complexity 23 (threshold 15). Drivers by points: if/else 23 (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/planner/core/preprocess.go"},"region":{"startLine":1757}}}],"partialFingerprints":{"codehealthFindingId/v1":"2e137a3456a1133c1a47d3e3e7007b41256ca1f84d812d503ce0b23d90294cad"}},{"ruleId":"D2","level":"warning","message":{"text":"joinReorderDPSolver.dpGraph (cognitive 23): joinReorderDPSolver.dpGraph has cognitive complexity 23 (threshold 15). Drivers by points: if/else 18, loops 4, boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/rule_join_reorder_dp.go"},"region":{"startLine":202}}}],"partialFingerprints":{"codehealthFindingId/v1":"6176ca6867e9500b9e82f301de4c29d1be5244678603e12a02a71d2dac7085be"}},{"ruleId":"D2","level":"warning","message":{"text":"indexadvisor.CollectDNFColumnsFromQuery (cognitive 23): indexadvisor.CollectDNFColumnsFromQuery has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15, loops 8 (nesting depth added 12). Most of this is not in the body itself: 3 of the 23 points are its own statements and the rest belongs to one function literal inside it that branches (line 202). 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":"pkg/planner/indexadvisor/utils.go"},"region":{"startLine":187}}}],"partialFingerprints":{"codehealthFindingId/v1":"2ae9317eb3039fb1d2e033ef8cd4d849047840bc765ee35878363b50486ccaba"}},{"ruleId":"D2","level":"warning","message":{"text":"planner.buildAndOptimizeLogicalPlanRound (cognitive 23): planner.buildAndOptimizeLogicalPlanRound has cognitive complexity 23 (threshold 15). Drivers by points: if/else 21, boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/optimize.go"},"region":{"startLine":496}}}],"partialFingerprints":{"codehealthFindingId/v1":"826a1a6986d2cdf29f4ef3ec85fbbf77b94e5e0ae5e0485d575259f68939772d"}},{"ruleId":"D2","level":"warning","message":{"text":"plugin.Load (cognitive 23): plugin.Load has cognitive complexity 23 (threshold 15). Drivers by points: if/else 19, loops 4 (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":"pkg/plugin/plugin.go"},"region":{"startLine":141}}}],"partialFingerprints":{"codehealthFindingId/v1":"4d350fe15c94475701b86c6fb27de34fa1866aeff23deae8add9d0785199e2d7"}},{"ruleId":"D2","level":"warning","message":{"text":"clientConn.handleChangeUser (cognitive 23): clientConn.handleChangeUser has cognitive complexity 23 (threshold 15). Drivers by points: if/else 20, boolean chains 3 (nesting depth added 6). Of this number, 19 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":"pkg/server/conn.go"},"region":{"startLine":2721}}}],"partialFingerprints":{"codehealthFindingId/v1":"f9ceeb970e3f3259eb87cc0700ea3b7afe9656deeb32df76e25ce83188696388"}},{"ruleId":"D2","level":"warning","message":{"text":"PacketIO.readOnePacket (cognitive 23): PacketIO.readOnePacket has cognitive complexity 23 (threshold 15). Drivers by points: if/else 23 (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":"pkg/server/internal/packetio.go"},"region":{"startLine":141}}}],"partialFingerprints":{"codehealthFindingId/v1":"6ccd3e1daea055ed2c9fbe3fa19346f7d389fcba941dcb4dd898df1253d172df"}},{"ruleId":"D2","level":"warning","message":{"text":"Server.Stats (cognitive 23): Server.Stats has cognitive complexity 23 (threshold 15). Drivers by points: if/else 21, boolean chains 1, 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/server/stat.go"},"region":{"startLine":47}}}],"partialFingerprints":{"codehealthFindingId/v1":"8d54c535f9e707fc3857a1a0ff9fae47afeaaaa219fbbba150bde4b668786463"}},{"ruleId":"D2","level":"warning","message":{"text":"baseTxnContextProvider.SetOptionsBeforeCommit (cognitive 23): baseTxnContextProvider.SetOptionsBeforeCommit has cognitive complexity 23 (threshold 15). Drivers by points: if/else 20, 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":"pkg/sessiontxn/isolation/base.go"},"region":{"startLine":560}}}],"partialFingerprints":{"codehealthFindingId/v1":"72e86449f2fbee7ac3ba72d482813fa270e194e105e1a9fe57166ba5f96d8cea"}},{"ruleId":"D2","level":"warning","message":{"text":"copr.filterAllStoresAccordingToTiFlashReplicaRead (cognitive 23): copr.filterAllStoresAccordingToTiFlashReplicaRead has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14, 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":"pkg/store/copr/batch_coprocessor.go"},"region":{"startLine":774}}}],"partialFingerprints":{"codehealthFindingId/v1":"f8315c73307f166aa8be2435c6010d35d0e90e45a542dbf6e35d87e45f731683"}},{"ruleId":"D2","level":"warning","message":{"text":"indexScanExec.Next (cognitive 23): indexScanExec.Next has cognitive complexity 23 (threshold 15). Drivers by points: if/else 21, boolean chains 1, 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":"pkg/store/mockstore/mockcopr/executor.go"},"region":{"startLine":284}}}],"partialFingerprints":{"codehealthFindingId/v1":"d19949b328a91fb3024bd4b637fb4b25ff64e3fe0573a746b74c443c2ab76109"}},{"ruleId":"D2","level":"warning","message":{"text":"mppExecBuilder.buildMPPJoin (cognitive 23): mppExecBuilder.buildMPPJoin has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15, loops 8 (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/store/mockstore/unistore/cophandler/mpp.go"},"region":{"startLine":456}}}],"partialFingerprints":{"codehealthFindingId/v1":"8e5ef8120bf85df91dde1c05bc08276767e312df51e763c15f9eb65a6bc48dd7"}},{"ruleId":"D2","level":"warning","message":{"text":"MemStore.calculateRecomputeHeight (cognitive 23): MemStore.calculateRecomputeHeight has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11, loops 10, boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/store/mockstore/unistore/lockstore/lockstore.go"},"region":{"startLine":399}}}],"partialFingerprints":{"codehealthFindingId/v1":"5ff1efc0a7196d86a0a09a931b5e582576465874c9e6a95394dee06429136c00"}},{"ruleId":"D2","level":"warning","message":{"text":"DBReader.ReverseScan (cognitive 23): DBReader.ReverseScan has cognitive complexity 23 (threshold 15). Drivers by points: if/else 21, 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":"pkg/store/mockstore/unistore/tikv/dbreader/db_reader.go"},"region":{"startLine":315}}}],"partialFingerprints":{"codehealthFindingId/v1":"8a99c03fe860d7c623f2c02208eada5ca918ace6876ef91d1fcef4e590ed2d74"}},{"ruleId":"D2","level":"warning","message":{"text":"TableCommon.removeRowIndices (cognitive 23): TableCommon.removeRowIndices has cognitive complexity 23 (threshold 15). Drivers by points: if/else 18, boolean chains 4, loops 1 (nesting depth added 9). Of this number, 22 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":"pkg/table/tables/tables.go"},"region":{"startLine":1275}}}],"partialFingerprints":{"codehealthFindingId/v1":"40c2f77c497b6f1f4343edb8c8d9fde834bbae5a4d5cc741a1412476256b28a9"}},{"ruleId":"D2","level":"warning","message":{"text":"TempIndexValueElem.Encode (cognitive 23): TempIndexValueElem.Encode has cognitive complexity 23 (threshold 15). Drivers by points: if/else 23 (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":"pkg/tablecodec/tablecodec.go"},"region":{"startLine":1413}}}],"partialFingerprints":{"codehealthFindingId/v1":"6d80fce431a564a03eb2fd112eb3ecb71612a868f0700ea49d1e9b4e8bc46531"}},{"ruleId":"D2","level":"warning","message":{"text":"types.quoteJSONString (cognitive 23): types.quoteJSONString has cognitive complexity 23 (threshold 15). Drivers by points: if/else 20, boolean chains 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":"pkg/types/json_binary_functions.go"},"region":{"startLine":201}}}],"partialFingerprints":{"codehealthFindingId/v1":"2072270597fd74c74e13e0e1fbbb25437bb18dfdad2ba88484f24de2dcb0dc65"}},{"ruleId":"D2","level":"warning","message":{"text":"main.parseCETWeights (cognitive 23): main.parseCETWeights has cognitive complexity 23 (threshold 15). Drivers by points: if/else 17, loops 3, jumps 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":"pkg/util/collate/ucadata/generator/main.go"},"region":{"startLine":63}}}],"partialFingerprints":{"codehealthFindingId/v1":"448439a31570ac70ebf91a6a6add8c5a0716e2e4a1a54563fe89ba5c2deb99b3"}},{"ruleId":"D2","level":"warning","message":{"text":"Filter.initRules (cognitive 23): Filter.initRules has cognitive complexity 23 (threshold 15). Drivers by points: if/else 17, loops 4, boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/util/filter/filter.go"},"region":{"startLine":109}}}],"partialFingerprints":{"codehealthFindingId/v1":"51c3cb37df090139eff65e5174b12845afc173f50aedcd6351b83e47d8ca161f"}},{"ruleId":"D2","level":"warning","message":{"text":"memoryLimitTuner.tuning (cognitive 23): memoryLimitTuner.tuning has cognitive complexity 23 (threshold 15). Drivers by points: if/else 17, boolean chains 3, loops 3 (nesting depth added 11). Most of this is not in the body itself: 6 of the 23 points are its own statements and the rest belongs to one function literal inside it that branches (line 104). 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":"pkg/util/gctuner/memory_limit_tuner.go"},"region":{"startLine":78}}}],"partialFingerprints":{"codehealthFindingId/v1":"3dabd40a9610b390fdda271261356f582d0681adfadf24d8acd03eab794336f5"}},{"ruleId":"D2","level":"warning","message":{"text":"plancodec.DecodeBinaryPlan (cognitive 23): plancodec.DecodeBinaryPlan has cognitive complexity 23 (threshold 15). Drivers by points: if/else 16, loops 7 (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":"pkg/util/plancodec/binary_plan_decode.go"},"region":{"startLine":28}}}],"partialFingerprints":{"codehealthFindingId/v1":"a610eb26817fd13a3f7db838daefd272705c10844fee160b17f9431ba1b30e8b"}},{"ruleId":"D2","level":"warning","message":{"text":"ranger.excludeToIncludeForIntPoint (cognitive 23): ranger.excludeToIncludeForIntPoint has cognitive complexity 23 (threshold 15). Drivers by points: if/else 23 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/util/ranger/detacher.go"},"region":{"startLine":606}}}],"partialFingerprints":{"codehealthFindingId/v1":"a799e50b73685e977191dc8b3e29b8aac773ff7387b05239786058e7902e17d2"}},{"ruleId":"D2","level":"warning","message":{"text":"builder.buildFromNot (cognitive 23): builder.buildFromNot has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15, loops 5, boolean chains 2, match/switch 1 (nesting depth added 12). 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":"pkg/util/ranger/points.go"},"region":{"startLine":863}}}],"partialFingerprints":{"codehealthFindingId/v1":"ad9e0a4031e781feb51c3a7c4be4a33a805a58889a1a6160d9fd7b4e7a846264"}},{"ruleId":"D2","level":"warning","message":{"text":"StmtSummary.evictedLogLoop (cognitive 23): StmtSummary.evictedLogLoop has cognitive complexity 23 (threshold 15). Drivers by points: match/switch 10, if/else 6, loops 6, boolean chains 1 (nesting depth added 8). Most of this is not in the body itself: 11 of the 23 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 559, 529, 539, \u2026). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals\u0027 work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/util/stmtsummary/v2/stmtsummary.go"},"region":{"startLine":507}}}],"partialFingerprints":{"codehealthFindingId/v1":"231f64720f9140bf823e7aadd11c9fefd23081995e5f4d68b885b56a9dd93f50"}},{"ruleId":"D2","level":"warning","message":{"text":"main.cmdList (cognitive 23): main.cmdList has cognitive complexity 23 (threshold 15). Drivers by points: if/else 18, loops 4, 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/check/ut.go"},"region":{"startLine":113}}}],"partialFingerprints":{"codehealthFindingId/v1":"15f7997d76ff89416da58e246305945953bdc1b35259c32dcbfb2acbeda83abc"}},{"ruleId":"D2","level":"warning","message":{"text":"CreateTableStmt.Accept (cognitive 23): CreateTableStmt.Accept has cognitive complexity 23 (threshold 15). Drivers by points: if/else 19, loops 4 (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":"pkg/parser/ast/ddl.go"},"region":{"startLine":1306}}}],"partialFingerprints":{"codehealthFindingId/v1":"7f470ad9b4e73ebbd344e118691b5797ecd6197e31ad5debb6b319b127cf6a0f"}},{"ruleId":"D2","level":"warning","message":{"text":"Client.OnBackupResponse (cognitive 22): Client.OnBackupResponse has cognitive complexity 22 (threshold 15). Drivers by points: if/else 17, match/switch 4, boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"br/pkg/backup/client.go"},"region":{"startLine":1230}}}],"partialFingerprints":{"codehealthFindingId/v1":"2113e8136ed8229c09645d0e847819f82fd869f81b57e191f87fa6399eaa3a84"}},{"ruleId":"D2","level":"warning","message":{"text":"SnapClient.registerWaitTiFlashReady (cognitive 22): SnapClient.registerWaitTiFlashReady has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16, loops 4, boolean chains 2 (nesting depth added 9). Most of this is not in the body itself: 1 of the 22 points is its own statement and the rest belongs to one function literal inside it that branches (line 630). 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":"br/pkg/restore/snap_client/pipeline_items.go"},"region":{"startLine":620}}}],"partialFingerprints":{"codehealthFindingId/v1":"78c74921de9e9b3e45bf4b2c886cebe4fccf4a9aeb75c978e13c5fe7cf9757b9"}},{"ruleId":"D2","level":"warning","message":{"text":"SnapClient.checkPrivilegeTableRowsCollateCompatibility (cognitive 22): SnapClient.checkPrivilegeTableRowsCollateCompatibility has cognitive complexity 22 (threshold 15). Drivers by points: if/else 19, loops 2, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"br/pkg/restore/snap_client/systable_restore.go"},"region":{"startLine":717}}}],"partialFingerprints":{"codehealthFindingId/v1":"92af242f467276f8fa5870439684cde84ab0449e4caf97e8131769d89c85791d"}},{"ruleId":"D2","level":"warning","message":{"text":"pdClient.splitKeys (cognitive 22): pdClient.splitKeys has cognitive complexity 22 (threshold 15). Drivers by points: if/else 20, boolean chains 1, loops 1 (nesting depth added 6). Most of this is not in the body itself: 3 of the 22 points are its own statements and the rest belongs to one function literal inside it that branches (line 664). 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":"br/pkg/restore/split/client.go"},"region":{"startLine":640}}}],"partialFingerprints":{"codehealthFindingId/v1":"e560ce004b355da645b209ca62103a881e2e48935b89a836942f91f996261483"}},{"ruleId":"D2","level":"warning","message":{"text":"task.FilterDDLJobs (cognitive 22): task.FilterDDLJobs has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14, loops 6, boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"br/pkg/task/restore.go"},"region":{"startLine":2561}}}],"partialFingerprints":{"codehealthFindingId/v1":"b1fa7ecc26e983b12f53859f295ba5a7ceacfa9adfa25504fa5f49d0fc658fbb"}},{"ruleId":"D2","level":"warning","message":{"text":"task.generatePiTRTaskInfo (cognitive 22): task.generatePiTRTaskInfo has cognitive complexity 22 (threshold 15). Drivers by points: if/else 20, boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"br/pkg/task/stream.go"},"region":{"startLine":2347}}}],"partialFingerprints":{"codehealthFindingId/v1":"a0a1766e4a1fb731b61be8f7f28968a90786d49659bb33efab08366aee630d21"}},{"ruleId":"D2","level":"warning","message":{"text":"export.resetDBWithSessionParams (cognitive 22): export.resetDBWithSessionParams has cognitive complexity 22 (threshold 15). Drivers by points: if/else 20, 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":"dumpling/export/sql.go"},"region":{"startLine":970}}}],"partialFingerprints":{"codehealthFindingId/v1":"7f05c25e279d07167e85e4326f0bfcb2b56e906f7f5591fd27a1b87199db6c48"}},{"ruleId":"D2","level":"warning","message":{"text":"bindingAuto.getBindingPlanInfo (cognitive 22): bindingAuto.getBindingPlanInfo has cognitive complexity 22 (threshold 15). Drivers by points: if/else 19, boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/bindinfo/binding_auto.go"},"region":{"startLine":166}}}],"partialFingerprints":{"codehealthFindingId/v1":"0597addbc262a7e51d83bb30e4e2ac0a282e2dba131fe224f5db4d40818d6a90"}},{"ruleId":"D2","level":"warning","message":{"text":"Config.adjustSecurityConfig (cognitive 22): Config.adjustSecurityConfig has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16, boolean chains 6 (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":"pkg/config/config.go"},"region":{"startLine":1521}}}],"partialFingerprints":{"codehealthFindingId/v1":"e5c9a2dac76867cb50149974cef1850612d23ac49c0e010b4903ebca90af5b2a"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.iterateSnapshotKeys (cognitive 22): ddl.iterateSnapshotKeys has cognitive complexity 22 (threshold 15). Drivers by points: if/else 20, 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":"pkg/ddl/backfilling.go"},"region":{"startLine":1135}}}],"partialFingerprints":{"codehealthFindingId/v1":"6df9186a8cd1138593252095c5eecd896aa943107a7ae9e6ff58950a18afb5b8"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.checkIndexNeededInForeignKey (cognitive 22): ddl.checkIndexNeededInForeignKey has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15, loops 4, boolean chains 3 (nesting depth added 6). Of this number, 13 points are the body\u0027s own statements and 9 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/foreign_key.go"},"region":{"startLine":443}}}],"partialFingerprints":{"codehealthFindingId/v1":"0ec1442971df55141eb7f84cad03592861873409a340704eba1415d692b1df48"}},{"ruleId":"D2","level":"warning","message":{"text":"executor.ModifySchemaSetTiFlashReplica (cognitive 22): executor.ModifySchemaSetTiFlashReplica has cognitive complexity 22 (threshold 15). Drivers by points: if/else 20, 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":"pkg/ddl/executor.go"},"region":{"startLine":508}}}],"partialFingerprints":{"codehealthFindingId/v1":"8274f9178133735f9346edb0ee36d182dcbe0af2b283ead0a9ced1dd63baf743"}},{"ruleId":"D2","level":"warning","message":{"text":"executor.createTableWithInfoJob (cognitive 22): executor.createTableWithInfoJob has cognitive complexity 22 (threshold 15). Drivers by points: if/else 19, 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":"pkg/ddl/executor.go"},"region":{"startLine":1082}}}],"partialFingerprints":{"codehealthFindingId/v1":"ab781da19e4c518ea1cb5cb2626dc9bb27845f8c5f99dc35321de377c595c74f"}},{"ruleId":"D2","level":"warning","message":{"text":"executor.RepairTable (cognitive 22): executor.RepairTable has cognitive complexity 22 (threshold 15). Drivers by points: if/else 18, boolean chains 2, 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":"pkg/ddl/executor.go"},"region":{"startLine":5996}}}],"partialFingerprints":{"codehealthFindingId/v1":"4d047f2b3ad02d6598e4e089bd44f839df56732efffb02ade57b866def3be6a3"}},{"ruleId":"D2","level":"warning","message":{"text":"jobScheduler.deliveryJob (cognitive 22): jobScheduler.deliveryJob has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13, boolean chains 3, loops 3, match/switch 3 (nesting depth added 9). Most of this is not in the body itself: 4 of the 22 points are its own statements and the rest belongs to one function literal inside it that branches (line 496). 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":"pkg/ddl/job_scheduler.go"},"region":{"startLine":478}}}],"partialFingerprints":{"codehealthFindingId/v1":"ec5d661f3aebd5c1381c0c01ec025cb2a5744fe1971888ff6effcb21060f5239"}},{"ruleId":"D2","level":"warning","message":{"text":"jobScheduler.transitOneJobStepAndWaitSync (cognitive 22): jobScheduler.transitOneJobStepAndWaitSync has cognitive complexity 22 (threshold 15). Drivers by points: if/else 20, boolean chains 2 (nesting depth added 9). Of this number, 19 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":"pkg/ddl/job_scheduler.go"},"region":{"startLine":586}}}],"partialFingerprints":{"codehealthFindingId/v1":"0124878fc148d7c80b8b1ef5ecc5ef2cf7e96cb4c97b45d231815ee2ca7c7f79"}},{"ruleId":"D2","level":"warning","message":{"text":"Bundle.Reset (cognitive 22): Bundle.Reset has cognitive complexity 22 (threshold 15). Drivers by points: if/else 17, loops 5 (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/ddl/placement/bundle.go"},"region":{"startLine":500}}}],"partialFingerprints":{"codehealthFindingId/v1":"eab8b18dc61c5953ecc05326ce52c50e064da53d9c8de30b5d139b79b19d303c"}},{"ruleId":"D2","level":"warning","message":{"text":"LogicalPlan.ToPhysicalPlan (cognitive 22): LogicalPlan.ToPhysicalPlan has cognitive complexity 22 (threshold 15). Drivers by points: if/else 20, loops 1, match/switch 1 (nesting depth added 10). 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, 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/dxf/importinto/planner.go"},"region":{"startLine":151}}}],"partialFingerprints":{"codehealthFindingId/v1":"88f9e493bb32662501628fbb8b454ec48e72788f2cf0137e88aeb3caff02ac11"}},{"ruleId":"D2","level":"warning","message":{"text":"executor.getRemainDurationForAnalyzeStatusHelper (cognitive 22): executor.getRemainDurationForAnalyzeStatusHelper has cognitive complexity 22 (threshold 15). Drivers by points: if/else 19, boolean chains 3 (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/executor/infoschema_reader.go"},"region":{"startLine":2641}}}],"partialFingerprints":{"codehealthFindingId/v1":"09e8ca04930d904102a1b83057d80a5a9ca29f754f17f6a1a1d3c141d8e1c49f"}},{"ruleId":"D2","level":"warning","message":{"text":"executor.readLastLines (cognitive 22): executor.readLastLines has cognitive complexity 22 (threshold 15). Drivers by points: if/else 17, loops 3, boolean chains 2 (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/executor/slow_query.go"},"region":{"startLine":1519}}}],"partialFingerprints":{"codehealthFindingId/v1":"64e37cc235af8048a0da5954064bf91d5fa3a8c9f32235dc8622db35c73d077f"}},{"ruleId":"D2","level":"warning","message":{"text":"executorBuilder.buildTableReader (cognitive 22): executorBuilder.buildTableReader has cognitive complexity 22 (threshold 15). Drivers by points: if/else 17, boolean chains 4, match/switch 1 (nesting depth added 2). Of this number, 17 points are the body\u0027s own statements and 5 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/builder.go"},"region":{"startLine":3934}}}],"partialFingerprints":{"codehealthFindingId/v1":"edba1d9f5c57afce4ef8be70013a3b39f421d93489a81e2bb2dfded1f31d5d94"}},{"ruleId":"D2","level":"warning","message":{"text":"memtableRetriever.retrieve (cognitive 22): memtableRetriever.retrieve has cognitive complexity 22 (threshold 15). Drivers by points: if/else 17, boolean chains 2, match/switch 2, 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":"pkg/executor/infoschema_reader.go"},"region":{"startLine":114}}}],"partialFingerprints":{"codehealthFindingId/v1":"21cd5fe989d17b05cf8f2ed6b2bd8040d3109012ae28b67c051cb2e4e9ed2467"}},{"ruleId":"D2","level":"warning","message":{"text":"memtableRetriever.setDataFromTiDBCheckConstraints (cognitive 22): memtableRetriever.setDataFromTiDBCheckConstraints has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16, loops 4, boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/infoschema_reader.go"},"region":{"startLine":982}}}],"partialFingerprints":{"codehealthFindingId/v1":"c3928286d99d3d0242da539d5a2b9c01395c04bbaea3e8219b4a6f93b5b5aa8e"}},{"ruleId":"D2","level":"warning","message":{"text":"memtableRetriever.setDataForClientErrorsSummary (cognitive 22): memtableRetriever.setDataForClientErrorsSummary has cognitive complexity 22 (threshold 15). Drivers by points: loops 12, if/else 8, boolean chains 1, match/switch 1 (nesting depth added 12). 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":"pkg/executor/infoschema_reader.go"},"region":{"startLine":2907}}}],"partialFingerprints":{"codehealthFindingId/v1":"4d37db9652fb026569c058b9e5897add0f412c1bc217a80a792787988954eeeb"}},{"ruleId":"D2","level":"warning","message":{"text":"criticalErrorInspection.inspectError (cognitive 22): criticalErrorInspection.inspectError has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13, loops 9 (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":"pkg/executor/inspection_result.go"},"region":{"startLine":601}}}],"partialFingerprints":{"codehealthFindingId/v1":"cf51224507ed1db1939322ce1fb18fb81e96075f925bc046946ecbcb2742f6c5"}},{"ruleId":"D2","level":"warning","message":{"text":"ExecutorWithRetry.nextWithRecovery (cognitive 22): ExecutorWithRetry.nextWithRecovery has cognitive complexity 22 (threshold 15). Drivers by points: if/else 20, boolean chains 1, loops 1 (nesting depth added 11). Of this number, 12 points are the body\u0027s own statements and 10 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":"pkg/executor/internal/mpp/executor_with_retry.go"},"region":{"startLine":176}}}],"partialFingerprints":{"codehealthFindingId/v1":"beed8bcf0b8a385de8d82a44bb30abf8ab707041aa6d0987f36231525769728c"}},{"ruleId":"D2","level":"warning","message":{"text":"VecGroupChecker.SplitIntoGroups (cognitive 22): VecGroupChecker.SplitIntoGroups has cognitive complexity 22 (threshold 15). Drivers by points: if/else 18, loops 4 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/internal/vecgroupchecker/vec_group_checker.go"},"region":{"startLine":80}}}],"partialFingerprints":{"codehealthFindingId/v1":"bcccc2e3d74a38a77498acc9f9087e11e87d9ead1bbfca4da3eb8d7d38717537"}},{"ruleId":"D2","level":"warning","message":{"text":"NestedLoopApplyExec.fetchSelectedOuterRow (cognitive 22): NestedLoopApplyExec.fetchSelectedOuterRow has cognitive complexity 22 (threshold 15). Drivers by points: if/else 20, boolean chains 1, 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":"pkg/executor/join/hash_join_v1.go"},"region":{"startLine":1272}}}],"partialFingerprints":{"codehealthFindingId/v1":"0e90b77eb169c93e6b68d32fb2c0a8b4b6c6a797ece49e6d3e30e780f022f6e0"}},{"ruleId":"D2","level":"warning","message":{"text":"indexHashJoinInnerWorker.buildHashTableForOuterResult (cognitive 22): indexHashJoinInnerWorker.buildHashTableForOuterResult has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13, loops 6, boolean chains 2, jumps 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/executor/join/index_lookup_hash_join.go"},"region":{"startLine":631}}}],"partialFingerprints":{"codehealthFindingId/v1":"c054aed72a4821639daabfed5b75e351c5cf40d79a0559b78fa4d57f4f355661"}},{"ruleId":"D2","level":"warning","message":{"text":"indexHashJoinInnerWorker.doJoinUnordered (cognitive 22): indexHashJoinInnerWorker.doJoinUnordered has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14, loops 4, match/switch 4 (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":"pkg/executor/join/index_lookup_hash_join.go"},"region":{"startLine":780}}}],"partialFingerprints":{"codehealthFindingId/v1":"e81ae0f987fb4f6f3efcd967bbacff42871c3d187715dc15e70861bbf770be2f"}},{"ruleId":"D2","level":"warning","message":{"text":"ParallelNestedLoopApplyExec.outerWorker (cognitive 22): ParallelNestedLoopApplyExec.outerWorker has cognitive complexity 22 (threshold 15). Drivers by points: match/switch 10, if/else 9, loops 3 (nesting depth added 13). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/parallel_apply.go"},"region":{"startLine":299}}}],"partialFingerprints":{"codehealthFindingId/v1":"ca57b859f8518262c3fd24ac03a47622d3709673b1a8eb1a9cc71c728a17d2fd"}},{"ruleId":"D2","level":"warning","message":{"text":"tableRegionSampler.buildSampleColAndDecodeColMap (cognitive 22): tableRegionSampler.buildSampleColAndDecodeColMap has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16, loops 4, boolean chains 2 (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/executor/sample.go"},"region":{"startLine":256}}}],"partialFingerprints":{"codehealthFindingId/v1":"e27c875622041e91968b1494e1382e6a76050f51c64024634f6a4a1eebdfb327"}},{"ruleId":"D2","level":"warning","message":{"text":"ShowExec.fetchSchedulingInfo (cognitive 22): ShowExec.fetchSchedulingInfo has cognitive complexity 22 (threshold 15). Drivers by points: if/else 18, loops 3, boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/show.go"},"region":{"startLine":2325}}}],"partialFingerprints":{"codehealthFindingId/v1":"5e6e4046bb264f024884161edd432af13aff0fa9f273a022c730de5073bc0b37"}},{"ruleId":"D2","level":"warning","message":{"text":"ShowExec.fetchShowDistributionJobs (cognitive 22): ShowExec.fetchShowDistributionJobs has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16, loops 5, 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":"pkg/executor/show.go"},"region":{"startLine":2616}}}],"partialFingerprints":{"codehealthFindingId/v1":"11611e7d1076ee09bdc82467fe5773b890d047c3ef643b78713683bd88505137"}},{"ruleId":"D2","level":"warning","message":{"text":"slowQueryRetriever.parseSlowLogByBatchGetterWithLimit (cognitive 22): slowQueryRetriever.parseSlowLogByBatchGetterWithLimit has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16, match/switch 5, loops 1 (nesting depth added 11). Of this number, 20 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, 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/executor/slow_query.go"},"region":{"startLine":728}}}],"partialFingerprints":{"codehealthFindingId/v1":"059270ea33731e00c5f87d377f6071e447f10bf4fd8ddd6a9c3986f98195cd15"}},{"ruleId":"D2","level":"warning","message":{"text":"UnionScanExec.Next (cognitive 22): UnionScanExec.Next has cognitive complexity 22 (threshold 15). Drivers by points: if/else 17, loops 3, boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/union_scan.go"},"region":{"startLine":139}}}],"partialFingerprints":{"codehealthFindingId/v1":"0d440a2d4b0e79d2dd07bd5dbfcd3b771c0c5e85c1fd53697477589ab1092302"}},{"ruleId":"D2","level":"warning","message":{"text":"UpdateExec.prepare (cognitive 22): UpdateExec.prepare has cognitive complexity 22 (threshold 15). Drivers by points: if/else 18, 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":"pkg/executor/update.go"},"region":{"startLine":85}}}],"partialFingerprints":{"codehealthFindingId/v1":"0edf22ecfebf4815a4d2a2db42559a3ddf17a49d493a4922efc57bc42c9a1057"}},{"ruleId":"D2","level":"warning","message":{"text":"concatFunction.Update (cognitive 22): concatFunction.Update has cognitive complexity 22 (threshold 15). Drivers by points: if/else 19, loops 2, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/aggregation/concat.go"},"region":{"startLine":62}}}],"partialFingerprints":{"codehealthFindingId/v1":"c801a0f5e6babaa962635f6ddd6e61eaa39aaecac79ecbd78f252456c7419af5"}},{"ruleId":"D2","level":"warning","message":{"text":"maxMinCountFunction.Update (cognitive 22): maxMinCountFunction.Update has cognitive complexity 22 (threshold 15). Drivers by points: if/else 18, boolean chains 4 (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/expression/aggregation/max_min_count.go"},"region":{"startLine":48}}}],"partialFingerprints":{"codehealthFindingId/v1":"fc89ceafeff22da965fd1c8a2c38904779406862a5a5fec2dcecd69abc215bc5"}},{"ruleId":"D2","level":"warning","message":{"text":"expression.safeConvert (cognitive 22): expression.safeConvert has cognitive complexity 22 (threshold 15). Drivers by points: if/else 19, boolean chains 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":"pkg/expression/collation.go"},"region":{"startLine":416}}}],"partialFingerprints":{"codehealthFindingId/v1":"8d70f96936a0e66ecab1d2733f3df959b6f6c2ae4c0df6d0d29cfbe89127d1d0"}},{"ruleId":"D2","level":"warning","message":{"text":"expression.ColumnInfos2ColumnsAndNamesWithCollate (cognitive 22): expression.ColumnInfos2ColumnsAndNamesWithCollate has cognitive complexity 22 (threshold 15). Drivers by points: if/else 20, loops 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/expression.go"},"region":{"startLine":1115}}}],"partialFingerprints":{"codehealthFindingId/v1":"279dc41249d9ac5950a2fe70215510927aaff82d410b3ab056975592b3e58ddf"}},{"ruleId":"D2","level":"warning","message":{"text":"expression.FindFieldName (cognitive 22): expression.FindFieldName has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16, boolean chains 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":"pkg/expression/simple_rewriter.go"},"region":{"startLine":65}}}],"partialFingerprints":{"codehealthFindingId/v1":"e89e80a6e784b00261ed3122a2a5ea87242139043016c1c418df1ae792885ace"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinCastRealAsDecimalSig.vecEvalDecimal (cognitive 22): builtinCastRealAsDecimalSig.vecEvalDecimal has cognitive complexity 22 (threshold 15). Drivers by points: if/else 20, 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":"pkg/expression/builtin_cast_vec.go"},"region":{"startLine":898}}}],"partialFingerprints":{"codehealthFindingId/v1":"4e451361f6bfe0e56002390cf8dd4abd0a61d997873655994cabf9912ede6ee9"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinCastStringAsTimeSig.vecEvalTime (cognitive 22): builtinCastStringAsTimeSig.vecEvalTime has cognitive complexity 22 (threshold 15). Drivers by points: if/else 19, boolean chains 2, 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/expression/builtin_cast_vec.go"},"region":{"startLine":1765}}}],"partialFingerprints":{"codehealthFindingId/v1":"6272e9d20a0da88ff9cd3e84b02a582da1b1531f0b81da786a2e7015a5d15f38"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinJSONExtractSig.vecEvalJSON (cognitive 22): builtinJSONExtractSig.vecEvalJSON has cognitive complexity 22 (threshold 15). Drivers by points: if/else 18, loops 4 (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/expression/builtin_json_vec.go"},"region":{"startLine":977}}}],"partialFingerprints":{"codehealthFindingId/v1":"02f2720c297d8b79c801e540b49e1f4460c28107b0747edcc1936667a9d6ef99"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinUUIDToBinSig.vecEvalString (cognitive 22): builtinUUIDToBinSig.vecEvalString has cognitive complexity 22 (threshold 15). Drivers by points: if/else 20, 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":"pkg/expression/builtin_miscellaneous_vec.go"},"region":{"startLine":806}}}],"partialFingerprints":{"codehealthFindingId/v1":"df06cd3108c9160a64a6d8a3100be98802d73f00cbb4f51935abb6188515b8bf"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinInDecimalSig.buildHashMapForConstArgs (cognitive 22): builtinInDecimalSig.buildHashMapForConstArgs has cognitive complexity 22 (threshold 15). Drivers by points: if/else 19, match/switch 2, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/builtin_other.go"},"region":{"startLine":553}}}],"partialFingerprints":{"codehealthFindingId/v1":"37d2fe268d51db675653210ac626f1aa5495fbb7e6b6926dba3f609135cb6807"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinFindInSetSig.vecEvalInt (cognitive 22): builtinFindInSetSig.vecEvalInt has cognitive complexity 22 (threshold 15). Drivers by points: if/else 19, loops 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":"pkg/expression/builtin_string_vec.go"},"region":{"startLine":1121}}}],"partialFingerprints":{"codehealthFindingId/v1":"2664f3b66fb4f453e8f34c693d2f75e296f91d84fde00421c491fc026995005d"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinDateFormatSig.vecEvalString (cognitive 22): builtinDateFormatSig.vecEvalString has cognitive complexity 22 (threshold 15). Drivers by points: if/else 18, boolean chains 3, 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":"pkg/expression/builtin_time_vec.go"},"region":{"startLine":1818}}}],"partialFingerprints":{"codehealthFindingId/v1":"f460397c965ed5fd613af92f49093a337880608bb87426e3bd89359ded0f2221"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinUnixTimestampDecSig.vecEvalDecimal (cognitive 22): builtinUnixTimestampDecSig.vecEvalDecimal has cognitive complexity 22 (threshold 15). Drivers by points: if/else 18, loops 4 (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":"pkg/expression/builtin_time_vec.go"},"region":{"startLine":1612}}}],"partialFingerprints":{"codehealthFindingId/v1":"d2ce9c5a584f47a1cd5c2d2e3107e3c37bb747774ea78f7bb3f15e995af05e8c"}},{"ruleId":"D2","level":"warning","message":{"text":"mydump.SplitLargeCSV (cognitive 22): mydump.SplitLargeCSV has cognitive complexity 22 (threshold 15). Drivers by points: if/else 17, loops 3, match/switch 2 (nesting depth added 8). Of this number, 13 points are the body\u0027s own statements and 9 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/lightning/mydump/region.go"},"region":{"startLine":506}}}],"partialFingerprints":{"codehealthFindingId/v1":"e731ca2d3e8fb4ceddffc96d51f8318b5435e82c4ceb4b4318cf117bbb1769d5"}},{"ruleId":"D2","level":"warning","message":{"text":"cardinality.recordUsedItemStatsStatus (cognitive 22): cardinality.recordUsedItemStatsStatus has cognitive complexity 22 (threshold 15). Drivers by points: if/else 19, boolean chains 2, 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":"pkg/planner/cardinality/trace.go"},"region":{"startLine":25}}}],"partialFingerprints":{"codehealthFindingId/v1":"c9cc48f8e35a2c6fd6c662c9d2bb8218acef341c01fe539258a3816a1de54b39"}},{"ruleId":"D2","level":"warning","message":{"text":"PossiblePropertiesInfo.Equals (cognitive 22): PossiblePropertiesInfo.Equals has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12, boolean chains 7, 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":"pkg/planner/core/base/plan_base.go"},"region":{"startLine":409}}}],"partialFingerprints":{"codehealthFindingId/v1":"1da1e2f44b001587788c37e2b713cb9396b10535175e96a1978136f58710dff1"}},{"ruleId":"D2","level":"warning","message":{"text":"core.preferMppBCJ (cognitive 22): core.preferMppBCJ has cognitive complexity 22 (threshold 15). Drivers by points: if/else 17, boolean chains 5 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/exhaust_physical_plans.go"},"region":{"startLine":1875}}}],"partialFingerprints":{"codehealthFindingId/v1":"980d4d7784715f581bac4acfb7e6a45ca679ddfdb881526612f6693e977b071d"}},{"ruleId":"D2","level":"warning","message":{"text":"core.setPreferredStoreType (cognitive 22): core.setPreferredStoreType has cognitive complexity 22 (threshold 15). Drivers by points: if/else 18, loops 4 (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":"pkg/planner/core/logical_plan_builder.go"},"region":{"startLine":586}}}],"partialFingerprints":{"codehealthFindingId/v1":"5ad63fe9c7bf52876b43dbf8a055a391959a572000cf2f2051372d09d8dedb17"}},{"ruleId":"D2","level":"warning","message":{"text":"core.CheckPrivilege (cognitive 22): core.CheckPrivilege has cognitive complexity 22 (threshold 15). Drivers by points: if/else 17, loops 4, boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/optimizer.go"},"region":{"startLine":185}}}],"partialFingerprints":{"codehealthFindingId/v1":"f0ced77b5bf961ef4d639ac340a28c79d7786ba3e0d1bd5410ad186989cdb9bc"}},{"ruleId":"D2","level":"warning","message":{"text":"core.extractTableNames (cognitive 22): core.extractTableNames has cognitive complexity 22 (threshold 15). Drivers by points: if/else 21, match/switch 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":"pkg/planner/core/plan_cacheable_checker.go"},"region":{"startLine":362}}}],"partialFingerprints":{"codehealthFindingId/v1":"88f6def8a258bbb59db4b17638623c72a5b6c7136994960d1738665f73436d9f"}},{"ruleId":"D2","level":"warning","message":{"text":"core.handleAnalyzeOptions (cognitive 22): core.handleAnalyzeOptions has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16, boolean chains 3, 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":"pkg/planner/core/planbuilder.go"},"region":{"startLine":3143}}}],"partialFingerprints":{"codehealthFindingId/v1":"fb3d2445c549cf0b08f9bd1462897e7500dfda2bf514e875fb791432a562d2e3"}},{"ruleId":"D2","level":"warning","message":{"text":"core.collectVisitInfoFromGrantStmt (cognitive 22): core.collectVisitInfoFromGrantStmt has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13, boolean chains 4, match/switch 3, loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/planbuilder.go"},"region":{"startLine":3952}}}],"partialFingerprints":{"codehealthFindingId/v1":"cd8d4ae71192e4e3cd626ea47da0a4e84d015225d69a573f0eefa85e4c6fe0f5"}},{"ruleId":"D2","level":"warning","message":{"text":"mppTaskGenerator.fillLocalCTECounts (cognitive 22): mppTaskGenerator.fillLocalCTECounts has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12, loops 10 (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":"pkg/planner/core/operator/physicalop/fragment.go"},"region":{"startLine":318}}}],"partialFingerprints":{"codehealthFindingId/v1":"55634d0e9f9e160c46d0c230fca82f3c1f74f106ea27f895ff54fae59d07fdd6"}},{"ruleId":"D2","level":"warning","message":{"text":"PlanBuilder.filterSkipColumnTypes (cognitive 22): PlanBuilder.filterSkipColumnTypes has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13, loops 6, boolean chains 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":"pkg/planner/core/planbuilder.go"},"region":{"startLine":2581}}}],"partialFingerprints":{"codehealthFindingId/v1":"d8f143eaee1a43ff027d0921b0efb583f1369e33f81654ea32df785f0576e3c9"}},{"ruleId":"D2","level":"warning","message":{"text":"PlanBuilder.resolveGeneratedColumns (cognitive 22): PlanBuilder.resolveGeneratedColumns has cognitive complexity 22 (threshold 15). Drivers by points: if/else 18, loops 3, boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/planbuilder.go"},"region":{"startLine":4059}}}],"partialFingerprints":{"codehealthFindingId/v1":"2ad898e20db340ba69fe6a5f4f632edb734027b1869eff3c1106e6714dd71e79"}},{"ruleId":"D2","level":"warning","message":{"text":"rule.scoreAndSort (cognitive 22): rule.scoreAndSort has cognitive complexity 22 (threshold 15). Drivers by points: if/else 19, boolean chains 2, loops 1 (nesting depth added 6). Most of this is not in the body itself: 7 of the 22 points are its own statements and the rest belongs to one function literal inside it that branches (line 586). 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":"pkg/planner/core/rule/rule_prune_indexes.go"},"region":{"startLine":557}}}],"partialFingerprints":{"codehealthFindingId/v1":"a2b675260f111861d9082aece742155e1f3ef211b719f73b2116cd87d5d3f8bb"}},{"ruleId":"D2","level":"warning","message":{"text":"plugin.Shutdown (cognitive 22): plugin.Shutdown has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16, loops 6 (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":"pkg/plugin/plugin.go"},"region":{"startLine":428}}}],"partialFingerprints":{"codehealthFindingId/v1":"bd5787f52e4836de179480bb13e88ea0ecbb4940677ca165505de182298813a4"}},{"ruleId":"D2","level":"warning","message":{"text":"clientConn.preprocessLoadDataLocal (cognitive 22): clientConn.preprocessLoadDataLocal has cognitive complexity 22 (threshold 15). Drivers by points: if/else 17, loops 5 (nesting depth added 10). Most of this is not in the body itself: 1 of the 22 points is its own statement and the rest belongs to one function literal inside it that branches (line 2314). 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":"pkg/server/conn.go"},"region":{"startLine":2308}}}],"partialFingerprints":{"codehealthFindingId/v1":"8f5697b2d2255c188d96214ad5e0f82ede2cc21ab59a059f4d72cb4e45c2734b"}},{"ruleId":"D2","level":"warning","message":{"text":"clientConn.handleStmtExecute (cognitive 22): clientConn.handleStmtExecute has cognitive complexity 22 (threshold 15). Drivers by points: if/else 22 (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":"pkg/server/conn_stmt.go"},"region":{"startLine":138}}}],"partialFingerprints":{"codehealthFindingId/v1":"74f1943bf838eb3a42f50bf69ef7ad93541dbcb6afe406c84d1c2ceded1a1f38"}},{"ruleId":"D2","level":"warning","message":{"text":"DXFTaskMaxRuntimeSlotsHandler.ServeHTTP (cognitive 22): DXFTaskMaxRuntimeSlotsHandler.ServeHTTP has cognitive complexity 22 (threshold 15). Drivers by points: if/else 19, loops 3 (nesting depth added 5). Most of this is not in the body itself: 9 of the 22 points are its own statements and the rest belongs to one function literal inside it that branches (line 445). 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":"pkg/server/handler/tikvhandler/dxf.go"},"region":{"startLine":440}}}],"partialFingerprints":{"codehealthFindingId/v1":"e14be6f1a0acd5c7ee7c1b356a49febefc4912e9185ada73a1516c760790eed6"}},{"ruleId":"D2","level":"warning","message":{"text":"MvccTxnHandler.handleMvccGetByKey (cognitive 22): MvccTxnHandler.handleMvccGetByKey has cognitive complexity 22 (threshold 15). Drivers by points: if/else 17, loops 5 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/server/handler/tikvhandler/tikv_handler.go"},"region":{"startLine":1725}}}],"partialFingerprints":{"codehealthFindingId/v1":"c85f7bda3c986baeab6f559951c12d461715cfdc32acf0949a8895ad9dee538d"}},{"ruleId":"D2","level":"warning","message":{"text":"TestServerClient.RunTestInfoschemaClientErrors (cognitive 22): TestServerClient.RunTestInfoschemaClientErrors has cognitive complexity 22 (threshold 15). Drivers by points: if/else 19, loops 3 (nesting depth added 14). Most of this is not in the body itself: 0 of the 22 points are its own statements and the rest belongs to one function literal inside it that branches (line 2601). 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":"pkg/server/internal/testserverclient/server_client.go"},"region":{"startLine":2600}}}],"partialFingerprints":{"codehealthFindingId/v1":"c8d10aa2b83121599a78fef162a51ecc347fe407d10dc4084629d2378e6c8495"}},{"ruleId":"D2","level":"warning","message":{"text":"Handle.initStatsHistograms4ChunkLite (cognitive 22): Handle.initStatsHistograms4ChunkLite has cognitive complexity 22 (threshold 15). Drivers by points: if/else 20, 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":"pkg/statistics/handle/bootstrap.go"},"region":{"startLine":137}}}],"partialFingerprints":{"codehealthFindingId/v1":"e3e9ddbf1c53ed98a0640eb880949c44cf721aecef43d4938e39b3889f34b9ec"}},{"ruleId":"D2","level":"warning","message":{"text":"storage.saveBucketsToStorage (cognitive 22): storage.saveBucketsToStorage has cognitive complexity 22 (threshold 15). Drivers by points: if/else 18, loops 3, boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/statistics/handle/storage/save.go"},"region":{"startLine":75}}}],"partialFingerprints":{"codehealthFindingId/v1":"d9886f4419c3c0414805c15b7575a9ff63272b326d1d64b809d1509a944f4ef6"}},{"ruleId":"D2","level":"warning","message":{"text":"Histogram.BinarySearchRemoveVal (cognitive 22): Histogram.BinarySearchRemoveVal has cognitive complexity 22 (threshold 15). Drivers by points: if/else 19, loops 3 (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/statistics/histogram.go"},"region":{"startLine":364}}}],"partialFingerprints":{"codehealthFindingId/v1":"ea70dd385a53a4bca82a99aa52d80415dd943c57a3657c6319664ffae31b3f45"}},{"ruleId":"D2","level":"warning","message":{"text":"txn.ExtractKeyExistsErrFromHandle (cognitive 22): txn.ExtractKeyExistsErrFromHandle has cognitive complexity 22 (threshold 15). Drivers by points: if/else 17, loops 3, boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/store/driver/txn/error.go"},"region":{"startLine":52}}}],"partialFingerprints":{"codehealthFindingId/v1":"f5805ea425d3a9a3c783483b7989caee007b6c82de6f267e03df246149fda519"}},{"ruleId":"D2","level":"warning","message":{"text":"rawHandler.RawScan (cognitive 22): rawHandler.RawScan has cognitive complexity 22 (threshold 15). Drivers by points: if/else 17, loops 4, boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/store/mockstore/unistore/raw_handler.go"},"region":{"startLine":110}}}],"partialFingerprints":{"codehealthFindingId/v1":"8c441de65015d57e65f61c54f575ae3dc6415af118d5f65d36455198eb19fe7f"}},{"ruleId":"D2","level":"warning","message":{"text":"MVCCStore.buildPrewriteLock (cognitive 22): MVCCStore.buildPrewriteLock has cognitive complexity 22 (threshold 15). Drivers by points: if/else 19, boolean chains 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":"pkg/store/mockstore/unistore/tikv/mvcc.go"},"region":{"startLine":1134}}}],"partialFingerprints":{"codehealthFindingId/v1":"fefa6dbb1d87dad26c252d14cb6b498424eed264e5113d71f31c10c3534f861d"}},{"ruleId":"D2","level":"warning","message":{"text":"ForListPruning.buildListColumnsPruner (cognitive 22): ForListPruning.buildListColumnsPruner has cognitive complexity 22 (threshold 15). Drivers by points: if/else 17, loops 4, boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/table/tables/partition.go"},"region":{"startLine":950}}}],"partialFingerprints":{"codehealthFindingId/v1":"69efa673a80d88466e4ea82597370662e958f16d278eb8a93063ec0f1fec2988"}},{"ruleId":"D2","level":"warning","message":{"text":"tablecodec.DecodeRowWithMap (cognitive 22): tablecodec.DecodeRowWithMap has cognitive complexity 22 (threshold 15). Drivers by points: if/else 20, boolean chains 1, 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/tablecodec/tablecodec.go"},"region":{"startLine":496}}}],"partialFingerprints":{"codehealthFindingId/v1":"011310c10025b6609f509e4f7dd35932ab0f6ced8c06be2ea732e30f882b45e5"}},{"ruleId":"D2","level":"warning","message":{"text":"testKitRows.Next (cognitive 22): testKitRows.Next has cognitive complexity 22 (threshold 15). Drivers by points: if/else 18, 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":"pkg/testkit/db_driver.go"},"region":{"startLine":228}}}],"partialFingerprints":{"codehealthFindingId/v1":"5f43f475d6336b947c481eff44ed90ebaea6e4e74271442be49bb6beb484ebcf"}},{"ruleId":"D2","level":"warning","message":{"text":"TimerGroupRuntime.loop (cognitive 22): TimerGroupRuntime.loop has cognitive complexity 22 (threshold 15). Drivers by points: if/else 19, match/switch 2, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/timer/runtime/runtime.go"},"region":{"startLine":165}}}],"partialFingerprints":{"codehealthFindingId/v1":"bede0ffc8354cb9db25659bacd93f25a3abb9f71134483403fea24d2c59121b0"}},{"ruleId":"D2","level":"warning","message":{"text":"InfoSchemaCache.Update (cognitive 22): InfoSchemaCache.Update has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15, loops 6, 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":"pkg/ttl/cache/infoschema.go"},"region":{"startLine":46}}}],"partialFingerprints":{"codehealthFindingId/v1":"b9bfeae02d66df670105bc9484d65b64df01b4b7adf37b4b5db058ab7c572c83"}},{"ruleId":"D2","level":"warning","message":{"text":"ttlTimerHook.waitJobFinished (cognitive 22): ttlTimerHook.waitJobFinished has cognitive complexity 22 (threshold 15). Drivers by points: if/else 18, match/switch 2, boolean chains 1, 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/ttl/ttlworker/timer.go"},"region":{"startLine":186}}}],"partialFingerprints":{"codehealthFindingId/v1":"d65762f472faab924c73153087ebc678ad6aef4e40e89f56d2c8f794ace11d9d"}},{"ruleId":"D2","level":"warning","message":{"text":"types.timestampDiff (cognitive 22): types.timestampDiff has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13, boolean chains 8, match/switch 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":"pkg/types/core_time.go"},"region":{"startLine":552}}}],"partialFingerprints":{"codehealthFindingId/v1":"8e8cfa88b006170c6efb300e13d5aef904877ed64a6df51bc6d6de482884af3a"}},{"ruleId":"D2","level":"warning","message":{"text":"types.DateTimeIsOverflow (cognitive 22): types.DateTimeIsOverflow has cognitive complexity 22 (threshold 15). Drivers by points: if/else 18, boolean chains 3, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/types/time.go"},"region":{"startLine":3478}}}],"partialFingerprints":{"codehealthFindingId/v1":"7b1fcabfaf6a03788c103552152a03f47c8b4bbd042d79310385a76e1a01d1ec"}},{"ruleId":"D2","level":"warning","message":{"text":"MyDecimal.ToString (cognitive 22): MyDecimal.ToString has cognitive complexity 22 (threshold 15). Drivers by points: loops 13, if/else 9 (nesting depth added 7). 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":"pkg/types/mydecimal.go"},"region":{"startLine":328}}}],"partialFingerprints":{"codehealthFindingId/v1":"d7969dbe5769c902590fa65b8c837aa32dcb9cccdb485c91fd4b8f91a9f3906f"}},{"ruleId":"D2","level":"warning","message":{"text":"codec.decodeBytes (cognitive 22): codec.decodeBytes has cognitive complexity 22 (threshold 15). Drivers by points: if/else 18, loops 4 (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/util/codec/bytes.go"},"region":{"startLine":90}}}],"partialFingerprints":{"codehealthFindingId/v1":"c27524f2949d0c1ee8ad6518c896b460926051c0faaec3c10235f11e85e95917"}},{"ruleId":"D2","level":"warning","message":{"text":"ranger.mergeTwoCNFRanges (cognitive 22): ranger.mergeTwoCNFRanges has cognitive complexity 22 (threshold 15). Drivers by points: if/else 20, boolean chains 2 (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/util/ranger/detacher.go"},"region":{"startLine":269}}}],"partialFingerprints":{"codehealthFindingId/v1":"1d4391a107b0a0864032d2c6471b648dc9662cf00589b4a122432d6afdf99d60"}},{"ruleId":"D2","level":"warning","message":{"text":"trieSelector.matchNode (cognitive 22): trieSelector.matchNode has cognitive complexity 22 (threshold 15). Drivers by points: if/else 19, 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":"pkg/util/table-rule-selector/trie_selector.go"},"region":{"startLine":586}}}],"partialFingerprints":{"codehealthFindingId/v1":"620f4faf78469812122fa1e27d12a3fa8dcbede57ebc47f12c58c741e7ef3c54"}},{"ruleId":"D2","level":"warning","message":{"text":"worker.createAllTables (cognitive 22): worker.createAllTables has cognitive complexity 22 (threshold 15). Drivers by points: if/else 21, 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/util/workloadrepo/table.go"},"region":{"startLine":103}}}],"partialFingerprints":{"codehealthFindingId/v1":"3b0344bb4eee93d34154984eabfa863f7b063b1371d5497a25c1e2fec2b81cc4"}},{"ruleId":"D2","level":"warning","message":{"text":"PlanReplayerStmt.Accept (cognitive 22): PlanReplayerStmt.Accept has cognitive complexity 22 (threshold 15). Drivers by points: if/else 22 (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/parser/ast/misc.go"},"region":{"startLine":403}}}],"partialFingerprints":{"codehealthFindingId/v1":"ac26085bb432c34785e0d68f8edb619ddc1f3bf3953112ce9052efc1e64aad2c"}},{"ruleId":"D2","level":"warning","message":{"text":"main.printRuleBody (cognitive 22): main.printRuleBody has cognitive complexity 22 (threshold 15). Drivers by points: if/else 19, match/switch 2, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/parser/goyacc/format_yacc.go"},"region":{"startLine":341}}}],"partialFingerprints":{"codehealthFindingId/v1":"8b5ce566bfa856ac57dffb34b7adeb968f9c794bce89d892e8207ef690fd2c4e"}},{"ruleId":"D2","level":"warning","message":{"text":"MyDecimal.ToString (cognitive 22): MyDecimal.ToString has cognitive complexity 22 (threshold 15). Drivers by points: loops 13, if/else 9 (nesting depth added 7). 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":"pkg/parser/test_driver/test_driver_mydecimal.go"},"region":{"startLine":108}}}],"partialFingerprints":{"codehealthFindingId/v1":"fd551572043efbb3b204f1df5a274edbe2930b0ceb9a6bc8615157ea74fdea96"}},{"ruleId":"D2","level":"warning","message":{"text":"main.Init (cognitive 21): main.Init has cognitive complexity 21 (threshold 15). Drivers by points: if/else 20, boolean chains 1 (nesting depth added 3). Most of this is not in the body itself: 0 of the 21 points are its own statements and the rest belongs to one function literal inside it that branches (line 225). 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":"br/cmd/br/cmd.go"},"region":{"startLine":224}}}],"partialFingerprints":{"codehealthFindingId/v1":"1e16ff9c02691da356178daf0b3af28513ba9129caa4fe5f06a786ca57d32df6"}},{"ruleId":"D2","level":"warning","message":{"text":"MetaWriter.flushMetasV2 (cognitive 21): MetaWriter.flushMetasV2 has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15, loops 5, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"br/pkg/metautil/metafile.go"},"region":{"startLine":1049}}}],"partialFingerprints":{"codehealthFindingId/v1":"e6574272c18429108e216ab098d332a604ed027efdb693e93d26f14f7f72801f"}},{"ruleId":"D2","level":"warning","message":{"text":"SnapClient.replaceTemporaryTableToSystable (cognitive 21): SnapClient.replaceTemporaryTableToSystable has cognitive complexity 21 (threshold 15). Drivers by points: if/else 18, loops 2, boolean chains 1 (nesting depth added 7). Of this number, 18 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":"br/pkg/restore/snap_client/systable_restore.go"},"region":{"startLine":485}}}],"partialFingerprints":{"codehealthFindingId/v1":"5fc23273006a320557d96ef96e204d9c6e2e4424293b085eecfc03ed2ceac4b7"}},{"ruleId":"D2","level":"warning","message":{"text":"SnapFileImporter.Import (cognitive 21): SnapFileImporter.Import has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14, loops 6, boolean chains 1 (nesting depth added 6). Of this number, 13 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":"br/pkg/restore/snap_client/import.go"},"region":{"startLine":475}}}],"partialFingerprints":{"codehealthFindingId/v1":"840d784999b2abdcb34cd08e45f8001d6ba57220325f7e02c732bbc7f34a9968"}},{"ruleId":"D2","level":"warning","message":{"text":"pdClient.WaitRegionsScattered (cognitive 21): pdClient.WaitRegionsScattered has cognitive complexity 21 (threshold 15). Drivers by points: if/else 19, boolean chains 1, loops 1 (nesting depth added 9). Most of this is not in the body itself: 0 of the 21 points are its own statements and the rest belongs to one function literal inside it that branches (line 979). 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":"br/pkg/restore/split/client.go"},"region":{"startLine":971}}}],"partialFingerprints":{"codehealthFindingId/v1":"515c6986d8a42c684941c21aa4232542bf6a70f29d00dfa629b3dd96e4497183"}},{"ruleId":"D2","level":"warning","message":{"text":"task.filterRestoreFiles (cognitive 21): task.filterRestoreFiles has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15, boolean chains 3, loops 3 (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":"br/pkg/task/restore.go"},"region":{"startLine":2150}}}],"partialFingerprints":{"codehealthFindingId/v1":"1fc8b223a800eb3fea4904f917b525bb58bfb6f916c24ab95f6cfd9319c9364b"}},{"ruleId":"D2","level":"warning","message":{"text":"task.PreCheckTableClusterIndex (cognitive 21): task.PreCheckTableClusterIndex has cognitive complexity 21 (threshold 15). Drivers by points: if/else 19, loops 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"br/pkg/task/restore.go"},"region":{"startLine":2508}}}],"partialFingerprints":{"codehealthFindingId/v1":"44f8633d02cb1a8d2f42bd9225cda426a443e433f73667d35f78bfb7d21f8313"}},{"ruleId":"D2","level":"warning","message":{"text":"task.buildRewriteRules (cognitive 21): task.buildRewriteRules has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14, loops 6, boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"br/pkg/task/stream.go"},"region":{"startLine":2273}}}],"partialFingerprints":{"codehealthFindingId/v1":"c994cbe75d21dcf3e3552f56958687e1c5f8af40e58154219a33808d2b0d2891"}},{"ruleId":"D2","level":"warning","message":{"text":"main.main (cognitive 21): main.main has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14, loops 4, boolean chains 2, match/switch 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":"cmd/importer/main.go"},"region":{"startLine":26}}}],"partialFingerprints":{"codehealthFindingId/v1":"34dede03ba806b33748c44aa6929b9483c5bcb15db1c40ba1b2d40c48d08f509"}},{"ruleId":"D2","level":"warning","message":{"text":"DefaultJobOrchestrator.submitAllJobs (cognitive 21): DefaultJobOrchestrator.submitAllJobs has cognitive complexity 21 (threshold 15). Drivers by points: if/else 17, boolean chains 3, loops 1 (nesting depth added 8). Most of this is not in the body itself: 4 of the 21 points are its own statements and the rest belongs to one function literal inside it that branches (line 339). 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":"lightning/pkg/importinto/job_orchestrator.go"},"region":{"startLine":318}}}],"partialFingerprints":{"codehealthFindingId/v1":"8555a925aefd1ff65dfb463f4490020844babe586197a79dee4f8b36849f84b6"}},{"ruleId":"D2","level":"warning","message":{"text":"state.Encode (cognitive 21): state.Encode has cognitive complexity 21 (threshold 15). Drivers by points: if/else 17, loops 4 (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/bindinfo/binding_plan_generation.go"},"region":{"startLine":148}}}],"partialFingerprints":{"codehealthFindingId/v1":"8f5b2c558ac8433374ce4d17095e01e97b2718975397511e7cc3376d7cd386e7"}},{"ruleId":"D2","level":"warning","message":{"text":"config.prepareErrorMessageExtensions (cognitive 21): config.prepareErrorMessageExtensions has cognitive complexity 21 (threshold 15). Drivers by points: if/else 20, loops 1 (nesting depth added 12). Of this number, 19 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":"pkg/config/config.go"},"region":{"startLine":1673}}}],"partialFingerprints":{"codehealthFindingId/v1":"5bd1da3229768a104df1da7873084c5876c494461b55e7eafc44e1ffef4b6770"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.validateAndFillRanges (cognitive 21): ddl.validateAndFillRanges has cognitive complexity 21 (threshold 15). Drivers by points: if/else 16, boolean chains 4, 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":"pkg/ddl/backfilling.go"},"region":{"startLine":598}}}],"partialFingerprints":{"codehealthFindingId/v1":"c453fd5b8d42b4c4a8b966199286b8de5272048f5d0555a7e11c0bbf058301cd"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.checkTableInfoValidWithStmt (cognitive 21): ddl.checkTableInfoValidWithStmt has cognitive complexity 21 (threshold 15). Drivers by points: if/else 20, 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":"pkg/ddl/create_table.go"},"region":{"startLine":511}}}],"partialFingerprints":{"codehealthFindingId/v1":"60100d21dfb4dbd1af4ec845f25db535d0f51bb64316e9571ecb4d18e258aee4"}},{"ruleId":"D2","level":"warning","message":{"text":"Rule.Reset (cognitive 21): Rule.Reset has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15, boolean chains 2, loops 2, match/switch 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":"pkg/ddl/label/rule.go"},"region":{"startLine":137}}}],"partialFingerprints":{"codehealthFindingId/v1":"a4ad3d7873e282a13079c70edf41cbeb509de54bb5a8db11d85d3360679214b7"}},{"ruleId":"D2","level":"warning","message":{"text":"placement.NewBundleFromSugarOptions (cognitive 21): placement.NewBundleFromSugarOptions has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12, loops 5, boolean chains 3, match/switch 1 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth \u2014 many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/placement/bundle.go"},"region":{"startLine":164}}}],"partialFingerprints":{"codehealthFindingId/v1":"e632c5b22a2ccd539e91eb971d19f038e35063c2bf426cc1207f2f20384675a4"}},{"ruleId":"D2","level":"warning","message":{"text":"placement.newRulesWithDictConstraints (cognitive 21): placement.newRulesWithDictConstraints has cognitive complexity 21 (threshold 15). Drivers by points: if/else 17, loops 4 (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":"pkg/ddl/placement/rule.go"},"region":{"startLine":147}}}],"partialFingerprints":{"codehealthFindingId/v1":"bb38c0d44f66497e531c4944acde53d78b3a65ac70a1ff1e22675ff96299ea00"}},{"ruleId":"D2","level":"warning","message":{"text":"Domain.decodePrivilegeEvent (cognitive 21): Domain.decodePrivilegeEvent has cognitive complexity 21 (threshold 15). Drivers by points: if/else 18, boolean chains 2, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/domain/domain.go"},"region":{"startLine":1322}}}],"partialFingerprints":{"codehealthFindingId/v1":"7449294567d3851329787169d5ea3114519c70d6b58c3a49632bf8f6464cf6f7"}},{"ruleId":"D2","level":"warning","message":{"text":"Domain.rebuildSysVarCache (cognitive 21): Domain.rebuildSysVarCache has cognitive complexity 21 (threshold 15). Drivers by points: if/else 18, boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/domain/sysvar_cache.go"},"region":{"startLine":114}}}],"partialFingerprints":{"codehealthFindingId/v1":"1b8eda5e984d7e2fdb631cd33239e6f2f7c971a474dd6526d559b23fb15d45e6"}},{"ruleId":"D2","level":"warning","message":{"text":"importinto.doSubmitTask (cognitive 21): importinto.doSubmitTask has cognitive complexity 21 (threshold 15). Drivers by points: if/else 20, boolean chains 1 (nesting depth added 5). Of this number, 11 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":"pkg/dxf/importinto/job.go"},"region":{"startLine":78}}}],"partialFingerprints":{"codehealthFindingId/v1":"8ba04fe2070146146a23f309c3834965e23f7d5dbf48395e7393d4b2599dd263"}},{"ruleId":"D2","level":"warning","message":{"text":"importinto.updateTaskSummary (cognitive 21): importinto.updateTaskSummary has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15, loops 5, match/switch 1 (nesting depth added 13). The drivers above price the dispatch low by construction \u2014 a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full \u2014 so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/dxf/importinto/scheduler.go"},"region":{"startLine":707}}}],"partialFingerprints":{"codehealthFindingId/v1":"4c858da53f988def3a0056f945863ac2b16f69d7ae3848f9bb2d0a09fb33bc45"}},{"ruleId":"D2","level":"warning","message":{"text":"executor.handleGlobalStats (cognitive 21): executor.handleGlobalStats has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10, loops 10, 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":"pkg/executor/analyze.go"},"region":{"startLine":923}}}],"partialFingerprints":{"codehealthFindingId/v1":"35f10762828d3b7382a9e39411234b229bcbb99a95fe198d852f49aa898bd9c1"}},{"ruleId":"D2","level":"warning","message":{"text":"ExecStmt.observeStmtBeginForTopProfiling (cognitive 21): ExecStmt.observeStmtBeginForTopProfiling has cognitive complexity 21 (threshold 15). Drivers by points: if/else 20, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/adapter.go"},"region":{"startLine":2411}}}],"partialFingerprints":{"codehealthFindingId/v1":"fa08f0783e5c62188e6a88fceb7c7fa9e4ed3173df4aaf091b56d76342e5df8f"}},{"ruleId":"D2","level":"warning","message":{"text":"aggfuncs.buildCount (cognitive 21): aggfuncs.buildCount has cognitive complexity 21 (threshold 15). Drivers by points: match/switch 13, if/else 8 (nesting depth added 12). 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/executor/aggfuncs/builder.go"},"region":{"startLine":211}}}],"partialFingerprints":{"codehealthFindingId/v1":"f89b753d23e6663f0ff5049f3bc80f52f12b5a23f075d899fea93be81fc961eb"}},{"ruleId":"D2","level":"warning","message":{"text":"AnalyzeColumnsExec.subMergeWorker (cognitive 21): AnalyzeColumnsExec.subMergeWorker has cognitive complexity 21 (threshold 15). Drivers by points: if/else 16, loops 3, match/switch 2 (nesting depth added 9). Of this number, 16 points are the body\u0027s own statements and 5 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":"pkg/executor/analyze_col_sampling.go"},"region":{"startLine":596}}}],"partialFingerprints":{"codehealthFindingId/v1":"a8fd1d680f5ebf6076e5163a3390b5f1ee93007b2ab022a538359f4197de1c24"}},{"ruleId":"D2","level":"warning","message":{"text":"dataDeliver.deliverLoop (cognitive 21): dataDeliver.deliverLoop has cognitive complexity 21 (threshold 15). Drivers by points: if/else 18, match/switch 2, loops 1 (nesting depth added 11). Most of this is not in the body itself: 9 of the 21 points are its own statements and the rest belongs to one function literal inside it that branches (line 526). 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":"pkg/executor/importer/chunk_process.go"},"region":{"startLine":495}}}],"partialFingerprints":{"codehealthFindingId/v1":"4c673bdc2a39bf33f918128575f2ce0fc82cfea04824215866afe9c163ba69fb"}},{"ruleId":"D2","level":"warning","message":{"text":"IndexMergeReaderExecutor.startPartialTableWorker (cognitive 21): IndexMergeReaderExecutor.startPartialTableWorker has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14, loops 3, boolean chains 2, match/switch 2 (nesting depth added 6). Most of this is not in the body itself: 6 of the 21 points are its own statements and the rest belongs to one function literal inside it that branches (line 537). 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":"pkg/executor/index_merge_reader.go"},"region":{"startLine":518}}}],"partialFingerprints":{"codehealthFindingId/v1":"6762372cdc250912eac50fef402862e2072fd06535ae41d6be6c55d70940ecb0"}},{"ruleId":"D2","level":"warning","message":{"text":"memtableRetriever.setDataFromReferConst (cognitive 21): memtableRetriever.setDataFromReferConst has cognitive complexity 21 (threshold 15). Drivers by points: if/else 16, 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":"pkg/executor/infoschema_reader.go"},"region":{"startLine":592}}}],"partialFingerprints":{"codehealthFindingId/v1":"1bd963d396de879bec0002171f5cbb8ac26a1ed1e252535e680640375a16c894"}},{"ruleId":"D2","level":"warning","message":{"text":"metricNode.initializeMetricValue (cognitive 21): metricNode.initializeMetricValue has cognitive complexity 21 (threshold 15). Drivers by points: if/else 17, loops 3, match/switch 1 (nesting depth added 4). Of this number, 17 points are the body\u0027s own statements and 4 belong to 3 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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":"pkg/executor/inspection_profile.go"},"region":{"startLine":199}}}],"partialFingerprints":{"codehealthFindingId/v1":"7ca880ed54d84a1cd58256e456a74a63d9c94212614e0891551878b1ad7f7e31"}},{"ruleId":"D2","level":"warning","message":{"text":"join.NewJoinProbe (cognitive 21): join.NewJoinProbe has cognitive complexity 21 (threshold 15). Drivers by points: if/else 17, loops 3, match/switch 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":"pkg/executor/join/base_join_probe.go"},"region":{"startLine":850}}}],"partialFingerprints":{"codehealthFindingId/v1":"571dc074b493ff4761bfb2f26a6c77bb142f2c243ffd985ce8b576e6f353e6ea"}},{"ruleId":"D2","level":"warning","message":{"text":"baseJoinProbe.buildResultAfterOtherCondition (cognitive 21): baseJoinProbe.buildResultAfterOtherCondition has cognitive complexity 21 (threshold 15). Drivers by points: if/else 16, loops 5 (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":"pkg/executor/join/base_join_probe.go"},"region":{"startLine":758}}}],"partialFingerprints":{"codehealthFindingId/v1":"16a6dccc4ef981f3339ba440b02865efc95e9774350f8313892d62158bc757f4"}},{"ruleId":"D2","level":"warning","message":{"text":"hashRowContainer.GetAllMatchedRows (cognitive 21): hashRowContainer.GetAllMatchedRows has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15, loops 4, boolean chains 2 (nesting depth added 9). Of this number, 20 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":"pkg/executor/join/hash_table_v1.go"},"region":{"startLine":183}}}],"partialFingerprints":{"codehealthFindingId/v1":"a3e8c2284574e020537d149b291a005fda2ffcc9e459277b5674aac370d68fa6"}},{"ruleId":"D2","level":"warning","message":{"text":"outerJoinProbe.probeForInnerSideBuild (cognitive 21): outerJoinProbe.probeForInnerSideBuild has cognitive complexity 21 (threshold 15). Drivers by points: if/else 19, boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/join/outer_join_probe.go"},"region":{"startLine":250}}}],"partialFingerprints":{"codehealthFindingId/v1":"346e1a5b93e01c6cbee406c47dc931c8cb8e3718be5b62a6bf30d5a91b4894bf"}},{"ruleId":"D2","level":"warning","message":{"text":"rowTableBuilder.appendToRowTable (cognitive 21): rowTableBuilder.appendToRowTable has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12, boolean chains 5, loops 4 (nesting depth added 7). Of this number, 18 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":"pkg/executor/join/row_table_builder.go"},"region":{"startLine":530}}}],"partialFingerprints":{"codehealthFindingId/v1":"5cbe6e26587e9bd97d98e9e5227a851bd313d685ee389e8f80326abe631416b3"}},{"ruleId":"D2","level":"warning","message":{"text":"PointGetExecutor.get (cognitive 21): PointGetExecutor.get has cognitive complexity 21 (threshold 15). Drivers by points: if/else 18, 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/executor/point_get.go"},"region":{"startLine":657}}}],"partialFingerprints":{"codehealthFindingId/v1":"082e0547f351bd03e0edcb4b405e91978e41a6aec8cc126b847337516af228c6"}},{"ruleId":"D2","level":"warning","message":{"text":"SetExecutor.setCharset (cognitive 21): SetExecutor.setCharset has cognitive complexity 21 (threshold 15). Drivers by points: if/else 18, 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":"pkg/executor/set.go"},"region":{"startLine":339}}}],"partialFingerprints":{"codehealthFindingId/v1":"97b45a5998b6952ae6998efb8e2463ea480e3fa3aea39de8a040a7d64a3aa704"}},{"ruleId":"D2","level":"warning","message":{"text":"PipelinedWindowExec.getStart (cognitive 21): PipelinedWindowExec.getStart has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15, loops 5, match/switch 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":"pkg/executor/windows/pipelined_window.go"},"region":{"startLine":261}}}],"partialFingerprints":{"codehealthFindingId/v1":"635618706f8c5cde37ec530e6d31ed825b0e634f96a4122b6543b3be1a09a5f1"}},{"ruleId":"D2","level":"warning","message":{"text":"PipelinedWindowExec.getEnd (cognitive 21): PipelinedWindowExec.getEnd has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15, loops 5, match/switch 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":"pkg/executor/windows/pipelined_window.go"},"region":{"startLine":301}}}],"partialFingerprints":{"codehealthFindingId/v1":"b20f224d0b5fba3d7e99b265805b7563000f712b3406fde79d37af1c59bf4ede"}},{"ruleId":"D2","level":"warning","message":{"text":"expression.resolveType4Extremum (cognitive 21): expression.resolveType4Extremum has cognitive complexity 21 (threshold 15). Drivers by points: if/else 16, boolean chains 3, 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":"pkg/expression/builtin_compare.go"},"region":{"startLine":451}}}],"partialFingerprints":{"codehealthFindingId/v1":"e801527c1d0d855497594bc28bd6880e4f51068e7b20167fc963a15d2b951df0"}},{"ruleId":"D2","level":"warning","message":{"text":"expression.addUnitToTime (cognitive 21): expression.addUnitToTime has cognitive complexity 21 (threshold 15). Drivers by points: if/else 20, match/switch 1 (nesting depth added 10). The drivers above price the dispatch low by construction \u2014 a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full \u2014 so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/builtin_time.go"},"region":{"startLine":6605}}}],"partialFingerprints":{"codehealthFindingId/v1":"a61f4a6b5303c5e74bbcf0e0b0fdbe6eb8ae643bf152cf2d9315de1464a19999"}},{"ruleId":"D2","level":"warning","message":{"text":"compareFunctionClass.generateCmpSigs (cognitive 21): compareFunctionClass.generateCmpSigs has cognitive complexity 21 (threshold 15). Drivers by points: match/switch 17, if/else 2, loops 2 (nesting depth added 9). 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/expression/builtin_compare.go"},"region":{"startLine":1994}}}],"partialFingerprints":{"codehealthFindingId/v1":"18d072c0415d60d8ec13a0863f837bfcd7e6bfe0e409d97eca1aceb15f40c977"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinConvSig.conv (cognitive 21): builtinConvSig.conv has cognitive complexity 21 (threshold 15). Drivers by points: if/else 16, boolean chains 5 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/builtin_math.go"},"region":{"startLine":1315}}}],"partialFingerprints":{"codehealthFindingId/v1":"d56df58c6b776b78bfb422bf47740441a756a26f9f813cc7950dd14e9333a69e"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinTimestampDiffSig.vecEvalInt (cognitive 21): builtinTimestampDiffSig.vecEvalInt has cognitive complexity 21 (threshold 15). Drivers by points: if/else 19, 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":"pkg/expression/builtin_time_vec.go"},"region":{"startLine":2260}}}],"partialFingerprints":{"codehealthFindingId/v1":"de11b4b8570cfe0558afd5abd557933577b9218ea5b8bf6dbccfe537da7d2683"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinMakeDateSig.vecEvalTime (cognitive 21): builtinMakeDateSig.vecEvalTime has cognitive complexity 21 (threshold 15). Drivers by points: if/else 18, boolean chains 2, 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":"pkg/expression/builtin_time_vec.go"},"region":{"startLine":1308}}}],"partialFingerprints":{"codehealthFindingId/v1":"b4062b0ecc556d19aecd774bf9777e1637092351a7604a8be976fcfeafdfb294"}},{"ruleId":"D2","level":"warning","message":{"text":"ScalarFunction.explainInfo (cognitive 21): ScalarFunction.explainInfo has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14, loops 4, boolean chains 2, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/explain.go"},"region":{"startLine":37}}}],"partialFingerprints":{"codehealthFindingId/v1":"d330e4afa837674314913315b4daec05c69b71e6e41db76d596c0aa4beaece63"}},{"ruleId":"D2","level":"warning","message":{"text":"testutil.RunEmbedderContract (cognitive 21): testutil.RunEmbedderContract has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15, boolean chains 5, loops 1 (nesting depth added 3). Most of this is not in the body itself: 1 of the 21 points is its own statement and the rest belongs to 6 function literals inside it that branch (lines 117, 95, 84, \u2026). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals\u0027 work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/inference/embedding/internal/testutil/testutil.go"},"region":{"startLine":70}}}],"partialFingerprints":{"codehealthFindingId/v1":"96bc16826453a9e629585b7ad5fe61ac8b8f8c1dafff41c80b6970e0decbaac9"}},{"ruleId":"D2","level":"warning","message":{"text":"infoschema.loadMaskingPoliciesWithTableIDs (cognitive 21): infoschema.loadMaskingPoliciesWithTableIDs has cognitive complexity 21 (threshold 15). Drivers by points: if/else 17, loops 3, boolean chains 1 (nesting depth added 5). Of this number, 14 points are the body\u0027s own statements and 7 belong to 2 function literals inside it that branch. To reduce it, 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":"pkg/infoschema/infoschema.go"},"region":{"startLine":753}}}],"partialFingerprints":{"codehealthFindingId/v1":"99194dcf2a678e2b7dfbeccc66ea5aa4e418717ad58afd974f314334635e63d6"}},{"ruleId":"D2","level":"warning","message":{"text":"infoSchema.loadMaskingPoliciesIfNeeded (cognitive 21): infoSchema.loadMaskingPoliciesIfNeeded has cognitive complexity 21 (threshold 15). Drivers by points: if/else 17, loops 4 (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/infoschema/infoschema.go"},"region":{"startLine":691}}}],"partialFingerprints":{"codehealthFindingId/v1":"c62642d19038be5d39e2994eb61ebe89446d1fd0512b9b79c05c9c8e9f5dbbd9"}},{"ruleId":"D2","level":"warning","message":{"text":"Syncer.Reload (cognitive 21): Syncer.Reload has cognitive complexity 21 (threshold 15). Drivers by points: if/else 19, boolean chains 2 (nesting depth added 7). Of this number, 18 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":"pkg/infoschema/issyncer/syncer.go"},"region":{"startLine":409}}}],"partialFingerprints":{"codehealthFindingId/v1":"3942b39a2d4f8524eac2462ba48ed0f4d7767bf0fcef2181238d8788a27c15ba"}},{"ruleId":"D2","level":"warning","message":{"text":"dupeDetector.processRemoteDupTask (cognitive 21): dupeDetector.processRemoteDupTask has cognitive complexity 21 (threshold 15). Drivers by points: if/else 19, boolean chains 1, 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":"pkg/ingestor/ingestctrl/duplicate.go"},"region":{"startLine":1045}}}],"partialFingerprints":{"codehealthFindingId/v1":"9e4bb8d030b5a510c8fe7d04fc04055a2bf5fd2fbcc43a722d8aedeb9ba3efe3"}},{"ruleId":"D2","level":"warning","message":{"text":"mydump.MakeTableRegions (cognitive 21): mydump.MakeTableRegions has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14, loops 4, match/switch 2, boolean chains 1 (nesting depth added 7). Most of this is not in the body itself: 8 of the 21 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 239, 287). 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":"pkg/lightning/mydump/region.go"},"region":{"startLine":211}}}],"partialFingerprints":{"codehealthFindingId/v1":"4286454f59161acedf020133b4a7ec3940c3240f5de0dea7b2fa520884d770e9"}},{"ruleId":"D2","level":"warning","message":{"text":"cardinality.pseudoSelectivity (cognitive 21): cardinality.pseudoSelectivity has cognitive complexity 21 (threshold 15). Drivers by points: if/else 16, loops 2, match/switch 2, boolean chains 1 (nesting depth added 8). Of this number, 15 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":"pkg/planner/cardinality/pseudo.go"},"region":{"startLine":41}}}],"partialFingerprints":{"codehealthFindingId/v1":"af8c5dc4b16cae5ee07b64e2951914c9a411d5fa2b9df3ab0e28aea3cec6a7d0"}},{"ruleId":"D2","level":"warning","message":{"text":"cardinality.CalcTotalSelectivityForMVIdxPath (cognitive 21): cardinality.CalcTotalSelectivityForMVIdxPath has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11, loops 8, boolean chains 2 (nesting depth added 10). Of this number, 20 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":"pkg/planner/cardinality/selectivity.go"},"region":{"startLine":445}}}],"partialFingerprints":{"codehealthFindingId/v1":"caf0694ad16f4f2a8ace3dab497fc00b545631342a7af6078f7da73eb9b12d89"}},{"ruleId":"D2","level":"warning","message":{"text":"core.handleForceIndexJoinHints (cognitive 21): core.handleForceIndexJoinHints has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11, boolean chains 7, match/switch 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/exhaust_physical_plans.go"},"region":{"startLine":1724}}}],"partialFingerprints":{"codehealthFindingId/v1":"4d1e2ebf19000156925e1acb9d94bf43f38e5b75580e3847a2e2ce2708bf9796"}},{"ruleId":"D2","level":"warning","message":{"text":"core.isSafePointGetPath4PlanCacheScenario3 (cognitive 21): core.isSafePointGetPath4PlanCacheScenario3 has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12, loops 4, boolean chains 3, 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":"pkg/planner/core/plan_cache_utils.go"},"region":{"startLine":937}}}],"partialFingerprints":{"codehealthFindingId/v1":"6e8424881e5b60d5c29f19e700f70251bdff8828ba16b75b633ddb657967a86c"}},{"ruleId":"D2","level":"warning","message":{"text":"core.canProjectionBeEliminatedStrict (cognitive 21): core.canProjectionBeEliminatedStrict has cognitive complexity 21 (threshold 15). Drivers by points: if/else 17, boolean chains 3, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/rule_eliminate_projection.go"},"region":{"startLine":52}}}],"partialFingerprints":{"codehealthFindingId/v1":"79a592a3fcaaed86be9c98362fef924ec62379c8fa92ac407c9a44860f9bff9b"}},{"ruleId":"D2","level":"warning","message":{"text":"core.unionAllEliminateDualItem (cognitive 21): core.unionAllEliminateDualItem has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15, boolean chains 3, loops 3 (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/planner/core/rule_eliminate_unionall_dual_item.go"},"region":{"startLine":40}}}],"partialFingerprints":{"codehealthFindingId/v1":"b11ccac0b4b33b3ec1dec13ca79dd1e0a007dd8d7c0abe7c83c4b5c93c2f0363"}},{"ruleId":"D2","level":"warning","message":{"text":"core.substituteExpression (cognitive 21): core.substituteExpression has cognitive complexity 21 (threshold 15). Drivers by points: loops 11, if/else 8, boolean chains 1, match/switch 1 (nesting depth added 9). Of this number, 18 points are the body\u0027s own statements and 3 belong to 2 function literals inside it that branch. To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/rule_generate_column_substitute.go"},"region":{"startLine":116}}}],"partialFingerprints":{"codehealthFindingId/v1":"957c8f2070b3c83c9fb5cc8900eab37c07221e4a14b9ba00ed46ad5d1ae09331"}},{"ruleId":"D2","level":"warning","message":{"text":"logicalop.setPreferredJoinTypeFromOneSide (cognitive 21): logicalop.setPreferredJoinTypeFromOneSide has cognitive complexity 21 (threshold 15). Drivers by points: if/else 21 (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":"pkg/planner/core/operator/logicalop/logical_join.go"},"region":{"startLine":2059}}}],"partialFingerprints":{"codehealthFindingId/v1":"330377450be9ac1f70dd3f78938ecdc8f52cb29b63a67657db5c5259926492db"}},{"ruleId":"D2","level":"warning","message":{"text":"LogicalCTE.DeriveStats (cognitive 21): LogicalCTE.DeriveStats has cognitive complexity 21 (threshold 15). Drivers by points: if/else 17, loops 3, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/operator/logicalop/logical_cte.go"},"region":{"startLine":172}}}],"partialFingerprints":{"codehealthFindingId/v1":"09574cdd3cf98e1d314cffe7f321110825969b4b34821e2d856ba564cf96bd77"}},{"ruleId":"D2","level":"warning","message":{"text":"physicalop.RemoveUnnecessaryFirstRow (cognitive 21): physicalop.RemoveUnnecessaryFirstRow has cognitive complexity 21 (threshold 15). Drivers by points: if/else 17, loops 4 (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":"pkg/planner/core/operator/physicalop/base_physical_agg.go"},"region":{"startLine":465}}}],"partialFingerprints":{"codehealthFindingId/v1":"39fc84f249e0a4031e1a5d82d6a2f74a116c25b5d025f733fc1e9a9b1dfecdce"}},{"ruleId":"D2","level":"warning","message":{"text":"physicalop.EncodeUniqueIndexValuesForKey (cognitive 21): physicalop.EncodeUniqueIndexValuesForKey has cognitive complexity 21 (threshold 15). Drivers by points: if/else 16, boolean chains 4, 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":"pkg/planner/core/operator/physicalop/physical_utils.go"},"region":{"startLine":221}}}],"partialFingerprints":{"codehealthFindingId/v1":"c197a57490a17417730f9fbdd26774c48a171d0e2d42c5dd4a61b1b3a2ac6f11"}},{"ruleId":"D2","level":"warning","message":{"text":"PartitionProcessor.makeUnionAllChildren (cognitive 21): PartitionProcessor.makeUnionAllChildren has cognitive complexity 21 (threshold 15). Drivers by points: if/else 18, loops 3 (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":"pkg/planner/core/rule/rule_partition_processor.go"},"region":{"startLine":1891}}}],"partialFingerprints":{"codehealthFindingId/v1":"6523327f8b6549cacbf0fa9b2945d7db5580430f9fa210a17b712bf086d836e8"}},{"ruleId":"D2","level":"warning","message":{"text":"optimizerImpl.addHypoIndex (cognitive 21): optimizerImpl.addHypoIndex has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15, 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":"pkg/planner/indexadvisor/optimizer.go"},"region":{"startLine":172}}}],"partialFingerprints":{"codehealthFindingId/v1":"da069edaac7adaee14b966d712812f42e6f8960889e4fd63a2882040beda834e"}},{"ruleId":"D2","level":"warning","message":{"text":"ExprIter.Next (cognitive 21): ExprIter.Next has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14, loops 6, 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":"pkg/planner/memo/expr_iterator.go"},"region":{"startLine":44}}}],"partialFingerprints":{"codehealthFindingId/v1":"724635edb42e40fbaa0e59adc0ffc3323ca129fe0d26f4c5b3d3b25751f90dc1"}},{"ruleId":"D2","level":"warning","message":{"text":"MySQLPrivilege.HasExplicitlyGrantedDynamicPrivilege (cognitive 21): MySQLPrivilege.HasExplicitlyGrantedDynamicPrivilege has cognitive complexity 21 (threshold 15). Drivers by points: if/else 16, loops 4, 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":"pkg/privilege/privileges/cache.go"},"region":{"startLine":1587}}}],"partialFingerprints":{"codehealthFindingId/v1":"ec3a547eb8d655fbbc6983e84b3eac8d7b4f7d7cd324b4a6971c91955c66859e"}},{"ruleId":"D2","level":"warning","message":{"text":"clientConn.addQueryMetrics (cognitive 21): clientConn.addQueryMetrics has cognitive complexity 21 (threshold 15). Drivers by points: if/else 16, boolean chains 4, 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":"pkg/server/conn.go"},"region":{"startLine":1378}}}],"partialFingerprints":{"codehealthFindingId/v1":"444ee5917e5baea4b89d99a605574a40c0b296184e4006f413fbc279f06453a3"}},{"ruleId":"D2","level":"warning","message":{"text":"TiDBStatement.Close (cognitive 21): TiDBStatement.Close has cognitive complexity 21 (threshold 15). Drivers by points: if/else 19, 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":"pkg/server/driver_tidb.go"},"region":{"startLine":248}}}],"partialFingerprints":{"codehealthFindingId/v1":"7772e1c0a53b7aa9c63c3ed7dee63627abbe1daea7fe8600a303ba1d485f8be6"}},{"ruleId":"D2","level":"warning","message":{"text":"RegionDetail.addTableInRange (cognitive 21): RegionDetail.addTableInRange has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14, loops 6, boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/server/handler/tikvhandler/tikv_handler.go"},"region":{"startLine":394}}}],"partialFingerprints":{"codehealthFindingId/v1":"4bb7aea2bea10a3e1e393b8696697b02660f4175b772bdb6dc1674ec3deef0ea"}},{"ruleId":"D2","level":"warning","message":{"text":"column.ConvertColumnInfo (cognitive 21): column.ConvertColumnInfo has cognitive complexity 21 (threshold 15). Drivers by points: if/else 20, 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":"pkg/server/internal/column/convert.go"},"region":{"startLine":25}}}],"partialFingerprints":{"codehealthFindingId/v1":"867d81b5ca5305993e40920bdfb5605544ec3eba2d9dd76eda66351f6d817eb1"}},{"ruleId":"D2","level":"warning","message":{"text":"session.doCommitWithRetry (cognitive 21): session.doCommitWithRetry has cognitive complexity 21 (threshold 15). Drivers by points: if/else 19, boolean chains 2 (nesting depth added 6). Of this number, 16 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":"pkg/session/session.go"},"region":{"startLine":808}}}],"partialFingerprints":{"codehealthFindingId/v1":"a09ee252cd854abaf74830cf7acce68c13aaed311db54824b12c75b97fc93cb1"}},{"ruleId":"D2","level":"warning","message":{"text":"session.loadCommonGlobalVariablesIfNeeded (cognitive 21): session.loadCommonGlobalVariablesIfNeeded has cognitive complexity 21 (threshold 15). Drivers by points: if/else 20, 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/session/session.go"},"region":{"startLine":5015}}}],"partialFingerprints":{"codehealthFindingId/v1":"8a270ab61a6be7c1bf910ae8de7cf16c80c5dc78f2d083ee6613f25f517cbf18"}},{"ruleId":"D2","level":"warning","message":{"text":"UsedStatsInfoForTable.collectFromColOrIdxStatus (cognitive 21): UsedStatsInfoForTable.collectFromColOrIdxStatus has cognitive complexity 21 (threshold 15). Drivers by points: if/else 19, boolean chains 1, 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/sessionctx/stmtctx/stmtctx.go"},"region":{"startLine":1543}}}],"partialFingerprints":{"codehealthFindingId/v1":"4dbe17c6dc8114fcbd067e5c04230d09daf19acc2435bd6572f7c477dfde1fbf"}},{"ruleId":"D2","level":"warning","message":{"text":"AsyncMergePartitionStats2GlobalStats.dealHistogramAndTopN (cognitive 21): AsyncMergePartitionStats2GlobalStats.dealHistogramAndTopN has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14, loops 5, match/switch 2 (nesting depth added 12). Of this number, 19 points are the body\u0027s own statements and 2 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":"pkg/statistics/handle/globalstats/global_stats_async.go"},"region":{"startLine":493}}}],"partialFingerprints":{"codehealthFindingId/v1":"a8794334f1033c029d460840ba78ba806fe7ece2d62dc099479ffd4117563ffa"}},{"ruleId":"D2","level":"warning","message":{"text":"HistColl.GenerateHistCollFromColumnInfo (cognitive 21): HistColl.GenerateHistCollFromColumnInfo 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":"pkg/statistics/table.go"},"region":{"startLine":931}}}],"partialFingerprints":{"codehealthFindingId/v1":"da25d815d2c5b53b0e6f6bc45d9ed8ce65f747c5b216c174f801ddae6ea8b03e"}},{"ruleId":"D2","level":"warning","message":{"text":"copIteratorWorker.handleTask (cognitive 21): copIteratorWorker.handleTask has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15, loops 5, boolean chains 1 (nesting depth added 9). Of this number, 19 points are the body\u0027s own statements and 2 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":"pkg/store/copr/coprocessor.go"},"region":{"startLine":1660}}}],"partialFingerprints":{"codehealthFindingId/v1":"fd2c373e5d0ae0f470435303388d4f70c47a4e23c1cf09f9136587d6ad2e6f18"}},{"ruleId":"D2","level":"warning","message":{"text":"LocationKeyRanges.splitKeyRangesByBuckets (cognitive 21): LocationKeyRanges.splitKeyRangesByBuckets has cognitive complexity 21 (threshold 15). Drivers by points: if/else 16, 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":"pkg/store/copr/region_cache.go"},"region":{"startLine":528}}}],"partialFingerprints":{"codehealthFindingId/v1":"44db19ea698b691fd7299cecd873d44245b656308688de65116d202bb81e101b"}},{"ruleId":"D2","level":"warning","message":{"text":"GCWorker.checkLeader (cognitive 21): GCWorker.checkLeader has cognitive complexity 21 (threshold 15). Drivers by points: if/else 20, 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":"pkg/store/gcworker/gc_worker.go"},"region":{"startLine":1487}}}],"partialFingerprints":{"codehealthFindingId/v1":"5f7cbc1cba5a1aee560ff788b39b56518de42d4e033d5f64f8a914e379df376c"}},{"ruleId":"D2","level":"warning","message":{"text":"indexScanExec.next (cognitive 21): indexScanExec.next has cognitive complexity 21 (threshold 15). Drivers by points: if/else 21 (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/store/mockstore/unistore/cophandler/mpp_exec.go"},"region":{"startLine":417}}}],"partialFingerprints":{"codehealthFindingId/v1":"e594f15388bab7ccce0a5b3721b48df7592750897f8369acdbf9657ccc78570b"}},{"ruleId":"D2","level":"warning","message":{"text":"MVCCStore.CheckSecondaryLocks (cognitive 21): MVCCStore.CheckSecondaryLocks has cognitive complexity 21 (threshold 15). Drivers by points: if/else 19, boolean chains 1, 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":"pkg/store/mockstore/unistore/tikv/mvcc.go"},"region":{"startLine":590}}}],"partialFingerprints":{"codehealthFindingId/v1":"aa94a929a0e74c65d5279a9a3489b057205e23e53fa76be9beb99d9b2c8bafbd"}},{"ruleId":"D2","level":"warning","message":{"text":"MVCCStore.prewriteMutations (cognitive 21): MVCCStore.prewriteMutations has cognitive complexity 21 (threshold 15). Drivers by points: if/else 17, boolean chains 3, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/store/mockstore/unistore/tikv/mvcc.go"},"region":{"startLine":935}}}],"partialFingerprints":{"codehealthFindingId/v1":"a433469939f4606481eac91468e605dd43854f6cb5f1d7e438ea07061eb91e85"}},{"ruleId":"D2","level":"warning","message":{"text":"writeLockWorker.run (cognitive 21): writeLockWorker.run has cognitive complexity 21 (threshold 15). Drivers by points: loops 10, match/switch 6, if/else 5 (nesting depth added 13). 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":"pkg/store/mockstore/unistore/tikv/write.go"},"region":{"startLine":141}}}],"partialFingerprints":{"codehealthFindingId/v1":"f4bf85528566fe31aef4c13f1980e9067ec2fdd7f124731b09f68c8c2d71b6eb"}},{"ruleId":"D2","level":"warning","message":{"text":"stateRemoteHandle.lockForWriteOnce (cognitive 21): stateRemoteHandle.lockForWriteOnce has cognitive complexity 21 (threshold 15). Drivers by points: if/else 19, boolean chains 1, match/switch 1 (nesting depth added 9). Most of this is not in the body itself: 2 of the 21 points are its own statements and the rest belongs to one function literal inside it that branches (line 188). 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":"pkg/table/tables/state_remote.go"},"region":{"startLine":180}}}],"partialFingerprints":{"codehealthFindingId/v1":"d6a43a38f3b8ca578d081a69cb9b10ef48e0c939291c414893c80adcc7428d12"}},{"ruleId":"D2","level":"warning","message":{"text":"PhysicalTable.splitIntRanges (cognitive 21): PhysicalTable.splitIntRanges has cognitive complexity 21 (threshold 15). Drivers by points: if/else 16, boolean chains 4, 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/ttl/cache/table.go"},"region":{"startLine":340}}}],"partialFingerprints":{"codehealthFindingId/v1":"c25f86bc99bb934875f5a12e67e0973e489936a6cabd3ef996764070897293d7"}},{"ruleId":"D2","level":"warning","message":{"text":"types.parseTimeValue (cognitive 21): types.parseTimeValue has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12, boolean chains 7, loops 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":"pkg/types/time.go"},"region":{"startLine":2442}}}],"partialFingerprints":{"codehealthFindingId/v1":"e71cac9479bf1f3190f3b640c31455934c272f6a375f4d0b8971bafa1473ae0e"}},{"ruleId":"D2","level":"warning","message":{"text":"MyDecimal.FromParquetArray (cognitive 21): MyDecimal.FromParquetArray has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10, loops 9, boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/types/mydecimal.go"},"region":{"startLine":1005}}}],"partialFingerprints":{"codehealthFindingId/v1":"5f0012b7eb65848100d2a8dc8d08626a99faeebfc41ce0496c5c8c964adf74d2"}},{"ruleId":"D2","level":"warning","message":{"text":"cgroup.getCgroupDetails (cognitive 21): cgroup.getCgroupDetails has cognitive complexity 21 (threshold 15). Drivers by points: if/else 19, boolean chains 1, loops 1 (nesting depth added 9). Of this number, 20 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":"pkg/util/cgroup/cgroup.go"},"region":{"startLine":228}}}],"partialFingerprints":{"codehealthFindingId/v1":"0e279e68b4f443e2bb34ace59130345dd4227af6dea6536d4d8087ae13984154"}},{"ruleId":"D2","level":"warning","message":{"text":"codec.EncodeHashChunkRowIdx (cognitive 21): codec.EncodeHashChunkRowIdx has cognitive complexity 21 (threshold 15). Drivers by points: if/else 19, boolean chains 1, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/util/codec/codec.go"},"region":{"startLine":346}}}],"partialFingerprints":{"codehealthFindingId/v1":"6b49c08075a0a7b1eee40889602300c87ed7385d17dc01316817215994717647"}},{"ruleId":"D2","level":"warning","message":{"text":"cet.getImplicitWeight0900 (cognitive 21): cet.getImplicitWeight0900 has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 13, if/else 6, loops 2 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/util/collate/ucadata/generator/main.go"},"region":{"startLine":309}}}],"partialFingerprints":{"codehealthFindingId/v1":"18a74d9136afaf2eabb0565e44ec2d2b2313538a72c172b9044aac22a1e968df"}},{"ruleId":"D2","level":"warning","message":{"text":"util.parseServiceURL (cognitive 21): util.parseServiceURL has cognitive complexity 21 (threshold 15). Drivers by points: if/else 19, 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":"pkg/util/service_url.go"},"region":{"startLine":47}}}],"partialFingerprints":{"codehealthFindingId/v1":"4c95cf7cbffbdef9f07c0687b493c59cad0f172f7c979ee22fe314dd28718289"}},{"ruleId":"D2","level":"warning","message":{"text":"Filter.initTableRule (cognitive 21): Filter.initTableRule has cognitive complexity 21 (threshold 15). Drivers by points: if/else 18, boolean chains 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":"pkg/util/filter/filter.go"},"region":{"startLine":182}}}],"partialFingerprints":{"codehealthFindingId/v1":"1b1f4ce915925df3f2e479b7974687df8fe75486ca2b35d9e5f609dc9cd4d2b7"}},{"ruleId":"D2","level":"warning","message":{"text":"MemArbitrator.doExecuteCleanupTasks (cognitive 21): MemArbitrator.doExecuteCleanupTasks has cognitive complexity 21 (threshold 15). Drivers by points: if/else 20, 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":"pkg/util/memory/arbitrator.go"},"region":{"startLine":1910}}}],"partialFingerprints":{"codehealthFindingId/v1":"a72d6a53bd982cf55424a004df9d6311b7078dcf3bd0aea552ce37d94b779a24"}},{"ruleId":"D2","level":"warning","message":{"text":"memArbitrator.intoBigBudget (cognitive 21): memArbitrator.intoBigBudget has cognitive complexity 21 (threshold 15). Drivers by points: if/else 20, boolean chains 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":"pkg/util/memory/tracker.go"},"region":{"startLine":1109}}}],"partialFingerprints":{"codehealthFindingId/v1":"903f04ac435808aa107f4dda13e922a5ab3f7b49429203fa6aa6bab735edb4d7"}},{"ruleId":"D2","level":"warning","message":{"text":"plancodec.decodePlanInfo (cognitive 21): plancodec.decodePlanInfo has cognitive complexity 21 (threshold 15). Drivers by points: if/else 17, 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":"pkg/util/plancodec/codec.go"},"region":{"startLine":297}}}],"partialFingerprints":{"codehealthFindingId/v1":"e2073046b26b8f0d29200a8e81ae7def66d9cb308400dedb66b14a623806bfda"}},{"ruleId":"D2","level":"warning","message":{"text":"stmtSummaryByDigestEvicted.AddEvicted (cognitive 21): stmtSummaryByDigestEvicted.AddEvicted has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8, loops 5, jumps 3, match/switch 3, boolean chains 2 (nesting depth added 8). Most of this is not in the body itself: 6 of the 21 points are its own statements and the rest belongs to one function literal inside it that branches (line 91). 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":"pkg/util/stmtsummary/evicted.go"},"region":{"startLine":73}}}],"partialFingerprints":{"codehealthFindingId/v1":"7e40d19fb6c94787e3a004341b9a6ee7dcf69f50865fdee2ced5fc96f9a53e16"}},{"ruleId":"D2","level":"warning","message":{"text":"timeutil.ParseTimeZone (cognitive 21): timeutil.ParseTimeZone has cognitive complexity 21 (threshold 15). Drivers by points: if/else 20, boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/util/timeutil/time_zone.go"},"region":{"startLine":247}}}],"partialFingerprints":{"codehealthFindingId/v1":"31162ec9fa70d8603be7fdca3361ee5682be993f516dff402c9bdcf4de2e7984"}},{"ruleId":"D2","level":"warning","message":{"text":"ast.IsReadOnly (cognitive 21): ast.IsReadOnly has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10, match/switch 6, loops 4, boolean chains 1 (nesting depth added 11). 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":"pkg/parser/ast/util.go"},"region":{"startLine":26}}}],"partialFingerprints":{"codehealthFindingId/v1":"3d18c18aede8d6b3a1b14fa4c3b152410f2ddcc5e31019219be74bf25bed61d0"}},{"ruleId":"D2","level":"warning","message":{"text":"ReferenceDef.Restore (cognitive 21): ReferenceDef.Restore has cognitive complexity 21 (threshold 15). Drivers by points: if/else 17, 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":"pkg/parser/ast/ddl.go"},"region":{"startLine":375}}}],"partialFingerprints":{"codehealthFindingId/v1":"02f460986f2ef8caad9976f1ed38137f2231144dbee214b309f0309310ad648a"}},{"ruleId":"D2","level":"warning","message":{"text":"FieldType.Restore (cognitive 21): FieldType.Restore has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14, boolean chains 4, loops 2, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/parser/types/field_type.go"},"region":{"startLine":566}}}],"partialFingerprints":{"codehealthFindingId/v1":"8687231938204f5b3f89c57b9e638959f88bcac313ebb223bd6574798b51f502"}},{"ruleId":"D2","level":"warning","message":{"text":"main.runRestoreCommand (cognitive 20): main.runRestoreCommand has cognitive complexity 20 (threshold 15). Drivers by points: if/else 18, 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":"br/cmd/br/restore.go"},"region":{"startLine":29}}}],"partialFingerprints":{"codehealthFindingId/v1":"3f4053678e5c9a30ea74e50d6515730496ed9628979a88c6aedb231ff74cc39a"}},{"ruleId":"D2","level":"warning","message":{"text":"Registry.ResumeOrCreateRegistration (cognitive 20): Registry.ResumeOrCreateRegistration has cognitive complexity 20 (threshold 15). Drivers by points: if/else 19, boolean chains 1 (nesting depth added 5). Most of this is not in the body itself: 4 of the 20 points are its own statements and the rest belongs to one function literal inside it that branches (line 319). 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":"br/pkg/registry/registration.go"},"region":{"startLine":290}}}],"partialFingerprints":{"codehealthFindingId/v1":"5b32ca5774aef6ac35e6875417bd586c961057998373d8a33313f2f87c7bdfdf"}},{"ruleId":"D2","level":"warning","message":{"text":"Registry.FindAndDeleteMatchingTask (cognitive 20): Registry.FindAndDeleteMatchingTask has cognitive complexity 20 (threshold 15). Drivers by points: if/else 19, boolean chains 1 (nesting depth added 4). Most of this is not in the body itself: 4 of the 20 points are its own statements and the rest belongs to one function literal inside it that branches (line 1001). 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":"br/pkg/registry/registration.go"},"region":{"startLine":973}}}],"partialFingerprints":{"codehealthFindingId/v1":"0684031db71f44e38d932f1a09e1b24ad2bdb7951957de22ee7af19a710215e0"}},{"ruleId":"D2","level":"warning","message":{"text":"LogClient.SetTableModeToNormal (cognitive 20): LogClient.SetTableModeToNormal has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16, loops 3, boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"br/pkg/restore/log_client/client.go"},"region":{"startLine":1592}}}],"partialFingerprints":{"codehealthFindingId/v1":"4e246bbe6814a7235201708d394cfaf274f41a0aa7700c4f6a91c74c158eb9eb"}},{"ruleId":"D2","level":"warning","message":{"text":"SchemasReplace.rewriteTableInfo (cognitive 20): SchemasReplace.rewriteTableInfo has cognitive complexity 20 (threshold 15). Drivers by points: if/else 18, loops 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"br/pkg/stream/rewrite_meta_rawkv.go"},"region":{"startLine":290}}}],"partialFingerprints":{"codehealthFindingId/v1":"ddbde288877f1086e40b248a554b00d18eeec490052ff4eceaa93c46f5855512"}},{"ruleId":"D2","level":"warning","message":{"text":"StreamBackupSearch.searchFromDataFile (cognitive 20): StreamBackupSearch.searchFromDataFile has cognitive complexity 20 (threshold 15). Drivers by points: if/else 19, 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":"br/pkg/stream/search.go"},"region":{"startLine":208}}}],"partialFingerprints":{"codehealthFindingId/v1":"29c8bb99edd2a91ee4e03e852e726f8381818b6ef82047bff632273c048aa2bd"}},{"ruleId":"D2","level":"warning","message":{"text":"export.WriteInsertInParquet (cognitive 20): export.WriteInsertInParquet has cognitive complexity 20 (threshold 15). Drivers by points: if/else 18, boolean chains 1, loops 1 (nesting depth added 7). Of this number, 18 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":"dumpling/export/writer_util.go"},"region":{"startLine":636}}}],"partialFingerprints":{"codehealthFindingId/v1":"27b7f3ad8756af6a26354fcdba045616ba067015cac8c935c75c54da296e3078"}},{"ruleId":"D2","level":"warning","message":{"text":"importer.filterColumns (cognitive 20): importer.filterColumns has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12, loops 6, 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":"lightning/pkg/importer/import.go"},"region":{"startLine":2100}}}],"partialFingerprints":{"codehealthFindingId/v1":"634ec9ae21cbd1a330819a4c8aff828f839c24374e8d684aa690d0fb481195dd"}},{"ruleId":"D2","level":"warning","message":{"text":"importer.LoadSchemaInfo (cognitive 20): importer.LoadSchemaInfo 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":"lightning/pkg/importer/tidb.go"},"region":{"startLine":143}}}],"partialFingerprints":{"codehealthFindingId/v1":"68e7304071f4fc2a0da0c7109c47450cba2339b94988dd32ccad1c954b254711"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.generatePlanForPhysicalTable (cognitive 20): ddl.generatePlanForPhysicalTable has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17, loops 2, boolean chains 1 (nesting depth added 5). Most of this is not in the body itself: 6 of the 20 points are its own statements and the rest belongs to one function literal inside it that branches (line 357). 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":"pkg/ddl/backfilling_dist_scheduler.go"},"region":{"startLine":331}}}],"partialFingerprints":{"codehealthFindingId/v1":"c8641b8750fe726c2a0376da477d99d119a0981e5197058ac3669d188479106c"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.buildIndexPresplitOpt (cognitive 20): ddl.buildIndexPresplitOpt has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13, loops 7 (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/ddl/executor.go"},"region":{"startLine":5213}}}],"partialFingerprints":{"codehealthFindingId/v1":"539e9521ef9c4957da01ccd8b7c04c581029ea5fefb1d105a928667e4c064d34"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.BuildIndexInfo (cognitive 20): ddl.BuildIndexInfo has cognitive complexity 20 (threshold 15). Drivers by points: if/else 19, match/switch 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":"pkg/ddl/index.go"},"region":{"startLine":388}}}],"partialFingerprints":{"codehealthFindingId/v1":"101c77433b00cad1587b5629a6c3338da080ef7d7601f6c193f72a15bd9b37d0"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.checkAndBuildIndexInfo (cognitive 20): ddl.checkAndBuildIndexInfo has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16, loops 3, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/index.go"},"region":{"startLine":824}}}],"partialFingerprints":{"codehealthFindingId/v1":"98f39a2739c3b7d48f7a4f1c9d93c222e46d555bd68b6948c18fb2602898727d"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.adjustForeignKeyChildTableInfoAfterModifyColumn (cognitive 20): ddl.adjustForeignKeyChildTableInfoAfterModifyColumn has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14, loops 4, boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/modify_column.go"},"region":{"startLine":740}}}],"partialFingerprints":{"codehealthFindingId/v1":"02393ea480845e5a2170ffb0fe5212ac790a6fcc4a0e82617a35240d73ad0e12"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.checkPartitionValuesIsInt (cognitive 20): ddl.checkPartitionValuesIsInt has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15, boolean chains 2, match/switch 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/partition.go"},"region":{"startLine":1717}}}],"partialFingerprints":{"codehealthFindingId/v1":"6f1348b998051627a219bb3ffa8358b13f96547708c834262a13b403bd6b505d"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.checkRangePartitionValue (cognitive 20): ddl.checkRangePartitionValue has cognitive complexity 20 (threshold 15). Drivers by points: if/else 19, 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":"pkg/ddl/partition.go"},"region":{"startLine":1909}}}],"partialFingerprints":{"codehealthFindingId/v1":"cd2b1e004cc193081b640c54ed41295f6711242d3d5c28fd6d8b3e8876f3146d"}},{"ruleId":"D2","level":"warning","message":{"text":"jobScheduler.schedule (cognitive 20): jobScheduler.schedule has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17, match/switch 2, loops 1 (nesting depth added 9). Of this number, 15 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":"pkg/ddl/job_scheduler.go"},"region":{"startLine":284}}}],"partialFingerprints":{"codehealthFindingId/v1":"94352ec3867674b4009ae536002f41ee6baaeac31ece4c3c7acac3c471c58369"}},{"ruleId":"D2","level":"warning","message":{"text":"worker.onAlterCheckConstraint (cognitive 20): worker.onAlterCheckConstraint has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17, match/switch 2, 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":"pkg/ddl/constraint.go"},"region":{"startLine":219}}}],"partialFingerprints":{"codehealthFindingId/v1":"d98ad99b2143d2025b85ab4b9d8c83273e373bb0559a829a7e048e86e7c2f407"}},{"ruleId":"D2","level":"warning","message":{"text":"Domain.InitDistTaskLoop (cognitive 20): Domain.InitDistTaskLoop has cognitive complexity 20 (threshold 15). Drivers by points: if/else 20 (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/domain/domain.go"},"region":{"startLine":1095}}}],"partialFingerprints":{"codehealthFindingId/v1":"69c5baa43b80955d66e52e2afc48565e3c72388fc44bd09aeab4333b3ce78f1e"}},{"ruleId":"D2","level":"warning","message":{"text":"Domain.proposeServerID (cognitive 20): Domain.proposeServerID has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14, 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":"pkg/domain/domain.go"},"region":{"startLine":2745}}}],"partialFingerprints":{"codehealthFindingId/v1":"f2f13da78f838ef13899652ab749680b39bf19d48c92d33ba567717b89d3831d"}},{"ruleId":"D2","level":"warning","message":{"text":"Domain.requestUnitsWriterLoop (cognitive 20): Domain.requestUnitsWriterLoop has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14, loops 4, match/switch 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/domain/ru_stats.go"},"region":{"startLine":67}}}],"partialFingerprints":{"codehealthFindingId/v1":"708a01406ec302119cd42c97e236296cf234ff9c95a1a2440284e0a6868d8e52"}},{"ruleId":"D2","level":"warning","message":{"text":"ImportCleanUp.CleanUpBatch (cognitive 20): ImportCleanUp.CleanUpBatch has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17, loops 2, 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":"pkg/dxf/importinto/clean_up.go"},"region":{"startLine":83}}}],"partialFingerprints":{"codehealthFindingId/v1":"114e373d9a0433e106d44fb6203678043a486c1c2dfa204ee7619802958a06f9"}},{"ruleId":"D2","level":"warning","message":{"text":"LogicalPlan.writeExternalPlanMeta (cognitive 20): LogicalPlan.writeExternalPlanMeta has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17, 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":"pkg/dxf/importinto/planner.go"},"region":{"startLine":106}}}],"partialFingerprints":{"codehealthFindingId/v1":"7d387d7e0beaed20b8de8d9b498bd8eb2e6b3dc887bb9d62943583e5a7587899"}},{"ruleId":"D2","level":"warning","message":{"text":"executor.insertRows (cognitive 20): executor.insertRows has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17, boolean chains 2, 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":"pkg/executor/insert_common.go"},"region":{"startLine":231}}}],"partialFingerprints":{"codehealthFindingId/v1":"be16e325f0979cf12bca14b85589033e5cde566a988f85581fb32f96e313fdc3"}},{"ruleId":"D2","level":"warning","message":{"text":"ExecStmt.handleForeignKeyCascade (cognitive 20): ExecStmt.handleForeignKeyCascade has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16, boolean chains 3, loops 1 (nesting depth added 6). Of this number, 17 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":"pkg/executor/adapter.go"},"region":{"startLine":850}}}],"partialFingerprints":{"codehealthFindingId/v1":"4828b27e68bba38b7e1c2adeb69a969421e2c5d58ca040752c80f505243db0c8"}},{"ruleId":"D2","level":"warning","message":{"text":"aggfuncs.buildAvg (cognitive 20): aggfuncs.buildAvg has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15, match/switch 5 (nesting depth added 12). 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":"pkg/executor/aggfuncs/builder.go"},"region":{"startLine":369}}}],"partialFingerprints":{"codehealthFindingId/v1":"d60c290fe6a8fdec96181546019240324ac0b28208c0bb72d2958fa919d88b47"}},{"ruleId":"D2","level":"warning","message":{"text":"aggfuncs.buildGroupConcat (cognitive 20): aggfuncs.buildGroupConcat has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9, loops 7, match/switch 4 (nesting depth added 12). 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":"pkg/executor/aggfuncs/builder.go"},"region":{"startLine":641}}}],"partialFingerprints":{"codehealthFindingId/v1":"eb9918bc741bc881d917d13ff71969a38d2e97254e1663b918003b8629897a8d"}},{"ruleId":"D2","level":"warning","message":{"text":"StreamAggExec.consumeOneGroup (cognitive 20): StreamAggExec.consumeOneGroup has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14, loops 5, 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":"pkg/executor/aggregate/agg_stream_executor.go"},"region":{"startLine":130}}}],"partialFingerprints":{"codehealthFindingId/v1":"0bd0731edd0391b91df4b504c9e3f08d92f0364472920778e2e7d8800059fb95"}},{"ruleId":"D2","level":"warning","message":{"text":"executorBuilder.buildTraffic (cognitive 20): executorBuilder.buildTraffic has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9, match/switch 7, loops 4 (nesting depth added 13). The drivers above price the dispatch low by construction \u2014 a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full \u2014 so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/builder.go"},"region":{"startLine":1226}}}],"partialFingerprints":{"codehealthFindingId/v1":"0dc305a19bea314ac52e80bcbbb71c24a1f8dbb98b9944e4a6e59f6f6bfca6b0"}},{"ruleId":"D2","level":"warning","message":{"text":"indexWorker.extractLookUpPushDownRowsOrHandles (cognitive 20): indexWorker.extractLookUpPushDownRowsOrHandles has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17, match/switch 2, loops 1 (nesting depth added 10). 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, 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/executor/distsql.go"},"region":{"startLine":1671}}}],"partialFingerprints":{"codehealthFindingId/v1":"5683ac8ff4d711b9c5db3588f4e86179b709ffad8d4f22e6daa636c9a8918279"}},{"ruleId":"D2","level":"warning","message":{"text":"memtableRetriever.setDataFromOneTable (cognitive 20): memtableRetriever.setDataFromOneTable has cognitive complexity 20 (threshold 15). Drivers by points: if/else 19, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/infoschema_reader.go"},"region":{"startLine":678}}}],"partialFingerprints":{"codehealthFindingId/v1":"1ac1deee9cb24aec241417035325a6d4f7482aa1cceceb08313b36248f1cb061"}},{"ruleId":"D2","level":"warning","message":{"text":"memtableRetriever.setDataForAttributes (cognitive 20): memtableRetriever.setDataForAttributes has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14, boolean chains 3, loops 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/infoschema_reader.go"},"region":{"startLine":3763}}}],"partialFingerprints":{"codehealthFindingId/v1":"98016251f11cfc2f78523c7e933ad75c957f49f022d53d85fb3b25c6593bfc04"}},{"ruleId":"D2","level":"warning","message":{"text":"InsertExec.doDupRowUpdate (cognitive 20): InsertExec.doDupRowUpdate has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16, loops 4 (nesting depth added 6). Of this number, 17 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":"pkg/executor/insert.go"},"region":{"startLine":444}}}],"partialFingerprints":{"codehealthFindingId/v1":"4a35f85ebd1319befb2ef5ec855bc0bbda81a10c660ae135659d886353df51fd"}},{"ruleId":"D2","level":"warning","message":{"text":"InsertValues.adjustAutoIncrementDatum (cognitive 20): InsertValues.adjustAutoIncrementDatum has cognitive complexity 20 (threshold 15). Drivers by points: if/else 19, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/insert_common.go"},"region":{"startLine":964}}}],"partialFingerprints":{"codehealthFindingId/v1":"9fb0a396f2acd27880abf6730b5244588ccb0e52faeb6df78aad5a5b0a74db22"}},{"ruleId":"D2","level":"warning","message":{"text":"exec.Next (cognitive 20): exec.Next has cognitive complexity 20 (threshold 15). Drivers by points: if/else 18, boolean chains 2 (nesting depth added 4). 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, 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":"pkg/executor/internal/exec/executor.go"},"region":{"startLine":627}}}],"partialFingerprints":{"codehealthFindingId/v1":"9165c285aa0e0c1cc2f9e235586f30eb2bb7a411693bf5fbc830825ec2f0d14f"}},{"ruleId":"D2","level":"warning","message":{"text":"localMppCoordinator.appendMPPDispatchReq (cognitive 20): localMppCoordinator.appendMPPDispatchReq has cognitive complexity 20 (threshold 15). Drivers by points: if/else 18, loops 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/internal/mpp/local_mpp_coordinator.go"},"region":{"startLine":200}}}],"partialFingerprints":{"codehealthFindingId/v1":"827f464d5ace3364f3c6a83dd9478c7f6845a029e793c2baf2d0ba12e6e47be2"}},{"ruleId":"D2","level":"warning","message":{"text":"localMppCoordinator.receiveResults (cognitive 20): localMppCoordinator.receiveResults has cognitive complexity 20 (threshold 15). Drivers by points: if/else 18, loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/internal/mpp/local_mpp_coordinator.go"},"region":{"startLine":635}}}],"partialFingerprints":{"codehealthFindingId/v1":"be5f8a5ee9c9358805fad4da6ded915f8bfe68890da351c22d9c422a5bd5a3f7"}},{"ruleId":"D2","level":"warning","message":{"text":"localMppCoordinator.Execute (cognitive 20): localMppCoordinator.Execute has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13, loops 7 (nesting depth added 8). 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, 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/executor/internal/mpp/local_mpp_coordinator.go"},"region":{"startLine":882}}}],"partialFingerprints":{"codehealthFindingId/v1":"ca4905b14dfd54931c0dcace8b8b6c0adcdc45eef005f5fc9799808660d0c7b9"}},{"ruleId":"D2","level":"warning","message":{"text":"ProbeWorkerV1.handleUnmatchedRowsFromHashTable (cognitive 20): ProbeWorkerV1.handleUnmatchedRowsFromHashTable has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15, 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":"pkg/executor/join/hash_join_v1.go"},"region":{"startLine":271}}}],"partialFingerprints":{"codehealthFindingId/v1":"3f73661d26b5e0d755f3b2f853c6bbcdde730222d88bcb810f5fc67cbe18571b"}},{"ruleId":"D2","level":"warning","message":{"text":"ProbeWorkerV1.runJoinWorker (cognitive 20): ProbeWorkerV1.runJoinWorker has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14, boolean chains 3, match/switch 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/join/hash_join_v1.go"},"region":{"startLine":319}}}],"partialFingerprints":{"codehealthFindingId/v1":"5a33f465509ed9c288a590f080c4548a67e24b645968d4d5505d5d42e064d409"}},{"ruleId":"D2","level":"warning","message":{"text":"outerWorker.buildTask (cognitive 20): outerWorker.buildTask has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15, loops 4, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/join/index_lookup_join.go"},"region":{"startLine":439}}}],"partialFingerprints":{"codehealthFindingId/v1":"73019395c961d6452cb475285a65af9fb6cf1df400406d06fdc8e633be41afb2"}},{"ruleId":"D2","level":"warning","message":{"text":"innerMergeWorker.constructDatumLookupKey (cognitive 20): innerMergeWorker.constructDatumLookupKey has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15, boolean chains 4, 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":"pkg/executor/join/index_lookup_merge_join.go"},"region":{"startLine":658}}}],"partialFingerprints":{"codehealthFindingId/v1":"e82afb4dff6ad5a5f6d9f565dcd2423bc69d77acd78c79d35399527390f5749f"}},{"ruleId":"D2","level":"warning","message":{"text":"ParallelNestedLoopApplyExec.fillInnerChunk (cognitive 20): ParallelNestedLoopApplyExec.fillInnerChunk has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13, boolean chains 6, 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":"pkg/executor/parallel_apply.go"},"region":{"startLine":741}}}],"partialFingerprints":{"codehealthFindingId/v1":"7b6381426bebf610d2e17ece34035f02196819c533b9a32c9031b07f77a0876e"}},{"ruleId":"D2","level":"warning","message":{"text":"PlanReplayerLoadInfo.Update (cognitive 20): PlanReplayerLoadInfo.Update has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16, 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":"pkg/executor/plan_replayer.go"},"region":{"startLine":651}}}],"partialFingerprints":{"codehealthFindingId/v1":"a8a54fa8b3bf732cbd8dcaa18bee4294c77fd88057cadd47e41fc9428542b186"}},{"ruleId":"D2","level":"warning","message":{"text":"slowQueryRetriever.parseSlowLogByBatchGetter (cognitive 20): slowQueryRetriever.parseSlowLogByBatchGetter has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14, match/switch 5, loops 1 (nesting depth added 9). Of this number, 18 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":"pkg/executor/slow_query.go"},"region":{"startLine":653}}}],"partialFingerprints":{"codehealthFindingId/v1":"276e29404d3a31fba6823f762f66885669d2886e5a1d17ae90bb411bd71ffbe2"}},{"ruleId":"D2","level":"warning","message":{"text":"slowLogReverseScanner.nextBatch (cognitive 20): slowLogReverseScanner.nextBatch has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17, loops 2, 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":"pkg/executor/slow_query.go"},"region":{"startLine":419}}}],"partialFingerprints":{"codehealthFindingId/v1":"44ac6498a90080b598552605fed8f67c0cee51aa9d87a001d55428135c0023bd"}},{"ruleId":"D2","level":"warning","message":{"text":"SortExec.Close (cognitive 20): SortExec.Close has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13, loops 7 (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/executor/sortexec/sort.go"},"region":{"startLine":109}}}],"partialFingerprints":{"codehealthFindingId/v1":"7310783abf7bc0f5001d5eb9387e3931b77ac1b971fd89c8df7cd226b7afacbe"}},{"ruleId":"D2","level":"warning","message":{"text":"WindowExec.consumeOneGroup (cognitive 20): WindowExec.consumeOneGroup has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15, loops 5 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/windows/window.go"},"region":{"startLine":77}}}],"partialFingerprints":{"codehealthFindingId/v1":"4b7a0c4252025f9190be60483d4b6d4bfa77ae344b082d524c58f99b88719891"}},{"ruleId":"D2","level":"warning","message":{"text":"expression.convertJSON2Tp (cognitive 20): expression.convertJSON2Tp has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14, boolean chains 5, match/switch 1 (nesting depth added 7). Most of this is not in the body itself: 1 of the 20 points is its own statement and the rest belongs to 5 function literals inside it that branch (lines 737, 718, 730, \u2026). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals\u0027 work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/builtin_cast.go"},"region":{"startLine":708}}}],"partialFingerprints":{"codehealthFindingId/v1":"ddfe4991096179d2c48cd0405aae1057a8dad81d7746574c7d222cef796d0bd7"}},{"ruleId":"D2","level":"warning","message":{"text":"expression.ResolveType4Between (cognitive 20): expression.ResolveType4Between has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12, boolean chains 4, loops 4 (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/expression/builtin_compare.go"},"region":{"startLine":395}}}],"partialFingerprints":{"codehealthFindingId/v1":"78e9cb09d0f9caf8d6f4905486669cd298f93b1b7053f5ca495215291ddb59cd"}},{"ruleId":"D2","level":"warning","message":{"text":"expression.RefineComparedConstant (cognitive 20): expression.RefineComparedConstant has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17, match/switch 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/expression/builtin_compare.go"},"region":{"startLine":1574}}}],"partialFingerprints":{"codehealthFindingId/v1":"3accd4bb1ce0c36c06750e04ababb9ccf0764664068fbfba07660fe52b459be1"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinGreatestCmpStringAsTimeSig.vecEvalString (cognitive 20): builtinGreatestCmpStringAsTimeSig.vecEvalString has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14, loops 4, 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":"pkg/expression/builtin_compare_vec.go"},"region":{"startLine":636}}}],"partialFingerprints":{"codehealthFindingId/v1":"d2d6a471f03ffb9d5a8ba43d5f1bed7b18740e946b7a81381b12bcb43c5fcf12"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinLeastCmpStringAsTimeSig.vecEvalString (cognitive 20): builtinLeastCmpStringAsTimeSig.vecEvalString has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14, loops 4, 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":"pkg/expression/builtin_compare_vec.go"},"region":{"startLine":716}}}],"partialFingerprints":{"codehealthFindingId/v1":"c5f5f356935b3abbc87c427f92f183ada1f6e7c1a51923accd5ad0122ed69d44"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinFloorDecToDecSig.vecEvalDecimal (cognitive 20): builtinFloorDecToDecSig.vecEvalDecimal 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/expression/builtin_math_vec.go"},"region":{"startLine":908}}}],"partialFingerprints":{"codehealthFindingId/v1":"025bccb0ef235089d08e2cc8ad0ae57e3caf1630e98bdb4351b9552a0ae229cb"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinOctStringSig.vecEvalString (cognitive 20): builtinOctStringSig.vecEvalString has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17, boolean chains 2, 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":"pkg/expression/builtin_string_vec.go"},"region":{"startLine":1779}}}],"partialFingerprints":{"codehealthFindingId/v1":"97be74e58fa42e0b539963e67ed1e27cd2c523c33859770380c56ef8bfc476a4"}},{"ruleId":"D2","level":"warning","message":{"text":"baseDateArithmetical.vecGetDateFromString (cognitive 20): baseDateArithmetical.vecGetDateFromString has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16, boolean chains 3, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/builtin_time.go"},"region":{"startLine":3387}}}],"partialFingerprints":{"codehealthFindingId/v1":"fc52e77b88ee3edbd16d4b1512556bec9d327f4d5cc3c4148b16801ef4857017"}},{"ruleId":"D2","level":"warning","message":{"text":"defaultEvaluator.run (cognitive 20): defaultEvaluator.run has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14, loops 5, boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/evaluator.go"},"region":{"startLine":28}}}],"partialFingerprints":{"codehealthFindingId/v1":"a4f4327b9d401a46d345654d6645d329dd57512824f5e33bbc68e90f80c5224c"}},{"ruleId":"D2","level":"warning","message":{"text":"textrow.AppendFormatFloat (cognitive 20): textrow.AppendFormatFloat has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12, boolean chains 6, 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":"pkg/format/textrow/textrow.go"},"region":{"startLine":124}}}],"partialFingerprints":{"codehealthFindingId/v1":"c0fb8d1cdbdde913a9a3504ecadae694ca948c06b441bef0a9c0d7b693520f6e"}},{"ruleId":"D2","level":"warning","message":{"text":"Batch.processBatch (cognitive 20): Batch.processBatch has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12, loops 6, match/switch 2 (nesting depth added 7). Most of this is not in the body itself: 8 of the 20 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 402, 383, 397). 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":"pkg/inference/embedding/batcher/batcher.go"},"region":{"startLine":347}}}],"partialFingerprints":{"codehealthFindingId/v1":"f1b8d44e9087c596ccd0a9c0e3dbc89eeceddf9cef7367445e8da51ea54c2f73"}},{"ruleId":"D2","level":"warning","message":{"text":"Syncer.SyncLoop (cognitive 20): Syncer.SyncLoop has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15, match/switch 4, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/infoschema/issyncer/syncer.go"},"region":{"startLine":296}}}],"partialFingerprints":{"codehealthFindingId/v1":"afffe0e4cf3135b9f6543420a65dbd8c72df601b0ff59ea4a67e3b696a654cfd"}},{"ruleId":"D2","level":"warning","message":{"text":"dupeDetector.splitKeyRangeByRegions (cognitive 20): dupeDetector.splitKeyRangeByRegions 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/ingestor/ingestctrl/duplicate.go"},"region":{"startLine":926}}}],"partialFingerprints":{"codehealthFindingId/v1":"a46b88e013b85397c6685a1e00ba69641353a7abe098b2ced356358287407e51"}},{"ruleId":"D2","level":"warning","message":{"text":"dupeDetector.processRemoteDupTaskOnce (cognitive 20): dupeDetector.processRemoteDupTaskOnce has cognitive complexity 20 (threshold 15). Drivers by points: if/else 18, loops 2 (nesting depth added 8). Most of this is not in the body itself: 6 of the 20 points are its own statements and the rest belongs to one function literal inside it that branches (line 1001). 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":"pkg/ingestor/ingestctrl/duplicate.go"},"region":{"startLine":967}}}],"partialFingerprints":{"codehealthFindingId/v1":"1ad85f690d842162775079e99bdb599d11aefd2acf5bae407f26fba3d90b211b"}},{"ruleId":"D2","level":"warning","message":{"text":"autoid.CalcSequenceBatchSize (cognitive 20): autoid.CalcSequenceBatchSize 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":"pkg/meta/autoid/autoid.go"},"region":{"startLine":774}}}],"partialFingerprints":{"codehealthFindingId/v1":"a566ceed55028fbf35b10c27712f15ef1dc7de02c435fc8baa42360a54a2124c"}},{"ruleId":"D2","level":"warning","message":{"text":"s3store.NewKS3Storage (cognitive 20): s3store.NewKS3Storage has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16, boolean chains 3, 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":"pkg/objstore/s3store/ks3.go"},"region":{"startLine":67}}}],"partialFingerprints":{"codehealthFindingId/v1":"3c8b28c01d2855355d38d44704c7f7e9eeb4ac1dbbdcb5ba83d42fdd4439c512"}},{"ruleId":"D2","level":"warning","message":{"text":"KS3Storage.WalkDir (cognitive 20): KS3Storage.WalkDir has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14, boolean chains 3, 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":"pkg/objstore/s3store/ks3.go"},"region":{"startLine":395}}}],"partialFingerprints":{"codehealthFindingId/v1":"7e3f8a310d6c102afc6fafa7ac632f6f5c7302c61cf4781c5756cf05f0a99b57"}},{"ruleId":"D2","level":"warning","message":{"text":"cardinality.getPseudoRowCountBySignedIntRanges (cognitive 20): cardinality.getPseudoRowCountBySignedIntRanges has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16, boolean chains 3, 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/planner/cardinality/pseudo.go"},"region":{"startLine":101}}}],"partialFingerprints":{"codehealthFindingId/v1":"3ba565c53b255359abe3192fc5a6639e43fce88c84b649c9e5379b0ea4d8e0d8"}},{"ruleId":"D2","level":"warning","message":{"text":"cardinality.getPseudoRowCountByUnsignedIntRanges (cognitive 20): cardinality.getPseudoRowCountByUnsignedIntRanges has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16, boolean chains 3, 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/planner/cardinality/pseudo.go"},"region":{"startLine":137}}}],"partialFingerprints":{"codehealthFindingId/v1":"c60e753d94ba7fbb6b06989c730f696893b03c848dac1046e229e4910d7b7d63"}},{"ruleId":"D2","level":"warning","message":{"text":"core.buildDataSource2TableScanByIndexJoinProp (cognitive 20): core.buildDataSource2TableScanByIndexJoinProp has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16, 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":"pkg/planner/core/exhaust_physical_plans.go"},"region":{"startLine":726}}}],"partialFingerprints":{"codehealthFindingId/v1":"89778d61b7ca07dbb87d4b40a7818e614d18388d5e083240025a72d56333935e"}},{"ruleId":"D2","level":"warning","message":{"text":"core.enumeratePhysicalPlans4Task (cognitive 20): core.enumeratePhysicalPlans4Task has cognitive complexity 20 (threshold 15). Drivers by points: if/else 19, 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":"pkg/planner/core/find_best_task.go"},"region":{"startLine":111}}}],"partialFingerprints":{"codehealthFindingId/v1":"207ee25ef0a65d54eadb2a0c3875f376c698f56fa96f0367ae34f64761819f62"}},{"ruleId":"D2","level":"warning","message":{"text":"core.buildOrderedList (cognitive 20): core.buildOrderedList has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14, boolean chains 5, 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":"pkg/planner/core/point_get_plan.go"},"region":{"startLine":1261}}}],"partialFingerprints":{"codehealthFindingId/v1":"069dd5e1adf12699fa0dbe84e564fe99f96443f32495defda186e2df2ba21f3c"}},{"ruleId":"D2","level":"warning","message":{"text":"core.restoreSchemaIfChanged (cognitive 20): core.restoreSchemaIfChanged has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15, loops 4, boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/rule_join_reorder.go"},"region":{"startLine":445}}}],"partialFingerprints":{"codehealthFindingId/v1":"af34d29d8007d2c2545d65e12dfd4b95856fc9ce40aa286d92d9d7aa7531013a"}},{"ruleId":"D2","level":"warning","message":{"text":"core.deriveIndexPathStats (cognitive 20): core.deriveIndexPathStats has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16, loops 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":"pkg/planner/core/stats.go"},"region":{"startLine":249}}}],"partialFingerprints":{"codehealthFindingId/v1":"a17f39b02858ab85131da2548057084ba4f9d04e07959edfc7dfb96d1a2010d6"}},{"ruleId":"D2","level":"warning","message":{"text":"core.attach2Task4PhysicalStreamAgg (cognitive 20): core.attach2Task4PhysicalStreamAgg has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17, 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/planner/core/task.go"},"region":{"startLine":1653}}}],"partialFingerprints":{"codehealthFindingId/v1":"15f94a6189b378918675ff8917e4d79ac00792f1de4f0d9b382c194c6796ba98"}},{"ruleId":"D2","level":"warning","message":{"text":"core.scaleStats4GroupingSets (cognitive 20): core.scaleStats4GroupingSets has cognitive complexity 20 (threshold 15). Drivers by points: loops 11, if/else 8, boolean chains 1 (nesting depth added 10). 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":"pkg/planner/core/task.go"},"region":{"startLine":1764}}}],"partialFingerprints":{"codehealthFindingId/v1":"3bc5992ce91e7a6f834525a848cd2d2ed4b9e5d2cf6c5cd027efd2bdb7b04056"}},{"ruleId":"D2","level":"warning","message":{"text":"expressionRewriter.castCollationForIn (cognitive 20): expressionRewriter.castCollationForIn has cognitive complexity 20 (threshold 15). Drivers by points: if/else 18, boolean chains 1, 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/planner/core/expression_rewriter.go"},"region":{"startLine":2278}}}],"partialFingerprints":{"codehealthFindingId/v1":"381d1c6e2cc3fa347870ac12c077e681a45e2b8af9910f4ae8ddd4d63c545478"}},{"ruleId":"D2","level":"warning","message":{"text":"expressionRewriter.ftsNativeViable (cognitive 20): expressionRewriter.ftsNativeViable has cognitive complexity 20 (threshold 15). Drivers by points: if/else 18, 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":"pkg/planner/core/expression_rewriter.go"},"region":{"startLine":2514}}}],"partialFingerprints":{"codehealthFindingId/v1":"fd52f141fdc13683f7da1a79349461f6aa84cae7229345027bd2ab8d276a42e1"}},{"ruleId":"D2","level":"warning","message":{"text":"LogicalApply.DeriveStats (cognitive 20): LogicalApply.DeriveStats has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10, boolean chains 6, loops 4 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/operator/logicalop/logical_apply.go"},"region":{"startLine":160}}}],"partialFingerprints":{"codehealthFindingId/v1":"c205e2b5cc9c19daafaf0702611263bcffdcd9618ad609423034465b483f1e30"}},{"ruleId":"D2","level":"warning","message":{"text":"LogicalExpand.ResolveGroupingFuncArgsInGroupBy (cognitive 20): LogicalExpand.ResolveGroupingFuncArgsInGroupBy has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16, loops 4 (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/planner/core/operator/logicalop/logical_expand.go"},"region":{"startLine":302}}}],"partialFingerprints":{"codehealthFindingId/v1":"f4099181ce3aed32462036d6ff0e9add542783655a5d3a5777b958659d0a3ddb"}},{"ruleId":"D2","level":"warning","message":{"text":"BasePhysicalAgg.canUse3Stage4SingleDistinctAgg (cognitive 20): BasePhysicalAgg.canUse3Stage4SingleDistinctAgg has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13, loops 4, boolean chains 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":"pkg/planner/core/operator/physicalop/base_physical_agg.go"},"region":{"startLine":418}}}],"partialFingerprints":{"codehealthFindingId/v1":"090d32c6b8bcf0d6d2a11ca79e7b9d29b713d147d3b7f9c87a5b1821f3c754c7"}},{"ruleId":"D2","level":"warning","message":{"text":"Insert.ResolveOnDuplicate (cognitive 20): Insert.ResolveOnDuplicate has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17, loops 2, 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":"pkg/planner/core/operator/physicalop/physical_common_plans.go"},"region":{"startLine":432}}}],"partialFingerprints":{"codehealthFindingId/v1":"1e6ae71200cff16abd4ceb63bd9aeadba1eacb759d5decc81e8c1e7376663cd4"}},{"ruleId":"D2","level":"warning","message":{"text":"PhysicalTableScan.AccessObject (cognitive 20): PhysicalTableScan.AccessObject has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13, loops 5, 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":"pkg/planner/core/operator/physicalop/physical_table_scan.go"},"region":{"startLine":259}}}],"partialFingerprints":{"codehealthFindingId/v1":"8aeedfe879a67bec8208f18a58d07e875d44a0d05e35543dd1375727d94b3d70"}},{"ruleId":"D2","level":"warning","message":{"text":"PhysicalWindow.ExplainInfo (cognitive 20): PhysicalWindow.ExplainInfo has cognitive complexity 20 (threshold 15). Drivers by points: if/else 18, loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/operator/physicalop/physical_window.go"},"region":{"startLine":167}}}],"partialFingerprints":{"codehealthFindingId/v1":"85173edc49f17086601ca33b4e95fbab0f1dc0523e6e0546e68f4d2001421e24"}},{"ruleId":"D2","level":"warning","message":{"text":"PlanBuilder.getMustAnalyzedColumns (cognitive 20): PlanBuilder.getMustAnalyzedColumns has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12, loops 5, boolean chains 3 (nesting depth added 9). Most of this is not in the body itself: 5 of the 20 points are its own statements and the rest belongs to one function literal inside it that branches (line 2271). 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":"pkg/planner/core/planbuilder.go"},"region":{"startLine":2262}}}],"partialFingerprints":{"codehealthFindingId/v1":"f90eec86bce24f30d893af9a5e2009035b9085ca35500c2c7279be666ce1525a"}},{"ruleId":"D2","level":"warning","message":{"text":"PlanBuilder.getFullAnalyzeColumnsInfo (cognitive 20): PlanBuilder.getFullAnalyzeColumnsInfo has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15, match/switch 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":"pkg/planner/core/planbuilder.go"},"region":{"startLine":2372}}}],"partialFingerprints":{"codehealthFindingId/v1":"a8450ebdd76641fb8507c0ab8adc377685a33b6f7e68c5507063d7504cbbfc48"}},{"ruleId":"D2","level":"warning","message":{"text":"PlanBuilder.buildSplitIndexRegion (cognitive 20): PlanBuilder.buildSplitIndexRegion has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16, boolean chains 2, loops 2 (nesting depth added 5). Of this number, 18 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":"pkg/planner/core/planbuilder.go"},"region":{"startLine":5048}}}],"partialFingerprints":{"codehealthFindingId/v1":"1d120c73f273cfafe9723d4ede9f56be00ba603a9cc3ade6e604ba0836248df4"}},{"ruleId":"D2","level":"warning","message":{"text":"util.CheckIndexCanBeKey (cognitive 20): util.CheckIndexCanBeKey has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17, 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":"pkg/planner/core/rule/util/misc.go"},"region":{"startLine":166}}}],"partialFingerprints":{"codehealthFindingId/v1":"e9ddb5f64632dc9b063ef43387e1da5982b235c6d44c85ba4daa51c371f5d1b3"}},{"ruleId":"D2","level":"warning","message":{"text":"OuterJoinEliminator.isInnerJoinKeysContainUniqueKey (cognitive 20): OuterJoinEliminator.isInnerJoinKeysContainUniqueKey has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14, loops 6 (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/planner/core/rule_join_elimination.go"},"region":{"startLine":167}}}],"partialFingerprints":{"codehealthFindingId/v1":"2d9b65ad217c8b50eed685372556ebdb8a87bfc20fe9bc50320e667cd3676635"}},{"ruleId":"D2","level":"warning","message":{"text":"stats.GetStatsTable (cognitive 20): stats.GetStatsTable has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15, boolean chains 5 (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":"pkg/planner/core/stats/stats.go"},"region":{"startLine":60}}}],"partialFingerprints":{"codehealthFindingId/v1":"290a808697d403aa251a6496463220d30f3caf17b6c46f370ece910628c0f17b"}},{"ruleId":"D2","level":"warning","message":{"text":"funcdep.FindCommonEquivClasses (cognitive 20): funcdep.FindCommonEquivClasses has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13, loops 7 (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/planner/funcdep/fd_graph.go"},"region":{"startLine":1239}}}],"partialFingerprints":{"codehealthFindingId/v1":"047d6ac7f06c0e8c60ea8c8c6f0327479a54889b78e5228fc9745bfe05ade7a5"}},{"ruleId":"D2","level":"warning","message":{"text":"autoAdmin.filterIndexes (cognitive 20): autoAdmin.filterIndexes has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17, loops 3 (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/planner/indexadvisor/algorithm.go"},"region":{"startLine":380}}}],"partialFingerprints":{"codehealthFindingId/v1":"d3d9685562bc16a29806fd7d033653cfd8f125afda97d3ceb68d5d007b16751a"}},{"ruleId":"D2","level":"warning","message":{"text":"util.FilterPathByIsolationRead (cognitive 20): util.FilterPathByIsolationRead has cognitive complexity 20 (threshold 15). Drivers by points: if/else 18, 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":"pkg/planner/util/misc.go"},"region":{"startLine":313}}}],"partialFingerprints":{"codehealthFindingId/v1":"fdc37b3f20d0eddd22d5ee529dcf80a783f9e1a71fb2d4e1bea3e904f131ccda"}},{"ruleId":"D2","level":"warning","message":{"text":"util.isColRangeCorCol (cognitive 20): util.isColRangeCorCol has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17, boolean chains 2, match/switch 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":"pkg/planner/util/path.go"},"region":{"startLine":364}}}],"partialFingerprints":{"codehealthFindingId/v1":"70a1988d14854e3cbb9d4a9d2f148dd4d2980e463d3d67e13cc59d06c5f2ed4a"}},{"ruleId":"D2","level":"warning","message":{"text":"util.isColEqExpr (cognitive 20): util.isColEqExpr has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17, 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/planner/util/path.go"},"region":{"startLine":399}}}],"partialFingerprints":{"codehealthFindingId/v1":"4f5998e4cb24644d33d5234ff53e91b0fd67067eb296deaeedb74dd98bd5e3f9"}},{"ruleId":"D2","level":"warning","message":{"text":"MySQLPrivilege.RequestVerification (cognitive 20): MySQLPrivilege.RequestVerification has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16, loops 4 (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/privilege/privileges/cache.go"},"region":{"startLine":1637}}}],"partialFingerprints":{"codehealthFindingId/v1":"4575e1fc7244589d071dee311c3687068a9a97244dd97ff2c1d61c6696d414d3"}},{"ruleId":"D2","level":"warning","message":{"text":"Checker.BeforeCopRequest (cognitive 20): Checker.BeforeCopRequest has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15, boolean chains 3, 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":"pkg/resourcegroup/runaway/checker.go"},"region":{"startLine":179}}}],"partialFingerprints":{"codehealthFindingId/v1":"d34d2e83947b04c8e0ae2d0aac7fdfd62565c30b16f9cc1397f0fc9b6b5dff2e"}},{"ruleId":"D2","level":"warning","message":{"text":"clientConn.initConnect (cognitive 20): clientConn.initConnect has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15, loops 4, 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":"pkg/server/conn.go"},"region":{"startLine":1117}}}],"partialFingerprints":{"codehealthFindingId/v1":"8e9ec73e77bdd238c27b6b9c183766e9964dd90f08cf0a9a765de8066eca09c9"}},{"ruleId":"D2","level":"warning","message":{"text":"compressedWriter.Flush (cognitive 20): compressedWriter.Flush has cognitive complexity 20 (threshold 15). Drivers by points: if/else 19, match/switch 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/server/internal/packetio.go"},"region":{"startLine":366}}}],"partialFingerprints":{"codehealthFindingId/v1":"daf362c1224772e3400237304e8863c3210bf4d80639cef88c5cdabf9ce574be"}},{"ruleId":"D2","level":"warning","message":{"text":"testserverclient.runTestInSchemaState (cognitive 20): testserverclient.runTestInSchemaState has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15, boolean chains 3, loops 2 (nesting depth added 3). Of this number, 11 points are the body\u0027s own statements and 9 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":"pkg/server/internal/testserverclient/server_client.go"},"region":{"startLine":3019}}}],"partialFingerprints":{"codehealthFindingId/v1":"08fdd846762f42f028f886647c80250896b39b2f2d36c319e8e7e49da919b337"}},{"ruleId":"D2","level":"warning","message":{"text":"session.finishStmt (cognitive 20): session.finishStmt has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17, boolean chains 2, match/switch 1 (nesting depth added 6). Of this number, 18 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":"pkg/session/tidb.go"},"region":{"startLine":205}}}],"partialFingerprints":{"codehealthFindingId/v1":"b254758c877b19f0d7cdd4e3f82e95383a25c93b224375239b438d9456aa9399"}},{"ruleId":"D2","level":"warning","message":{"text":"baseTxnContextProvider.OnInitialize (cognitive 20): baseTxnContextProvider.OnInitialize has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17, boolean chains 2, match/switch 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":"pkg/sessiontxn/isolation/base.go"},"region":{"startLine":81}}}],"partialFingerprints":{"codehealthFindingId/v1":"1bcf7c6f153d9ed5a399f9a7c516cdf99445c2feff161624deb9d0e1e72e9864"}},{"ruleId":"D2","level":"warning","message":{"text":"autoanalyze.finishAnalyzeJob (cognitive 20): autoanalyze.finishAnalyzeJob has cognitive complexity 20 (threshold 15). Drivers by points: if/else 19, boolean chains 1 (nesting depth added 6). Of this number, 15 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":"pkg/statistics/handle/autoanalyze/autoanalyze.go"},"region":{"startLine":861}}}],"partialFingerprints":{"codehealthFindingId/v1":"71a7e706874ee7593e33e6f8500dbe11c893c96f89f33619d4fea68bdb0f8983"}},{"ruleId":"D2","level":"warning","message":{"text":"Handle.initStatsTopN4Chunk (cognitive 20): Handle.initStatsTopN4Chunk has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15, boolean chains 3, loops 2 (nesting depth added 7). 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, 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/statistics/handle/bootstrap.go"},"region":{"startLine":534}}}],"partialFingerprints":{"codehealthFindingId/v1":"be2f5794c3111a0864a897015ac5141228ba223c67647d3ee838a557cac33b39"}},{"ruleId":"D2","level":"warning","message":{"text":"lockstats.AddLockedTables (cognitive 20): lockstats.AddLockedTables has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14, loops 6 (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/statistics/handle/lockstats/lock_stats.go"},"region":{"startLine":138}}}],"partialFingerprints":{"codehealthFindingId/v1":"efa0ae68292bc8e6cc3d8c25a6a8e5adf2c26ce3411c5b247a04f08b87a5d6a7"}},{"ruleId":"D2","level":"warning","message":{"text":"statsReadWriter.LoadStatsFromJSONConcurrently (cognitive 20): statsReadWriter.LoadStatsFromJSONConcurrently has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16, loops 3, boolean chains 1 (nesting depth added 10). Most of this is not in the body itself: 3 of the 20 points are its own statements and the rest belongs to one function literal inside it that branches (line 519). 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":"pkg/statistics/handle/storage/stats_read_writer.go"},"region":{"startLine":503}}}],"partialFingerprints":{"codehealthFindingId/v1":"c6bfbbf7313a81756aa9de0a1b42734e9a572652dbd79343b57d7fa3b5f27f0d"}},{"ruleId":"D2","level":"warning","message":{"text":"statsSyncLoad.drainColTask (cognitive 20): statsSyncLoad.drainColTask has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14, match/switch 5, 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":"pkg/statistics/handle/syncload/stats_syncload.go"},"region":{"startLine":520}}}],"partialFingerprints":{"codehealthFindingId/v1":"3f797a9ece5de893a4c6b8b612682bbd9f78af0e11f47f652a47aa8d0c6f98f0"}},{"ruleId":"D2","level":"warning","message":{"text":"copr.balanceBatchCopTaskWithContinuity (cognitive 20): copr.balanceBatchCopTaskWithContinuity has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13, loops 7 (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":"pkg/store/copr/batch_coprocessor.go"},"region":{"startLine":211}}}],"partialFingerprints":{"codehealthFindingId/v1":"8f4ba518df3a1cd7e857404b574f4c00f6954d9bd0f4037776ed1b7ceeb2c57c"}},{"ruleId":"D2","level":"warning","message":{"text":"liteCopIteratorWorker.liteSendReq (cognitive 20): liteCopIteratorWorker.liteSendReq has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17, loops 2, boolean chains 1 (nesting depth added 8). Of this number, 18 points are the body\u0027s own statements and 2 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":"pkg/store/copr/coprocessor.go"},"region":{"startLine":1532}}}],"partialFingerprints":{"codehealthFindingId/v1":"1ca941d78fa93726ad283a8d4390bb4f7500a861d3a4ec50a096f789b5b4a702"}},{"ruleId":"D2","level":"warning","message":{"text":"TiKVDriver.OpenWithOptions (cognitive 20): TiKVDriver.OpenWithOptions has cognitive complexity 20 (threshold 15). Drivers by points: if/else 20 (nesting depth added 4). Of this number, 13 points are the body\u0027s own statements and 7 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":"pkg/store/driver/tikv_driver.go"},"region":{"startLine":127}}}],"partialFingerprints":{"codehealthFindingId/v1":"9e857377b36b3e08c405071e8673e1b47922afa30913c2a10b44c6f785e5b5f1"}},{"ruleId":"D2","level":"warning","message":{"text":"mockcopr.getRowData (cognitive 20): mockcopr.getRowData has cognitive complexity 20 (threshold 15). Drivers by points: if/else 18, 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":"pkg/store/mockstore/mockcopr/executor.go"},"region":{"startLine":617}}}],"partialFingerprints":{"codehealthFindingId/v1":"7e15402f2da8b8d9044bb2c0e01a6a7a292bde7c0287e868e52570d3d6e15fa8"}},{"ruleId":"D2","level":"warning","message":{"text":"analyzeIndexProcessor.Process (cognitive 20): analyzeIndexProcessor.Process has cognitive complexity 20 (threshold 15). Drivers by points: if/else 19, 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":"pkg/store/mockstore/unistore/cophandler/analyze.go"},"region":{"startLine":194}}}],"partialFingerprints":{"codehealthFindingId/v1":"5445e561f063261f4f5ad10b39712880c86a79bbd47fd00a972ad3605e9dcbbd"}},{"ruleId":"D2","level":"warning","message":{"text":"analyzeMixedExec.Process (cognitive 20): analyzeMixedExec.Process has cognitive complexity 20 (threshold 15). Drivers by points: if/else 19, 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":"pkg/store/mockstore/unistore/cophandler/analyze.go"},"region":{"startLine":633}}}],"partialFingerprints":{"codehealthFindingId/v1":"31bd828a13b666d8f8eb0720be9e990eacd90358750b90f81485c236ab0a2a38"}},{"ruleId":"D2","level":"warning","message":{"text":"mppExecBuilder.buildExpand (cognitive 20): mppExecBuilder.buildExpand has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10, loops 10 (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/store/mockstore/unistore/cophandler/mpp.go"},"region":{"startLine":289}}}],"partialFingerprints":{"codehealthFindingId/v1":"49833b5d1a2f0cd1fed2bc9b6f174fcbfc817c2d7ec5645048e1b7d6c0b14e9e"}},{"ruleId":"D2","level":"warning","message":{"text":"DBReader.Scan (cognitive 20): DBReader.Scan has cognitive complexity 20 (threshold 15). Drivers by points: if/else 19, 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/store/mockstore/unistore/tikv/dbreader/db_reader.go"},"region":{"startLine":252}}}],"partialFingerprints":{"codehealthFindingId/v1":"839311fbc3974b3a1c553be838a7813d84f2658a2ba2116b628f7daabd6c88ca"}},{"ruleId":"D2","level":"warning","message":{"text":"Server.KvPessimisticLock (cognitive 20): Server.KvPessimisticLock has cognitive complexity 20 (threshold 15). Drivers by points: if/else 18, boolean chains 2 (nesting depth added 6). 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 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/store/mockstore/unistore/tikv/server.go"},"region":{"startLine":245}}}],"partialFingerprints":{"codehealthFindingId/v1":"720966cd3564059912e81d141ad24a1b81ab2617d6fd7b16052e2fc2aaf6bdc0"}},{"ruleId":"D2","level":"warning","message":{"text":"table.NewColDesc (cognitive 20): table.NewColDesc has cognitive complexity 20 (threshold 15). Drivers by points: if/else 18, 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, 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":"pkg/table/column.go"},"region":{"startLine":410}}}],"partialFingerprints":{"codehealthFindingId/v1":"c961cd633c9d466d089bf65880b9b055445562328fda63384dcdc345d4b9a6f3"}},{"ruleId":"D2","level":"warning","message":{"text":"tablecodec.DecodeIndexHandle (cognitive 20): tablecodec.DecodeIndexHandle 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/tablecodec/tablecodec.go"},"region":{"startLine":1014}}}],"partialFingerprints":{"codehealthFindingId/v1":"590cdc525fe4e87ad18c539e2ca265204956f3c2a8e3931e879b9cc34a01c813"}},{"ruleId":"D2","level":"warning","message":{"text":"tablecodec.GenIndexKey (cognitive 20): tablecodec.GenIndexKey has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17, loops 2, 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":"pkg/tablecodec/tablecodec.go"},"region":{"startLine":1235}}}],"partialFingerprints":{"codehealthFindingId/v1":"d2a362f2f5c3a91e5c83a0acf2ceed1be33eaeb70bdf4dec55f329ca5d91ae55"}},{"ruleId":"D2","level":"warning","message":{"text":"ScanQueryGenerator.buildSQL (cognitive 20): ScanQueryGenerator.buildSQL has cognitive complexity 20 (threshold 15). Drivers by points: if/else 18, 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":"pkg/ttl/sqlbuilder/sql.go"},"region":{"startLine":402}}}],"partialFingerprints":{"codehealthFindingId/v1":"11b228e90fad20b3dc6a3065f67d70a99e52301db71ed1447df33cab7ac80611"}},{"ruleId":"D2","level":"warning","message":{"text":"ttlDeleteTask.doDelete (cognitive 20): ttlDeleteTask.doDelete has cognitive complexity 20 (threshold 15). Drivers by points: if/else 18, boolean chains 1, loops 1 (nesting depth added 9). 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, 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/ttl/ttlworker/del.go"},"region":{"startLine":128}}}],"partialFingerprints":{"codehealthFindingId/v1":"47f44a95e253e3f44866da2f7ccf6e8420a02c7d6a0eaf0052a40ebe5daafa47"}},{"ruleId":"D2","level":"warning","message":{"text":"types.calcWeek (cognitive 20): types.calcWeek has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 12, if/else 8 (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/types/core_time.go"},"region":{"startLine":427}}}],"partialFingerprints":{"codehealthFindingId/v1":"cf9c9cfd585250572b4dc5475adba22a7e686e84aeb5b2a9ce3d210ba6d0c150"}},{"ruleId":"D2","level":"warning","message":{"text":"admin.CheckRecordAndIndex (cognitive 20): admin.CheckRecordAndIndex has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16, loops 3, boolean chains 1 (nesting depth added 6). Most of this is not in the body itself: 2 of the 20 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 157, 127). 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":"pkg/util/admin/admin.go"},"region":{"startLine":120}}}],"partialFingerprints":{"codehealthFindingId/v1":"b8fb96ce5392417b9e911835251ae86e202971ba80d770d352afd3d4ccb617b4"}},{"ruleId":"D2","level":"warning","message":{"text":"Mapping.queryColumnInfo (cognitive 20): Mapping.queryColumnInfo has cognitive complexity 20 (threshold 15). Drivers by points: if/else 18, boolean chains 1, 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":"pkg/util/column-mapping/column.go"},"region":{"startLine":300}}}],"partialFingerprints":{"codehealthFindingId/v1":"ca3d97134bead4ff514ea375f7c81d40cc062e7378a0f58599657d9e87de6104"}},{"ruleId":"D2","level":"warning","message":{"text":"dbutil.ShowGrants (cognitive 20): dbutil.ShowGrants has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17, loops 3 (nesting depth added 5). Of this number, 13 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/util/dbutil/variable.go"},"region":{"startLine":72}}}],"partialFingerprints":{"codehealthFindingId/v1":"18e55eab725a4c462676225e970713f2775021414288e66b56e3654a1fb715bd"}},{"ruleId":"D2","level":"warning","message":{"text":"DiskSorter.compactFiles (cognitive 20): DiskSorter.compactFiles has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10, loops 10 (nesting depth added 7). Of this number, 11 points are the body\u0027s own statements and 9 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/util/extsort/disk_sorter.go"},"region":{"startLine":967}}}],"partialFingerprints":{"codehealthFindingId/v1":"bd0efef0fbb7b3dc22d36712e6fff762ec80184d6869de4d9d68c2dc915ef2c1"}},{"ruleId":"D2","level":"warning","message":{"text":"MemArbitrator.doCancelPendingTasks (cognitive 20): MemArbitrator.doCancelPendingTasks has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15, loops 5 (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/util/memory/arbitrator.go"},"region":{"startLine":1787}}}],"partialFingerprints":{"codehealthFindingId/v1":"0ae90d4c848a188f32275c1db03c751b94fdca64a6041f15e6295ddeebb93bc6"}},{"ruleId":"D2","level":"warning","message":{"text":"MemArbitrator.updatePoolMediumCapacity (cognitive 20): MemArbitrator.updatePoolMediumCapacity has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16, boolean chains 2, 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":"pkg/util/memory/arbitrator.go"},"region":{"startLine":2312}}}],"partialFingerprints":{"codehealthFindingId/v1":"12cf775033faf8be97fe458f7d993afbe7adf70ebfe070aeec66a2da317d6023"}},{"ruleId":"D2","level":"warning","message":{"text":"ranger.UnionRanges (cognitive 20): ranger.UnionRanges has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15, boolean chains 3, 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":"pkg/util/ranger/ranger.go"},"region":{"startLine":656}}}],"partialFingerprints":{"codehealthFindingId/v1":"73ce27ab7d5d1563b2eedd37cacc2b6dabb4569aa062b7acff861a40001a7e5f"}},{"ruleId":"D2","level":"warning","message":{"text":"Encoder.reformatCols (cognitive 20): Encoder.reformatCols has cognitive complexity 20 (threshold 15). Drivers by points: if/else 19, 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":"pkg/util/rowcodec/encoder.go"},"region":{"startLine":93}}}],"partialFingerprints":{"codehealthFindingId/v1":"be88181171d7f1d885d2a0db0a7ef5bf53e6f40dce8a66a990945a8b3849556d"}},{"ruleId":"D2","level":"warning","message":{"text":"main.checkPanel (cognitive 20): main.checkPanel has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14, loops 5, 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":"tools/dashboard-linter/main.go"},"region":{"startLine":134}}}],"partialFingerprints":{"codehealthFindingId/v1":"a6e2a909b17fac9cc396d7cecd13ccc58a62fc890308cfc37383dc5c80c35af7"}},{"ruleId":"D2","level":"warning","message":{"text":"InsertStmt.Accept (cognitive 20): InsertStmt.Accept 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":"pkg/parser/ast/dml.go"},"region":{"startLine":2578}}}],"partialFingerprints":{"codehealthFindingId/v1":"82f9c5f00f6941a7e04abf10ea76371094500c1774bd85b405c9af0d90621d79"}},{"ruleId":"D2","level":"warning","message":{"text":"DeleteStmt.Accept (cognitive 20): DeleteStmt.Accept has cognitive complexity 20 (threshold 15). Drivers by points: if/else 19, 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/parser/ast/dml.go"},"region":{"startLine":2790}}}],"partialFingerprints":{"codehealthFindingId/v1":"fb25dfc93e84d15e18e0e5e91e75f3e30b4ab3bb8d514125ff1e7bbb76ee5bae"}},{"ruleId":"D2","level":"warning","message":{"text":"UpdateStmt.Accept (cognitive 20): UpdateStmt.Accept has cognitive complexity 20 (threshold 15). Drivers by points: if/else 18, 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":"pkg/parser/ast/dml.go"},"region":{"startLine":3046}}}],"partialFingerprints":{"codehealthFindingId/v1":"fd7606be36774e961f1ac86ee90d00cc10a71a531e38cf7949cf2e6cc74a0eb7"}},{"ruleId":"D2","level":"warning","message":{"text":"main.decodeBackupMetaCommand (cognitive 19): main.decodeBackupMetaCommand has cognitive complexity 19 (threshold 15). Drivers by points: if/else 18, match/switch 1 (nesting depth added 6). 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 279). 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":"br/cmd/br/debug.go"},"region":{"startLine":274}}}],"partialFingerprints":{"codehealthFindingId/v1":"560ceb2514d28ffa5d4a8760050db11d2517fae8277478625a66427d3dd20069"}},{"ruleId":"D2","level":"warning","message":{"text":"Preparer.Finalize (cognitive 19): Preparer.Finalize has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15, loops 2, match/switch 2 (nesting depth added 10). Of this number, 16 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":"br/pkg/backup/prepare_snap/prepare.go"},"region":{"startLine":184}}}],"partialFingerprints":{"codehealthFindingId/v1":"6f4730b137fd60b351a37a0d031dc5ea1a0d02a765d53658363e219c7f5750ab"}},{"ruleId":"D2","level":"warning","message":{"text":"snapclient.getMinUserTableID (cognitive 19): snapclient.getMinUserTableID has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13, loops 5, boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"br/pkg/restore/snap_client/client.go"},"region":{"startLine":385}}}],"partialFingerprints":{"codehealthFindingId/v1":"02ef2e463db674e194ddc1136e47e0fa155f520261e04a2987beb0ee34bb9de9"}},{"ruleId":"D2","level":"warning","message":{"text":"storeCollector.sendPendingRequests (cognitive 19): storeCollector.sendPendingRequests has cognitive complexity 19 (threshold 15). Drivers by points: if/else 17, boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"br/pkg/streamhelper/collector.go"},"region":{"startLine":173}}}],"partialFingerprints":{"codehealthFindingId/v1":"30bc277d0d0684c0f3c2fe2f9ee90d7b00163f0f574f8086745b24c3fb54be00"}},{"ruleId":"D2","level":"warning","message":{"text":"task.RunBackupTxn (cognitive 19): task.RunBackupTxn has cognitive complexity 19 (threshold 15). Drivers by points: if/else 18, boolean chains 1 (nesting depth added 3). Of this number, 14 points are the body\u0027s own statements and 5 belong to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"br/pkg/task/backup_txn.go"},"region":{"startLine":108}}}],"partialFingerprints":{"codehealthFindingId/v1":"5f62bcf8579d32fa62f008c3c3803908fbf547764ec362131b80197650d51693"}},{"ruleId":"D2","level":"warning","message":{"text":"util.shouldRun (cognitive 19): util.shouldRun has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15, loops 4 (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":"build/linter/util/exclude.go"},"region":{"startLine":25}}}],"partialFingerprints":{"codehealthFindingId/v1":"753d56178c71466218e5b3739244b20ac3da24f3126dab2727c4bc14cf46a1c3"}},{"ruleId":"D2","level":"warning","message":{"text":"export.GetSpecifiedColumnValuesAndClose (cognitive 19): export.GetSpecifiedColumnValuesAndClose has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13, 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":"dumpling/export/sql.go"},"region":{"startLine":810}}}],"partialFingerprints":{"codehealthFindingId/v1":"6241ca33f28f62e2bc6fff21674e995ee6f16a75de553d159959b34d4e3be9c4"}},{"ruleId":"D2","level":"warning","message":{"text":"ConsistencyLockDumpingTables.Setup (cognitive 19): ConsistencyLockDumpingTables.Setup has cognitive complexity 19 (threshold 15). Drivers by points: if/else 18, boolean chains 1 (nesting depth added 9). Most of this is not in the body itself: 7 of the 19 points are its own statements and the rest belongs to one function literal inside it that branches (line 138). 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":"dumpling/export/consistency.go"},"region":{"startLine":128}}}],"partialFingerprints":{"codehealthFindingId/v1":"e5f48b82c9b4dd4ecd81d0ad7d1371c136e8d5c8b4e3ea55986301d5843e5c7c"}},{"ruleId":"D2","level":"warning","message":{"text":"MySQLCheckpointsDB.Get (cognitive 19): MySQLCheckpointsDB.Get has cognitive complexity 19 (threshold 15). Drivers by points: if/else 17, loops 2 (nesting depth added 5). Most of this is not in the body itself: 1 of the 19 points is its own statement and the rest belongs to one function literal inside it that branches (line 900). 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":"lightning/pkg/checkpoints/checkpoints.go"},"region":{"startLine":891}}}],"partialFingerprints":{"codehealthFindingId/v1":"dcc51865d0ed36abcdbb3e2dc7fe964c18a4bcf11b713eb5bc08ca2ce8120812"}},{"ruleId":"D2","level":"warning","message":{"text":"ErrorManager.Init (cognitive 19): ErrorManager.Init has cognitive complexity 19 (threshold 15). Drivers by points: if/else 17, boolean chains 1, loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lightning/pkg/errormanager/errormanager.go"},"region":{"startLine":268}}}],"partialFingerprints":{"codehealthFindingId/v1":"05acc851375873ec8842516a01a57fb1f66fe7e8a1e02692606d1ea2c2298d63"}},{"ruleId":"D2","level":"warning","message":{"text":"autoIDValue.alloc4Unsigned (cognitive 19): autoIDValue.alloc4Unsigned has cognitive complexity 19 (threshold 15). Drivers by points: if/else 17, boolean chains 2 (nesting depth added 7). Of this number, 10 points are the body\u0027s own statements and 9 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/autoid_service/autoid.go"},"region":{"startLine":64}}}],"partialFingerprints":{"codehealthFindingId/v1":"45b5039af959af8f8004029913076321d96203718302c0e17ead221876d940ff"}},{"ruleId":"D2","level":"warning","message":{"text":"autoIDValue.alloc4Signed (cognitive 19): autoIDValue.alloc4Signed has cognitive complexity 19 (threshold 15). Drivers by points: if/else 17, boolean chains 2 (nesting depth added 7). Of this number, 10 points are the body\u0027s own statements and 9 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/autoid_service/autoid.go"},"region":{"startLine":134}}}],"partialFingerprints":{"codehealthFindingId/v1":"567c705f41bba27ff106da4b10a8ad6f531f86f98bac04f0c37338bcd0a0da28"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.checkTableForeignKey (cognitive 19): ddl.checkTableForeignKey has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14, boolean chains 4, 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":"pkg/ddl/foreign_key.go"},"region":{"startLine":260}}}],"partialFingerprints":{"codehealthFindingId/v1":"ab72d36a0fc6fa72a14cf05503fefbdd52933c7473aa7ed157eec1ed966cb937"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.JobNeedGC (cognitive 19): ddl.JobNeedGC has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13, loops 3, match/switch 2, boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/job_worker.go"},"region":{"startLine":363}}}],"partialFingerprints":{"codehealthFindingId/v1":"072e6b08dd1428a8b2222d8fe57d8ccb3ae22f030fb443a2e3358b3ee62b39d0"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.fillMultiSchemaInfo (cognitive 19): ddl.fillMultiSchemaInfo has cognitive complexity 19 (threshold 15). Drivers by points: loops 9, if/else 7, boolean chains 2, match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction \u2014 a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full \u2014 so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/multi_schema_change.go"},"region":{"startLine":259}}}],"partialFingerprints":{"codehealthFindingId/v1":"4e2f75b17d79eb14a7c02ee8a0baad941bcee3fbce28364d7a2b04c47ff642bf"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.comparePartitionDefinitions (cognitive 19): ddl.comparePartitionDefinitions has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, boolean chains 2, 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":"pkg/ddl/partition.go"},"region":{"startLine":1026}}}],"partialFingerprints":{"codehealthFindingId/v1":"638e7dfc4775187195529f88e626b1547f31d265d35efa1003f283a6016902e9"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.convertJob2RollbackJob (cognitive 19): ddl.convertJob2RollbackJob has cognitive complexity 19 (threshold 15). Drivers by points: if/else 17, boolean chains 1, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/rollingback.go"},"region":{"startLine":605}}}],"partialFingerprints":{"codehealthFindingId/v1":"93806105451c9750774ed0037aa52ef674ca32b51255af87e7cde425a8a21d8e"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.onRebaseAutoID (cognitive 19): ddl.onRebaseAutoID has cognitive complexity 19 (threshold 15). Drivers by points: if/else 18, 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, 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":"pkg/ddl/table.go"},"region":{"startLine":646}}}],"partialFingerprints":{"codehealthFindingId/v1":"9a66ff204ef8eaf4d29b382930abc52b6ae486c9bc03315b2663fba600f47054"}},{"ruleId":"D2","level":"warning","message":{"text":"worker.rollbackLikeDropPartition (cognitive 19): worker.rollbackLikeDropPartition has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, loops 2, boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/partition.go"},"region":{"startLine":2198}}}],"partialFingerprints":{"codehealthFindingId/v1":"a9e38e46682cb6605b5cba03c23fccf216128cf675ffa7294f6d20b3667b0270"}},{"ruleId":"D2","level":"warning","message":{"text":"SchemaTracker.AlterSchema (cognitive 19): SchemaTracker.AlterSchema has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, match/switch 2, loops 1 (nesting depth added 8). Of this number, 18 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body 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/ddl/schematracker/dm_tracker.go"},"region":{"startLine":116}}}],"partialFingerprints":{"codehealthFindingId/v1":"2442adada18d333e0922c79385ad2c2226707f968ae6985e8f3152f17804cb03"}},{"ruleId":"D2","level":"warning","message":{"text":"executor.buildIndexScanOutputOffsets (cognitive 19): executor.buildIndexScanOutputOffsets has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13, loops 6 (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/executor/builder.go"},"region":{"startLine":4498}}}],"partialFingerprints":{"codehealthFindingId/v1":"9db236e4f1acbe8fc3e7f4be5b875d54e2301262079f29efe5ffedd5e2834435"}},{"ruleId":"D2","level":"warning","message":{"text":"executor.buildRangesForIndexJoin (cognitive 19): executor.buildRangesForIndexJoin has cognitive complexity 19 (threshold 15). Drivers by points: loops 14, if/else 5 (nesting depth added 10). 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":"pkg/executor/builder.go"},"region":{"startLine":5450}}}],"partialFingerprints":{"codehealthFindingId/v1":"f20f0f50930dfa04dec16116f9e5eb0a49e5711343bee45a926307aafb8efaa5"}},{"ruleId":"D2","level":"warning","message":{"text":"executor.decodeOldRowValToChunk (cognitive 19): executor.decodeOldRowValToChunk has cognitive complexity 19 (threshold 15). Drivers by points: if/else 17, loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/point_get.go"},"region":{"startLine":744}}}],"partialFingerprints":{"codehealthFindingId/v1":"95b4f80bf6cacfe80811de13da746420efda1b0fe0c0675564d31ce673091464"}},{"ruleId":"D2","level":"warning","message":{"text":"CheckIndexRangeExec.Next (cognitive 19): CheckIndexRangeExec.Next has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12, loops 6, boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/admin.go"},"region":{"startLine":68}}}],"partialFingerprints":{"codehealthFindingId/v1":"95f75d3d56048f580ba7553d3a4d0080ff88c5f50e232d982680223836ab48d9"}},{"ruleId":"D2","level":"warning","message":{"text":"executorBuilder.buildAnalyzeSamplingPushdown (cognitive 19): executorBuilder.buildAnalyzeSamplingPushdown has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14, loops 5 (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":"pkg/executor/builder.go"},"region":{"startLine":3130}}}],"partialFingerprints":{"codehealthFindingId/v1":"6bba37158aeac8f3480722a0f0d75dc6c26e8cbe7afe369a30c67786f8a8e51e"}},{"ruleId":"D2","level":"warning","message":{"text":"FKCascadeExec.buildFKCascadePlan (cognitive 19): FKCascadeExec.buildFKCascadePlan has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12, match/switch 5, boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/foreign_key.go"},"region":{"startLine":761}}}],"partialFingerprints":{"codehealthFindingId/v1":"d7c02031f10aa5c8e814587ca92f1174aaa4fe070f58ca55fa5672db853246b1"}},{"ruleId":"D2","level":"warning","message":{"text":"importer.prepareSortDir (cognitive 19): importer.prepareSortDir has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, boolean chains 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":"pkg/executor/importer/table_import.go"},"region":{"startLine":142}}}],"partialFingerprints":{"codehealthFindingId/v1":"129804cb014234ce637d6d99a5ad4de16dfb1b3adc429b55620a0952974e2132"}},{"ruleId":"D2","level":"warning","message":{"text":"Plan.initParameters (cognitive 19): Plan.initParameters has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14, loops 5 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/importer/import.go"},"region":{"startLine":1069}}}],"partialFingerprints":{"codehealthFindingId/v1":"b5cd4adf973e18f1929a2bd6b3d5385bbd58ea5d00f9fe549435b5bb49938763"}},{"ruleId":"D2","level":"warning","message":{"text":"calibrateresource.fetchStoreMetrics (cognitive 19): calibrateresource.fetchStoreMetrics has cognitive complexity 19 (threshold 15). Drivers by points: if/else 18, loops 1 (nesting depth added 10). 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":"pkg/executor/internal/calibrateresource/calibrate_resource.go"},"region":{"startLine":649}}}],"partialFingerprints":{"codehealthFindingId/v1":"f817ddb55572a275815896cbb46e65f4a3fc8293f7adff4ea13a9e2b57f34d72"}},{"ruleId":"D2","level":"warning","message":{"text":"BuildWorkerV1.BuildHashTableForList (cognitive 19): BuildWorkerV1.BuildHashTableForList has cognitive complexity 19 (threshold 15). Drivers by points: if/else 18, loops 1 (nesting depth added 9). 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":"pkg/executor/join/hash_join_v1.go"},"region":{"startLine":1105}}}],"partialFingerprints":{"codehealthFindingId/v1":"278872ead823eb39cabe4dc76d5fc83612aff93b86be8247e5ad3e597f27cf31"}},{"ruleId":"D2","level":"warning","message":{"text":"HashJoinV2Exec.createTasks (cognitive 19): HashJoinV2Exec.createTasks has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 7, if/else 6, loops 6 (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/executor/join/hash_join_v2.go"},"region":{"startLine":1215}}}],"partialFingerprints":{"codehealthFindingId/v1":"06866595b4966b3ff6c44d11a43cd6b031cbb4067954cec276f1d2084ca58dbb"}},{"ruleId":"D2","level":"warning","message":{"text":"indexHashJoinInnerWorker.joinMatchedInnerRow2Chunk (cognitive 19): indexHashJoinInnerWorker.joinMatchedInnerRow2Chunk has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12, loops 3, match/switch 3, boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/join/index_lookup_hash_join.go"},"region":{"startLine":855}}}],"partialFingerprints":{"codehealthFindingId/v1":"6b88248bf6357bbd7f78c99183dcee8f9687faeee412f6e7b9f9034ddd47c274"}},{"ruleId":"D2","level":"warning","message":{"text":"rowTableBuilder.preAllocForSegmentsInSpill (cognitive 19): rowTableBuilder.preAllocForSegmentsInSpill has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15, loops 4 (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":"pkg/executor/join/row_table_builder.go"},"region":{"startLine":254}}}],"partialFingerprints":{"codehealthFindingId/v1":"dd8d72aa2bf48073193acf7ef6eb30aab1a52a69836eedea43f5c18c4ef17f13"}},{"ruleId":"D2","level":"warning","message":{"text":"memRowsIterForIndex.Next (cognitive 19): memRowsIterForIndex.Next has cognitive complexity 19 (threshold 15). Drivers by points: if/else 18, 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/executor/mem_reader.go"},"region":{"startLine":986}}}],"partialFingerprints":{"codehealthFindingId/v1":"6d2baad709083ee733cbb7d709edaece49fb7805d29c6772b56f993675d36389"}},{"ruleId":"D2","level":"warning","message":{"text":"RevokeExec.Next (cognitive 19): RevokeExec.Next has cognitive complexity 19 (threshold 15). Drivers by points: if/else 18, loops 1 (nesting depth added 6). Of this number, 16 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":"pkg/executor/revoke.go"},"region":{"startLine":63}}}],"partialFingerprints":{"codehealthFindingId/v1":"30cd859650f7b68c9e380e4d1dbb2c4919bcf9d9dee72bd5192d45bf663a2123"}},{"ruleId":"D2","level":"warning","message":{"text":"sampleFetcher.run (cognitive 19): sampleFetcher.run has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, 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":"pkg/executor/sample.go"},"region":{"startLine":373}}}],"partialFingerprints":{"codehealthFindingId/v1":"2767aaa0d5bb771fbc1eb7b2b4f8b66aab46bcb54f4f2c1726d70efe3e2f81c8"}},{"ruleId":"D2","level":"warning","message":{"text":"ShowExec.fetchShowGrants (cognitive 19): ShowExec.fetchShowGrants 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":"pkg/executor/show.go"},"region":{"startLine":1994}}}],"partialFingerprints":{"codehealthFindingId/v1":"d956610453aae1a643df40235b8bebb602196c6a61baf0e87773fdd1bf72aeb0"}},{"ruleId":"D2","level":"warning","message":{"text":"SimpleExec.setDefaultRoleAll (cognitive 19): SimpleExec.setDefaultRoleAll has cognitive complexity 19 (threshold 15). Drivers by points: if/else 17, loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/simple.go"},"region":{"startLine":323}}}],"partialFingerprints":{"codehealthFindingId/v1":"c26b5bd2027507788dda1bf749de1736c9d88c10a9cd23e141ec22c0cfaef16c"}},{"ruleId":"D2","level":"warning","message":{"text":"SimpleExec.executeRollback (cognitive 19): SimpleExec.executeRollback has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14, boolean chains 5 (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":"pkg/executor/simple.go"},"region":{"startLine":795}}}],"partialFingerprints":{"codehealthFindingId/v1":"f5af0a554dbbed00dbf7f6850da2471aa238efddbb40e1e7e28c7210f714a9d8"}},{"ruleId":"D2","level":"warning","message":{"text":"SimpleExec.executeKillStmt (cognitive 19): SimpleExec.executeKillStmt has cognitive complexity 19 (threshold 15). Drivers by points: if/else 18, boolean chains 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":"pkg/executor/simple.go"},"region":{"startLine":3046}}}],"partialFingerprints":{"codehealthFindingId/v1":"6edff672df57209be2baf2dce67c0a713d70dc8fc4fba0d267d33210beb7bfc8"}},{"ruleId":"D2","level":"warning","message":{"text":"topNSpillHelper.spillHeap (cognitive 19): topNSpillHelper.spillHeap has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, boolean chains 2, loops 1 (nesting depth added 7). Of this number, 18 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body 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/executor/sortexec/topn_spill.go"},"region":{"startLine":198}}}],"partialFingerprints":{"codehealthFindingId/v1":"22fb3e533b88a236824190d2562b02e17ebc008d903a714a5ae682f75a6e7dcd"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinArithmeticIntDivideDecimalSig.evalInt (cognitive 19): builtinArithmeticIntDivideDecimalSig.evalInt has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15, 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":"pkg/expression/builtin_arithmetic.go"},"region":{"startLine":926}}}],"partialFingerprints":{"codehealthFindingId/v1":"a420bd2bb2de805155f057c94b1697d950b550b6ac58ee8b2bb25d7ce67332e7"}},{"ruleId":"D2","level":"warning","message":{"text":"arithmeticModFunctionClass.getFunction (cognitive 19): arithmeticModFunctionClass.getFunction has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13, boolean chains 5, match/switch 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":"pkg/expression/builtin_arithmetic.go"},"region":{"startLine":1002}}}],"partialFingerprints":{"codehealthFindingId/v1":"6a62a93474141dfa4035ed9b8cd55add79763c0140b04a3c89b4f3408d89cebc"}},{"ruleId":"D2","level":"warning","message":{"text":"roundFunctionClass.getFunction (cognitive 19): roundFunctionClass.getFunction has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14, match/switch 4, boolean chains 1 (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":"pkg/expression/builtin_math.go"},"region":{"startLine":268}}}],"partialFingerprints":{"codehealthFindingId/v1":"02976db789b897dcc68ff179f5eafaf1384adca6dbef7525e88774b86110e1b1"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinUnaryMinusIntSig.vecEvalInt (cognitive 19): builtinUnaryMinusIntSig.vecEvalInt has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15, loops 4 (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/expression/builtin_op_vec.go"},"region":{"startLine":545}}}],"partialFingerprints":{"codehealthFindingId/v1":"939ebce0b39a54fea835454790437de64fb7b26b66bc1c8b4a197887579b0dc3"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinInIntSig.buildHashMapForConstArgs (cognitive 19): builtinInIntSig.buildHashMapForConstArgs has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, match/switch 2, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/builtin_other.go"},"region":{"startLine":212}}}],"partialFingerprints":{"codehealthFindingId/v1":"14509af78fbfb2c2730fd3db60d0eadb3512f19d7430d5507edee94333a0be48"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinInStringSig.buildHashMapForConstArgs (cognitive 19): builtinInStringSig.buildHashMapForConstArgs has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, match/switch 2, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/builtin_other.go"},"region":{"startLine":339}}}],"partialFingerprints":{"codehealthFindingId/v1":"99334a334087b80015defe8c6f32cecc07acc9ab1ab430a307cc0de955c0f82e"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinInRealSig.buildHashMapForConstArgs (cognitive 19): builtinInRealSig.buildHashMapForConstArgs has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, match/switch 2, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/builtin_other.go"},"region":{"startLine":448}}}],"partialFingerprints":{"codehealthFindingId/v1":"b9be53280664af29d4bf702eb63fa1ffb22a09883ecc68cc11044f1decf5eeed"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinInTimeSig.buildHashMapForConstArgs (cognitive 19): builtinInTimeSig.buildHashMapForConstArgs has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, match/switch 2, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/builtin_other.go"},"region":{"startLine":669}}}],"partialFingerprints":{"codehealthFindingId/v1":"fa14540bf255cb5db8503308f100782b20d03e9c1c7b4938b189c0297383919f"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinInDurationSig.buildHashMapForConstArgs (cognitive 19): builtinInDurationSig.buildHashMapForConstArgs has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, match/switch 2, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/builtin_other.go"},"region":{"startLine":775}}}],"partialFingerprints":{"codehealthFindingId/v1":"bdd155eeb37e30110c93d883e5f3e5ffd69efaaea71543c8487a248ebb2474f2"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinRepeatSig.vecEvalString (cognitive 19): builtinRepeatSig.vecEvalString has cognitive complexity 19 (threshold 15). Drivers by points: if/else 17, 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":"pkg/expression/builtin_string_vec.go"},"region":{"startLine":72}}}],"partialFingerprints":{"codehealthFindingId/v1":"3161d8a2ac93d979d8e0c5c41b0fc316fa2c875e5e2c6169cfb91d44a784f13e"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinSubstring3ArgsSig.vecEvalString (cognitive 19): builtinSubstring3ArgsSig.vecEvalString has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, boolean chains 2, 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":"pkg/expression/builtin_string_vec.go"},"region":{"startLine":2825}}}],"partialFingerprints":{"codehealthFindingId/v1":"87dc3135abbcdd90e2cf610bccad4f48e6448f051069d31f61ac2a04ab29aa25"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinSubstring3ArgsUTF8Sig.vecEvalString (cognitive 19): builtinSubstring3ArgsUTF8Sig.vecEvalString has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, boolean chains 2, 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":"pkg/expression/builtin_string_vec.go"},"region":{"startLine":2031}}}],"partialFingerprints":{"codehealthFindingId/v1":"6cfca909a1dfdf23150dec4fa8508736f7959264b056daa17762fb9f42b1035e"}},{"ruleId":"D2","level":"warning","message":{"text":"weightStringFunctionClass.verifyArgs (cognitive 19): weightStringFunctionClass.verifyArgs has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, match/switch 2, 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":"pkg/expression/builtin_string.go"},"region":{"startLine":4197}}}],"partialFingerprints":{"codehealthFindingId/v1":"fd6649f009ad0613f5707431f3e0a51e0f4188b9421bb64d15242e7fab1b0d6f"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinDateDiffSig.vecEvalInt (cognitive 19): builtinDateDiffSig.vecEvalInt has cognitive complexity 19 (threshold 15). Drivers by points: if/else 17, 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":"pkg/expression/builtin_time_vec.go"},"region":{"startLine":1994}}}],"partialFingerprints":{"codehealthFindingId/v1":"a7e061e75293e996068ee5f0efd75510105c25771b26c31f87c26e1997b111d9"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinStrToDateDateSig.vecEvalTime (cognitive 19): builtinStrToDateDateSig.vecEvalTime has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, boolean chains 2, 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":"pkg/expression/builtin_time_vec.go"},"region":{"startLine":706}}}],"partialFingerprints":{"codehealthFindingId/v1":"bf8d303d7de706028b582660700f5850b7b87268a8ccbaa53da2bdf0a73952cd"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinStrToDateDatetimeSig.vecEvalTime (cognitive 19): builtinStrToDateDatetimeSig.vecEvalTime has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, boolean chains 2, 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":"pkg/expression/builtin_time_vec.go"},"region":{"startLine":1487}}}],"partialFingerprints":{"codehealthFindingId/v1":"ed18a1b65a46a52f7f9d14867a5bc73d9d13c8579884ca6e9fe6f87d792a503c"}},{"ruleId":"D2","level":"warning","message":{"text":"extension.newSessionExtensions (cognitive 19): extension.newSessionExtensions has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15, loops 4 (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":"pkg/extension/session.go"},"region":{"startLine":104}}}],"partialFingerprints":{"codehealthFindingId/v1":"989218ca411d19c69e0c7259a3e9d08f805aedfa1cfca857901a7da6fc7a5758"}},{"ruleId":"D2","level":"warning","message":{"text":"dupeDetector.RecordDataConflictError (cognitive 19): dupeDetector.RecordDataConflictError 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":"pkg/ingestor/ingestctrl/duplicate.go"},"region":{"startLine":475}}}],"partialFingerprints":{"codehealthFindingId/v1":"14c2da9584e89d40b63723b69dd7bf9e555a72bace9b56f0d8142982df585fae"}},{"ruleId":"D2","level":"warning","message":{"text":"objStoreRegionJobWorker.write (cognitive 19): objStoreRegionJobWorker.write has cognitive complexity 19 (threshold 15). Drivers by points: if/else 18, loops 1 (nesting depth added 4). Of this number, 15 points are the body\u0027s own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ingestor/ingestctrl/job_worker.go"},"region":{"startLine":355}}}],"partialFingerprints":{"codehealthFindingId/v1":"63ce70448a3f0b59900c76afc3dbe989dab120cc089a5b5758b3e5f2aac4b683"}},{"ruleId":"D2","level":"warning","message":{"text":"Writer.flushKVs (cognitive 19): Writer.flushKVs has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12, boolean chains 3, loops 2, match/switch 2 (nesting depth added 5). 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":"pkg/ingestor/simplesst/writer.go"},"region":{"startLine":573}}}],"partialFingerprints":{"codehealthFindingId/v1":"d64a6cf17fbd820d68b9ea690e973c3a8933ca93dcffe07097f9f5f8f1c82440"}},{"ruleId":"D2","level":"warning","message":{"text":"common.NormalizeError (cognitive 19): common.NormalizeError has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15, boolean chains 2, match/switch 2 (nesting depth added 6). Of this number, 18 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body 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/lightning/common/errors.go"},"region":{"startLine":147}}}],"partialFingerprints":{"codehealthFindingId/v1":"b01d323251c1e44c22700a34414fe1146e3180055434d9474861e9162b54c4b0"}},{"ruleId":"D2","level":"warning","message":{"text":"autoid.SeekToFirstSequenceValue (cognitive 19): autoid.SeekToFirstSequenceValue has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14, loops 5 (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/meta/autoid/autoid.go"},"region":{"startLine":828}}}],"partialFingerprints":{"codehealthFindingId/v1":"007ab28f01b85bed7dece33b65cb29846b3383355050739d25df535843e18fd6"}},{"ruleId":"D2","level":"warning","message":{"text":"Job.CheckInvolvingSchemaInfo (cognitive 19): Job.CheckInvolvingSchemaInfo has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14, boolean chains 4, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/meta/model/job.go"},"region":{"startLine":956}}}],"partialFingerprints":{"codehealthFindingId/v1":"3ecc3c9e2a0d6df8d6af237e367c5430ab82b416df254f11828b91c3397addcd"}},{"ruleId":"D2","level":"warning","message":{"text":"PartitionInfo.GetOverlappingDroppingPartitionIdx (cognitive 19): PartitionInfo.GetOverlappingDroppingPartitionIdx has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13, loops 3, match/switch 2, boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/meta/model/table.go"},"region":{"startLine":1083}}}],"partialFingerprints":{"codehealthFindingId/v1":"1418befaba412a99e4e78635946be028667e96ef2406f9198bc183fe7e884a83"}},{"ruleId":"D2","level":"warning","message":{"text":"PartitionInfo.IDsInDDLToIgnore (cognitive 19): PartitionInfo.IDsInDDLToIgnore has cognitive complexity 19 (threshold 15). Drivers by points: loops 9, if/else 7, match/switch 3 (nesting depth added 11). 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":"pkg/meta/model/table.go"},"region":{"startLine":1136}}}],"partialFingerprints":{"codehealthFindingId/v1":"eaf1554c384d7fa50f0c5ad94f1e7a999c84319f7bd6dbe15772693653fd728a"}},{"ruleId":"D2","level":"warning","message":{"text":"cardinality.getPseudoRowCountByColumnRanges (cognitive 19): cardinality.getPseudoRowCountByColumnRanges has cognitive complexity 19 (threshold 15). Drivers by points: if/else 17, 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":"pkg/planner/cardinality/pseudo.go"},"region":{"startLine":211}}}],"partialFingerprints":{"codehealthFindingId/v1":"7a0b86512ab752aa52ac8b1bc22af76a35b3870ae238a064ba25aebafa99b629"}},{"ruleId":"D2","level":"warning","message":{"text":"outerJoinEliminator.isInnerJoinKeysContainUniqueKey (cognitive 19): outerJoinEliminator.isInnerJoinKeysContainUniqueKey has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13, loops 6 (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/planner/cascades/old/transformation_rules.go"},"region":{"startLine":1896}}}],"partialFingerprints":{"codehealthFindingId/v1":"5620d6fcabc94612f8f82005c536bd86a7c21c43f4de60f43fb8b09f5f978d8a"}},{"ruleId":"D2","level":"warning","message":{"text":"core.prepareOperatorInfo (cognitive 19): core.prepareOperatorInfo has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15, boolean chains 4 (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/planner/core/common_plans.go"},"region":{"startLine":1068}}}],"partialFingerprints":{"codehealthFindingId/v1":"ef51efc60655b5b3e2350023a246a83023d526bf490e4d6a71c5fdc5def5dcd0"}},{"ruleId":"D2","level":"warning","message":{"text":"core.getColsNDVLowerBoundFromHistColl (cognitive 19): core.getColsNDVLowerBoundFromHistColl has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12, boolean chains 5, 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":"pkg/planner/core/exhaust_physical_plans.go"},"region":{"startLine":1017}}}],"partialFingerprints":{"codehealthFindingId/v1":"028e825db29ab8ee956ef10e02848b6f3ec3d60f59517b1b426b8718995f5254"}},{"ruleId":"D2","level":"warning","message":{"text":"core.matchPartialOrderProperty (cognitive 19): core.matchPartialOrderProperty has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15, boolean chains 2, 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":"pkg/planner/core/find_best_task.go"},"region":{"startLine":1242}}}],"partialFingerprints":{"codehealthFindingId/v1":"6f947c1bfa02a8ff59d4a3313e292c160bfe64f96bb6babc2a47771fc49899b1"}},{"ruleId":"D2","level":"warning","message":{"text":"core.indexJoinPathBuildColManager (cognitive 19): core.indexJoinPathBuildColManager has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11, boolean chains 4, loops 3, jumps 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/planner/core/index_join_path.go"},"region":{"startLine":668}}}],"partialFingerprints":{"codehealthFindingId/v1":"92a60164abeed8a921bd76204e5f1ab4233eeaafc0855b8d2296f2a7b2703c14"}},{"ruleId":"D2","level":"warning","message":{"text":"core.collectFilters4MVIndex (cognitive 19): core.collectFilters4MVIndex has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14, loops 4, 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":"pkg/planner/core/indexmerge_path.go"},"region":{"startLine":1038}}}],"partialFingerprints":{"codehealthFindingId/v1":"0abf8b66ab4dcd20a89b4c565c030cfac971fed4c1469f63ddd6089adbb5dee5"}},{"ruleId":"D2","level":"warning","message":{"text":"core.getUintFromNode (cognitive 19): core.getUintFromNode has cognitive complexity 19 (threshold 15). Drivers by points: if/else 17, match/switch 2 (nesting depth added 9). The drivers above price the dispatch low by construction \u2014 a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full \u2014 so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/logical_plan_builder.go"},"region":{"startLine":2496}}}],"partialFingerprints":{"codehealthFindingId/v1":"a93eb075046c065894ddd7561518f33971e2a19022d616ad63843d5aa7e8ea38"}},{"ruleId":"D2","level":"warning","message":{"text":"core.tryReturnDistanceFromIndex (cognitive 19): core.tryReturnDistanceFromIndex has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14, loops 3, boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/task.go"},"region":{"startLine":988}}}],"partialFingerprints":{"codehealthFindingId/v1":"93ba04481dd02e742735afd97f14cbddb5f1af3afbf57f5fcdcb4bbbb73496a7"}},{"ruleId":"D2","level":"warning","message":{"text":"FullTextIndexResolverTopN.onEnterDataSource (cognitive 19): FullTextIndexResolverTopN.onEnterDataSource has cognitive complexity 19 (threshold 15). Drivers by points: if/else 17, 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, 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":"pkg/planner/core/fts_resolve_index.go"},"region":{"startLine":213}}}],"partialFingerprints":{"codehealthFindingId/v1":"d0bd64cf1e28eaa6ab519e3e5e0f056498ef0e13d8e481bc078bb718729ba8c4"}},{"ruleId":"D2","level":"warning","message":{"text":"joinorder.extractEqualityColumns (cognitive 19): joinorder.extractEqualityColumns has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13, boolean chains 3, loops 2, match/switch 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":"pkg/planner/core/joinorder/ordered_leading.go"},"region":{"startLine":332}}}],"partialFingerprints":{"codehealthFindingId/v1":"68f76fcd5a8e11efa888a2b9df97bdab9833b00333b245915c9bb2311e254c7d"}},{"ruleId":"D2","level":"warning","message":{"text":"joinorder.rewriteExprTree (cognitive 19): joinorder.rewriteExprTree has cognitive complexity 19 (threshold 15). Drivers by points: if/else 17, loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/joinorder/util.go"},"region":{"startLine":176}}}],"partialFingerprints":{"codehealthFindingId/v1":"8b7fd1dcc818b51e97413370be5d47d402fe33f84ed6885477cf17bb4a5304d6"}},{"ruleId":"D2","level":"warning","message":{"text":"DataSource.PruneColumns (cognitive 19): DataSource.PruneColumns has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10, boolean chains 7, loops 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/operator/logicalop/logical_datasource.go"},"region":{"startLine":200}}}],"partialFingerprints":{"codehealthFindingId/v1":"4c5f55b176499f14fb99aaaaaed1a58a6cead99a24f93e487e839134707c5519"}},{"ruleId":"D2","level":"warning","message":{"text":"LogicalJoin.ColumnSubstituteAll (cognitive 19): LogicalJoin.ColumnSubstituteAll has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14, loops 5 (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":"pkg/planner/core/operator/logicalop/logical_join.go"},"region":{"startLine":1009}}}],"partialFingerprints":{"codehealthFindingId/v1":"f86e98884fe447987883ccef11ced8b05df3a0ac9b161106b5b85cafbd3879c7"}},{"ruleId":"D2","level":"warning","message":{"text":"physicalop.partitionPruning (cognitive 19): physicalop.partitionPruning has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11, loops 7, 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":"pkg/planner/core/operator/physicalop/fragment.go"},"region":{"startLine":792}}}],"partialFingerprints":{"codehealthFindingId/v1":"906c53b7d4c6ecdbafe0dfe3ad7ee7d7e501837fbc2ea3795bf31ccecfa9c781"}},{"ruleId":"D2","level":"warning","message":{"text":"PhysicalIndexJoin.ExplainInfoInternal (cognitive 19): PhysicalIndexJoin.ExplainInfoInternal has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15, boolean chains 2, 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":"pkg/planner/core/operator/physicalop/physical_index_join.go"},"region":{"startLine":147}}}],"partialFingerprints":{"codehealthFindingId/v1":"6e474d45c3ae7f07d3481a7d36ee89dd92af1ba9ffc0988c3b0833e2a2562fba"}},{"ruleId":"D2","level":"warning","message":{"text":"PlanBuilder.buildPhysicalIndexLookUpReader (cognitive 19): PlanBuilder.buildPhysicalIndexLookUpReader has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11, loops 7, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/planbuilder.go"},"region":{"startLine":1792}}}],"partialFingerprints":{"codehealthFindingId/v1":"6eaf8d4328d32c925a7572c29599da626c3984f8c7100fcaa0bcca2ae9800b23"}},{"ruleId":"D2","level":"warning","message":{"text":"PlanBuilder.genV2AnalyzeOptions (cognitive 19): PlanBuilder.genV2AnalyzeOptions has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, boolean chains 2, 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":"pkg/planner/core/planbuilder.go"},"region":{"startLine":2827}}}],"partialFingerprints":{"codehealthFindingId/v1":"0bcd3d46f97d74c546bf07f83ddf57751114ed700a49cbcd6cec0f0867af8d55"}},{"ruleId":"D2","level":"warning","message":{"text":"preprocessor.checkAutoIncrement (cognitive 19): preprocessor.checkAutoIncrement has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10, match/switch 5, loops 4 (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":"pkg/planner/core/preprocess.go"},"region":{"startLine":794}}}],"partialFingerprints":{"codehealthFindingId/v1":"4cdd55589ec413bec72910ff39f0307f979af3b08314ce364b36a497f6dd62d5"}},{"ruleId":"D2","level":"warning","message":{"text":"rule.canConvertAntiJoin (cognitive 19): rule.canConvertAntiJoin has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12, boolean chains 3, loops 3, match/switch 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/rule/rule_outer_join_to_semi_join.go"},"region":{"startLine":217}}}],"partialFingerprints":{"codehealthFindingId/v1":"dbe022c7855d38cfc03338f537ac6edc460fa7955c5c028a57aec22bfd716dd9"}},{"ruleId":"D2","level":"warning","message":{"text":"ProjectionEliminator.eliminate (cognitive 19): ProjectionEliminator.eliminate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8, loops 7, boolean chains 3, match/switch 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":"pkg/planner/core/rule_eliminate_projection.go"},"region":{"startLine":158}}}],"partialFingerprints":{"codehealthFindingId/v1":"f53a94767ebc3b4e7b602897aef747419911c654995961372eee4ff50ebb4780"}},{"ruleId":"D2","level":"warning","message":{"text":"util.ExtractTableAlias (cognitive 19): util.ExtractTableAlias has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14, boolean chains 3, 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":"pkg/planner/util/misc.go"},"region":{"startLine":244}}}],"partialFingerprints":{"codehealthFindingId/v1":"3215118783a413236864a18a2c75cea29b24d13c6bdc33ba48ed36ba58eff8af"}},{"ruleId":"D2","level":"warning","message":{"text":"fixcontrol.ParseToMap (cognitive 19): fixcontrol.ParseToMap has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15, boolean chains 3, 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":"pkg/planner/util/fixcontrol/set.go"},"region":{"startLine":26}}}],"partialFingerprints":{"codehealthFindingId/v1":"805626b675cef2bae2e9b5d31e25074a399891a32dc59a89037edb127324cedd"}},{"ruleId":"D2","level":"warning","message":{"text":"MySQLPrivilege.LoadAll (cognitive 19): MySQLPrivilege.LoadAll has cognitive complexity 19 (threshold 15). Drivers by points: if/else 19 (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":"pkg/privilege/privileges/cache.go"},"region":{"startLine":451}}}],"partialFingerprints":{"codehealthFindingId/v1":"b5998e22f9957f8c3bb2a7ce82417175bbe64f69a212ad2cd886219e6b66c4d8"}},{"ruleId":"D2","level":"warning","message":{"text":"clientConn.executeWithCursor (cognitive 19): clientConn.executeWithCursor has cognitive complexity 19 (threshold 15). Drivers by points: if/else 17, boolean chains 1, loops 1 (nesting depth added 6). Of this number, 12 points are the body\u0027s own statements and 7 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":"pkg/server/conn_stmt.go"},"region":{"startLine":375}}}],"partialFingerprints":{"codehealthFindingId/v1":"c2e39d4bab7cd450599662caa0feec61b817c70457968d88c52b62ea448de52d"}},{"ruleId":"D2","level":"warning","message":{"text":"variable.checkReadOnly (cognitive 19): variable.checkReadOnly has cognitive complexity 19 (threshold 15). Drivers by points: if/else 18, 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":"pkg/sessionctx/variable/varsutil.go"},"region":{"startLine":88}}}],"partialFingerprints":{"codehealthFindingId/v1":"e9ce831c453344ed32602fd469ed0d3036e0b530eb892558c2b4d8b80ec37db9"}},{"ruleId":"D2","level":"warning","message":{"text":"Handle.getStatsByPhysicalID (cognitive 19): Handle.getStatsByPhysicalID has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, boolean chains 3 (nesting depth added 4). Of this number, 16 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":"pkg/statistics/handle/handle.go"},"region":{"startLine":205}}}],"partialFingerprints":{"codehealthFindingId/v1":"9bd3d093691ea2d8d624bcf2176b12bc4665579cccd97bb8887e982de23012f2"}},{"ruleId":"D2","level":"warning","message":{"text":"statsSyncLoad.updateCachedItem (cognitive 19): statsSyncLoad.updateCachedItem has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13, boolean chains 6 (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":"pkg/statistics/handle/syncload/stats_syncload.go"},"region":{"startLine":568}}}],"partialFingerprints":{"codehealthFindingId/v1":"a5056803cf87934b55e0c0f1ebe9c4a9fe12fcba6e08d7ff6bb83696005e41d5"}},{"ruleId":"D2","level":"warning","message":{"text":"copr.formatLocationCoverageSummary (cognitive 19): copr.formatLocationCoverageSummary has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10, match/switch 5, boolean chains 2, 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":"pkg/store/copr/region_cache.go"},"region":{"startLine":126}}}],"partialFingerprints":{"codehealthFindingId/v1":"14ea400a164e78a17237dde5f83a066a16c1b5b3bc04723e422a4b561cb45f79"}},{"ruleId":"D2","level":"warning","message":{"text":"txn.prettyWriteKey (cognitive 19): txn.prettyWriteKey has cognitive complexity 19 (threshold 15). Drivers by points: if/else 17, loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/store/driver/txn/error.go"},"region":{"startLine":188}}}],"partialFingerprints":{"codehealthFindingId/v1":"eac99bcb785dbebe607726d4e28a16eebc6844e3c27abbc0fb9edc2e6e748f36"}},{"ruleId":"D2","level":"warning","message":{"text":"GCWorker.doUnsafeDestroyRangeRequest (cognitive 19): GCWorker.doUnsafeDestroyRangeRequest has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, loops 2, boolean chains 1 (nesting depth added 8). Most of this is not in the body itself: 6 of the 19 points are its own statements and the rest belongs to one function literal inside it that branches (line 1101). 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":"pkg/store/gcworker/gc_worker.go"},"region":{"startLine":1076}}}],"partialFingerprints":{"codehealthFindingId/v1":"5517c6d9feeb87748a9a0ac7e7d64d59d12c212b2156f3c453be06297ca41567"}},{"ruleId":"D2","level":"warning","message":{"text":"coprHandler.handleAnalyzeIndexReq (cognitive 19): coprHandler.handleAnalyzeIndexReq has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15, loops 3, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/store/mockstore/mockcopr/analyze.go"},"region":{"startLine":67}}}],"partialFingerprints":{"codehealthFindingId/v1":"06985caa7003232d5ee628d8adb72f0250f1e7810b77f3ec91a848016ff3467d"}},{"ruleId":"D2","level":"warning","message":{"text":"cophandler.handleAnalyzeIndexReq (cognitive 19): cophandler.handleAnalyzeIndexReq has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14, loops 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":"pkg/store/mockstore/unistore/cophandler/analyze.go"},"region":{"startLine":89}}}],"partialFingerprints":{"codehealthFindingId/v1":"7c9d9f467ea1904792c8f61fb168b800f02dfcef1338abb68b488158e7eaba12"}},{"ruleId":"D2","level":"warning","message":{"text":"cophandler.handleAnalyzeMixedReq (cognitive 19): cophandler.handleAnalyzeMixedReq has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14, loops 4, boolean chains 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/store/mockstore/unistore/cophandler/analyze.go"},"region":{"startLine":547}}}],"partialFingerprints":{"codehealthFindingId/v1":"7835b0aa46d4631570a2989a63dbb8b456ede525eab7049583813e309405c17e"}},{"ruleId":"D2","level":"warning","message":{"text":"closureExecutor.processSelection (cognitive 19): closureExecutor.processSelection has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14, loops 5 (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/store/mockstore/unistore/cophandler/closure_exec.go"},"region":{"startLine":774}}}],"partialFingerprints":{"codehealthFindingId/v1":"d7142e8d4f458cafd699d8a34273891f75162d5266365c88005313508291126d"}},{"ruleId":"D2","level":"warning","message":{"text":"topNExec.open (cognitive 19): topNExec.open has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11, loops 7, 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":"pkg/store/mockstore/unistore/cophandler/mpp_exec.go"},"region":{"startLine":850}}}],"partialFingerprints":{"codehealthFindingId/v1":"3d3022a80f1ea621315db2349bb7e0223202b30c7d2e0b199a3e917b37860b42"}},{"ruleId":"D2","level":"warning","message":{"text":"MemStore.PutWithHint (cognitive 19): MemStore.PutWithHint has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15, loops 3, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/store/mockstore/unistore/lockstore/lockstore.go"},"region":{"startLine":288}}}],"partialFingerprints":{"codehealthFindingId/v1":"12dc4eb0320257e72230bc61d7769a16d3ade5349c41e0064f110eb9e44c10fb"}},{"ruleId":"D2","level":"warning","message":{"text":"MVCCStore.ResolveLock (cognitive 19): MVCCStore.ResolveLock has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, loops 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":"pkg/store/mockstore/unistore/tikv/mvcc.go"},"region":{"startLine":1645}}}],"partialFingerprints":{"codehealthFindingId/v1":"df742437a7f8056d17a79cf8ffd99958059e785c24693ad340688accc762349d"}},{"ruleId":"D2","level":"warning","message":{"text":"Manager.WakeUp (cognitive 19): Manager.WakeUp has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8, match/switch 6, loops 5 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/store/mockstore/unistore/util/lockwaiter/lockwaiter.go"},"region":{"startLine":167}}}],"partialFingerprints":{"codehealthFindingId/v1":"88cfbdaf174ab0e2746c5bb70afdc1cdfea3e6ec9592eacdb5c260310d6ee88f"}},{"ruleId":"D2","level":"warning","message":{"text":"table.castColumnValue (cognitive 19): table.castColumnValue has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13, boolean chains 6 (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":"pkg/table/column.go"},"region":{"startLine":350}}}],"partialFingerprints":{"codehealthFindingId/v1":"855997de18c3e271fd30683e62a253a7c6f140136a2fbdc0d83a797a2ea908da"}},{"ruleId":"D2","level":"warning","message":{"text":"tables.FetchDuplicatedHandleForTempIndexKey (cognitive 19): tables.FetchDuplicatedHandleForTempIndexKey has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, boolean chains 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":"pkg/table/tables/index.go"},"region":{"startLine":783}}}],"partialFingerprints":{"codehealthFindingId/v1":"bf0f000a8dd66f0574c0301ee0a9dc0d86f9ebdca6b37fbf1cb01a896b4f2075"}},{"ruleId":"D2","level":"warning","message":{"text":"ForListPruning.buildListPartitionValueMap (cognitive 19): ForListPruning.buildListPartitionValueMap has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, 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":"pkg/table/tables/partition.go"},"region":{"startLine":1001}}}],"partialFingerprints":{"codehealthFindingId/v1":"fb715395369432e133a6b9ac41f74d6f1033d4303daca557241dd0b52c070f9e"}},{"ruleId":"D2","level":"warning","message":{"text":"TimerUpdate.apply (cognitive 19): TimerUpdate.apply has cognitive complexity 19 (threshold 15). Drivers by points: if/else 17, 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":"pkg/timer/api/store.go"},"region":{"startLine":195}}}],"partialFingerprints":{"codehealthFindingId/v1":"4b13fc166d5cb71b612d72e22b6fbe0dcd0caf37b393c33ae9337c446d1f0fc8"}},{"ruleId":"D2","level":"warning","message":{"text":"cache.GetNextIntDatumFromCommonHandle (cognitive 19): cache.GetNextIntDatumFromCommonHandle has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15, boolean chains 4 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ttl/cache/table.go"},"region":{"startLine":565}}}],"partialFingerprints":{"codehealthFindingId/v1":"1802a1818f3ecde50fd5e2162a66cd2d8fa7c4f9531dfabbef2fd3a69a93918b"}},{"ruleId":"D2","level":"warning","message":{"text":"cache.GetNextBytesHandleDatum (cognitive 19): cache.GetNextBytesHandleDatum has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14, loops 3, boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ttl/cache/table.go"},"region":{"startLine":632}}}],"partialFingerprints":{"codehealthFindingId/v1":"3b9f74b2b750f16252fe6199a052ac59ce493949d043f0ffaf594332f5eaf3f6"}},{"ruleId":"D2","level":"warning","message":{"text":"types.AggFieldType (cognitive 19): types.AggFieldType has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 7, if/else 6, loops 3, match/switch 3 (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":"pkg/types/field_type.go"},"region":{"startLine":63}}}],"partialFingerprints":{"codehealthFindingId/v1":"fa2b6c530131c887bed6a21c8f8326757a554efc5c30f085308783be0eb3431d"}},{"ruleId":"D2","level":"warning","message":{"text":"types.parseJSONPathMember (cognitive 19): types.parseJSONPathMember has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, boolean chains 3 (nesting depth added 7). Of this number, 15 points are the body\u0027s own statements and 4 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":"pkg/types/json_path_expr.go"},"region":{"startLine":493}}}],"partialFingerprints":{"codehealthFindingId/v1":"1019f169056f50aedda0852d1da245e21e6f34aba582ab0c6ba2c8cbbc32abbe"}},{"ruleId":"D2","level":"warning","message":{"text":"types.isEcmascriptIdentifier (cognitive 19): types.isEcmascriptIdentifier has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15, boolean chains 3, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/types/json_path_expr.go"},"region":{"startLine":544}}}],"partialFingerprints":{"codehealthFindingId/v1":"19f55f22eb20e4d54bc52b81084344bcadf30e24e55b7350eebc3e580ab66068"}},{"ruleId":"D2","level":"warning","message":{"text":"Column.CopyReconstruct (cognitive 19): Column.CopyReconstruct has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13, 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":"pkg/util/chunk/column.go"},"region":{"startLine":851}}}],"partialFingerprints":{"codehealthFindingId/v1":"ecf41dfd796544993810cdf44a229e1870814c075a8d8e0f7add563bc2fe8cd8"}},{"ruleId":"D2","level":"warning","message":{"text":"TiFlashScanContext.String (cognitive 19): TiFlashScanContext.String has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14, boolean chains 3, 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":"pkg/util/execdetails/tiflash_stats.go"},"region":{"startLine":230}}}],"partialFingerprints":{"codehealthFindingId/v1":"57ede6ccfcb2a61f360270cb0737d4b5e2ff26573c81c72ecc787a7b06b18228"}},{"ruleId":"D2","level":"warning","message":{"text":"mergingIter.Last (cognitive 19): mergingIter.Last has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13, 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":"pkg/util/extsort/disk_sorter.go"},"region":{"startLine":604}}}],"partialFingerprints":{"codehealthFindingId/v1":"c1608cb7241f9b207bc6e71fce86da375127ce7e16fb54e74c521194be000331"}},{"ruleId":"D2","level":"warning","message":{"text":"SimpleLRUCache.Put (cognitive 19): SimpleLRUCache.Put has cognitive complexity 19 (threshold 15). Drivers by points: if/else 17, 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":"pkg/util/kvcache/simple_lru.go"},"region":{"startLine":107}}}],"partialFingerprints":{"codehealthFindingId/v1":"985392ed8b6de24c1dff71412c4a8bedf8432d4a5286cb3e365c78cec80653b0"}},{"ruleId":"D2","level":"warning","message":{"text":"stringutil.doMatchInner (cognitive 19): stringutil.doMatchInner has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12, boolean chains 3, 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":"pkg/util/stringutil/string_util.go"},"region":{"startLine":305}}}],"partialFingerprints":{"codehealthFindingId/v1":"a7b26258a4d0f3ee294a78a62f29bac4c4be0575d3d4b42f5bf5739476249ff6"}},{"ruleId":"D2","level":"warning","message":{"text":"ruCollecting.mergeFrom (cognitive 19): ruCollecting.mergeFrom has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11, loops 8 (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":"pkg/util/topsql/reporter/ru_datamodel.go"},"region":{"startLine":658}}}],"partialFingerprints":{"codehealthFindingId/v1":"7c9124c764852bbd455d209973f611107b033a682c6740e204d14b014e0aefdf"}},{"ruleId":"D2","level":"warning","message":{"text":"Handle.analyzeBasedOnStatementStats (cognitive 19): Handle.analyzeBasedOnStatementStats has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15, loops 3, boolean chains 1 (nesting depth added 4). 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":"pkg/workloadlearning/handle.go"},"region":{"startLine":115}}}],"partialFingerprints":{"codehealthFindingId/v1":"3824347a0bc44f4a91406628b311884416c5b896676ca37c87a5f24df6eb3c5e"}},{"ruleId":"D2","level":"warning","message":{"text":"numa.runTestCase (cognitive 19): numa.runTestCase has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14, match/switch 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":"tools/check/ut.go"},"region":{"startLine":814}}}],"partialFingerprints":{"codehealthFindingId/v1":"b48d76edf70b9f3c1f8dccdf3bb48ac97bf80bd995093ef4ebdc01d719a0297b"}},{"ruleId":"D2","level":"warning","message":{"text":"AlterTableStmt.Restore (cognitive 19): AlterTableStmt.Restore has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14, boolean chains 3, 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":"pkg/parser/ast/ddl.go"},"region":{"startLine":4330}}}],"partialFingerprints":{"codehealthFindingId/v1":"2a2a96201cb3e54daa157e687f519835d60cb92d41aa1b690394d63f5c5dcad8"}},{"ruleId":"D2","level":"warning","message":{"text":"ExplainStmt.Restore (cognitive 19): ExplainStmt.Restore has cognitive complexity 19 (threshold 15). Drivers by points: if/else 18, 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":"pkg/parser/ast/misc.go"},"region":{"startLine":227}}}],"partialFingerprints":{"codehealthFindingId/v1":"300dab085d965a12c5f3a8846880d8b853cecfac17b0d4c2dfc1c1213fc23364"}},{"ruleId":"D2","level":"warning","message":{"text":"DropBindingStmt.Restore (cognitive 19): DropBindingStmt.Restore has cognitive complexity 19 (threshold 15). Drivers by points: if/else 17, 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":"pkg/parser/ast/misc.go"},"region":{"startLine":2367}}}],"partialFingerprints":{"codehealthFindingId/v1":"a92655fcb42a0675851887fcbd98881c5dcdd61257d9d6370cc20f3feb46bad2"}},{"ruleId":"D2","level":"warning","message":{"text":"hintScanner.Lex (cognitive 19): hintScanner.Lex has cognitive complexity 19 (threshold 15). Drivers by points: if/else 17, boolean chains 1, match/switch 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":"pkg/parser/hintparserimpl.go"},"region":{"startLine":101}}}],"partialFingerprints":{"codehealthFindingId/v1":"f63929545a1d12c19b220c1d84c5d8ea7759d31b5a089c5c9bf16d38f493e014"}},{"ruleId":"D2","level":"warning","message":{"text":"FieldType.CompactStr (cognitive 19): FieldType.CompactStr has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12, boolean chains 4, loops 2, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/parser/types/field_type.go"},"region":{"startLine":458}}}],"partialFingerprints":{"codehealthFindingId/v1":"2331051b7c5c40a9fb1f88e6ed28cdc0151184b734535081b47c370939ac68c5"}},{"ruleId":"D2","level":"warning","message":{"text":"main.streamCommand (cognitive 18): main.streamCommand has cognitive complexity 18 (threshold 15). Drivers by points: if/else 17, match/switch 1 (nesting depth added 7). Of this number, 17 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, 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":"br/cmd/br/stream.go"},"region":{"startLine":178}}}],"partialFingerprints":{"codehealthFindingId/v1":"0fc9308c3751293008941c8451b114bf8392682b05b33964a729e7bc5f13a11f"}},{"ruleId":"D2","level":"warning","message":{"text":"Client.BuildProgressRangeTree (cognitive 18): Client.BuildProgressRangeTree has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, boolean chains 2, loops 1 (nesting depth added 8). Most of this is not in the body itself: 7 of the 18 points are its own statements and the rest belongs to one function literal inside it that branches (line 1111). 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":"br/pkg/backup/client.go"},"region":{"startLine":1096}}}],"partialFingerprints":{"codehealthFindingId/v1":"c0b28aa23f817be91b660e29b40773abf319d579bacc7fd7b896c09c994a3c82"}},{"ruleId":"D2","level":"warning","message":{"text":"CheckpointRunner.startCheckpointFlushLoop (cognitive 18): CheckpointRunner.startCheckpointFlushLoop has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, match/switch 2, loops 1 (nesting depth added 11). 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 373). 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":"br/pkg/checkpoint/checkpoint.go"},"region":{"startLine":366}}}],"partialFingerprints":{"codehealthFindingId/v1":"2955deaec794a80f7d9b336f9d023dbc44f2d3839f0f953b707c9dcf530ece73"}},{"ruleId":"D2","level":"warning","message":{"text":"checksum.buildRequest (cognitive 18): checksum.buildRequest has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14, loops 4 (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":"br/pkg/checksum/executor.go"},"region":{"startLine":160}}}],"partialFingerprints":{"codehealthFindingId/v1":"abfb2697d395136ea987490ea7c6eddef0f53bbe2d0a600deeb7e50895fa43f6"}},{"ruleId":"D2","level":"warning","message":{"text":"conn.NewMgr (cognitive 18): conn.NewMgr has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, match/switch 2, 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":"br/pkg/conn/conn.go"},"region":{"startLine":150}}}],"partialFingerprints":{"codehealthFindingId/v1":"4f953036e5bf9331eb55f09c3282a9e15941da8cd71e7636719a3e06a3ac317e"}},{"ruleId":"D2","level":"warning","message":{"text":"snapclient.updateStatsTableSchema (cognitive 18): snapclient.updateStatsTableSchema has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, 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":"br/pkg/restore/snap_client/systable_restore.go"},"region":{"startLine":201}}}],"partialFingerprints":{"codehealthFindingId/v1":"f1f159443e5a1dc2d2959ef11105091b84862ff2e23e03097fb7864184f22dd5"}},{"ruleId":"D2","level":"warning","message":{"text":"PipelineConcurrentHandler.concurrentHandleTablesCh (cognitive 18): PipelineConcurrentHandler.concurrentHandleTablesCh has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12, match/switch 5, 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 346). 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":"br/pkg/restore/snap_client/pipeline_items.go"},"region":{"startLine":338}}}],"partialFingerprints":{"codehealthFindingId/v1":"f3c01365ad5ed63ce5524026a08afe4bc4f79ad37825f89d219c5e327b7e1028"}},{"ruleId":"D2","level":"warning","message":{"text":"split.getSplitKeysOfRegions (cognitive 18): split.getSplitKeysOfRegions has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, loops 3, jumps 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":"br/pkg/restore/split/split.go"},"region":{"startLine":537}}}],"partialFingerprints":{"codehealthFindingId/v1":"d73500c560ae2237418afc73f3d524fc5f80ef092400cef043753bff2effff0d"}},{"ruleId":"D2","level":"warning","message":{"text":"utils.MergeAndRewriteFileRanges (cognitive 18): utils.MergeAndRewriteFileRanges has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11, loops 4, boolean chains 3 (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":"br/pkg/restore/utils/merge.go"},"region":{"startLine":35}}}],"partialFingerprints":{"codehealthFindingId/v1":"b53edf619ddbacc7d9ee162a419fd57972861c51eaedb92a00dab33b533b70a0"}},{"ruleId":"D2","level":"warning","message":{"text":"backupmetas.parseTaggedBackupMetaFileName (cognitive 18): backupmetas.parseTaggedBackupMetaFileName has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14, loops 2, match/switch 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":"br/pkg/stream/backupmetas/parser.go"},"region":{"startLine":139}}}],"partialFingerprints":{"codehealthFindingId/v1":"819cc02d78ba8cae524b95dd9606b021bb7567ae77ab50c73340cee3397728b2"}},{"ruleId":"D2","level":"warning","message":{"text":"CheckpointAdvancer.StartTaskListener (cognitive 18): CheckpointAdvancer.StartTaskListener has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14, loops 2, match/switch 2 (nesting depth added 10). Most of this is not in the body itself: 5 of the 18 points are its own statements and the rest belongs to one function literal inside it that branches (line 509). 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":"br/pkg/streamhelper/advancer.go"},"region":{"startLine":491}}}],"partialFingerprints":{"codehealthFindingId/v1":"d64c5425131e3af43ba748162ee1068beb16cc8fbfacf7c6b1ce6acb36c1a8da"}},{"ruleId":"D2","level":"warning","message":{"text":"task.RunBackupRaw (cognitive 18): task.RunBackupRaw has cognitive complexity 18 (threshold 15). Drivers by points: if/else 17, boolean chains 1 (nesting depth added 3). Of this number, 13 points are the body\u0027s own statements and 5 belong to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"br/pkg/task/backup_raw.go"},"region":{"startLine":128}}}],"partialFingerprints":{"codehealthFindingId/v1":"15233e4e804e473cd368e1190990a8bb111e00bc176ed6b47427850decbe9a84"}},{"ruleId":"D2","level":"warning","message":{"text":"task.PreCheckTableTiFlashReplica (cognitive 18): task.PreCheckTableTiFlashReplica has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14, loops 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":"br/pkg/task/restore.go"},"region":{"startLine":2452}}}],"partialFingerprints":{"codehealthFindingId/v1":"3e55a4b928118932786c541f035cc11e47c7cb2d90878173c1a88ac3e1c8426b"}},{"ruleId":"D2","level":"warning","message":{"text":"version.CheckVersionForBRPiTR (cognitive 18): version.CheckVersionForBRPiTR has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11, boolean chains 7 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"br/pkg/version/version.go"},"region":{"startLine":136}}}],"partialFingerprints":{"codehealthFindingId/v1":"91f1c56bebc2841c803867b490ca09e232752a4a982de87da43b497350bdceb0"}},{"ruleId":"D2","level":"warning","message":{"text":"version.CheckVersionForBR (cognitive 18): version.CheckVersionForBR has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12, boolean chains 6 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"br/pkg/version/version.go"},"region":{"startLine":193}}}],"partialFingerprints":{"codehealthFindingId/v1":"ae3da841dc77efb7dbc95776b2407a78ebef54d80de7bb57a4878e60fcb0ac93"}},{"ruleId":"D2","level":"warning","message":{"text":"Writer.tryToWriteTableData (cognitive 18): Writer.tryToWriteTableData 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":"dumpling/export/writer.go"},"region":{"startLine":244}}}],"partialFingerprints":{"codehealthFindingId/v1":"e8b55309b266cdbeb45f4f33d288c57d858bf7c6954a726c38e5a0a0624eb5a7"}},{"ruleId":"D2","level":"warning","message":{"text":"FileCheckpointsDB.IgnoreErrorCheckpoint (cognitive 18): FileCheckpointsDB.IgnoreErrorCheckpoint has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12, loops 6 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lightning/pkg/checkpoints/checkpoints.go"},"region":{"startLine":1971}}}],"partialFingerprints":{"codehealthFindingId/v1":"abe94efdfc2abe11bdbc18ab4f1cd4185c947201658be3c8fb6398697b5e5f15"}},{"ruleId":"D2","level":"warning","message":{"text":"chunkProcessor.getDuplicateMessage (cognitive 18): chunkProcessor.getDuplicateMessage has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, loops 4, boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lightning/pkg/importer/chunk_process.go"},"region":{"startLine":531}}}],"partialFingerprints":{"codehealthFindingId/v1":"22b889ce33f56873fca82c5ce7a9a22ba45bff9abe7c6e13991132723d5f20ed"}},{"ruleId":"D2","level":"warning","message":{"text":"PreImportInfoGetterImpl.getTableStructuresByFileMeta (cognitive 18): PreImportInfoGetterImpl.getTableStructuresByFileMeta has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, boolean chains 2, loops 2, jumps 1 (nesting depth added 6). Of this number, 16 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":"lightning/pkg/importer/get_pre_info.go"},"region":{"startLine":373}}}],"partialFingerprints":{"codehealthFindingId/v1":"12405064c28c6403db73f81bb0b08f251f26c648f6f6f004c76820dd2e1cf3e8"}},{"ruleId":"D2","level":"warning","message":{"text":"bindingCacheUpdater.LoadFromStorageToCache (cognitive 18): bindingCacheUpdater.LoadFromStorageToCache has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, boolean chains 2, loops 1 (nesting depth added 5). Of this number, 16 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":"pkg/bindinfo/binding_cache.go"},"region":{"startLine":64}}}],"partialFingerprints":{"codehealthFindingId/v1":"b1361900f5e0fbaba233f6274f1ceba039b115f09e961334c670a76c861b1494"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.generateMergeTempIndexPlan (cognitive 18): ddl.generateMergeTempIndexPlan has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, loops 5 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/backfilling_dist_scheduler.go"},"region":{"startLine":829}}}],"partialFingerprints":{"codehealthFindingId/v1":"bd32ca7b7b4d98c88cb481f04b1eb8fc12a3522b7de5d0bac5a79ea8dd255772"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.processAllJobs (cognitive 18): ddl.processAllJobs has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14, loops 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":"pkg/ddl/ddl.go"},"region":{"startLine":1634}}}],"partialFingerprints":{"codehealthFindingId/v1":"4da4dfbdde12ec35df5f1486a440be9ff2d201e982709c71cffa0132088351c4"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.ExtractTblInfos (cognitive 18): ddl.ExtractTblInfos has cognitive complexity 18 (threshold 15). Drivers by points: if/else 17, boolean chains 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":"pkg/ddl/executor.go"},"region":{"startLine":4643}}}],"partialFingerprints":{"codehealthFindingId/v1":"56c816f43c53ffb9411dac7040155c6db754b0bb9de27d46854d5505716d8095"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.evalSplitDatumFromArgs (cognitive 18): ddl.evalSplitDatumFromArgs has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, loops 4, boolean chains 1 (nesting depth added 6). Of this number, 16 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":"pkg/ddl/index_presplit.go"},"region":{"startLine":292}}}],"partialFingerprints":{"codehealthFindingId/v1":"de71303b9778e59954e8a88b3d73dcb5ee90faff59f51959fbda7f0d2c58b4dd"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.onDropPlacementPolicy (cognitive 18): ddl.onDropPlacementPolicy has cognitive complexity 18 (threshold 15). Drivers by points: if/else 17, match/switch 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":"pkg/ddl/placement_policy.go"},"region":{"startLine":186}}}],"partialFingerprints":{"codehealthFindingId/v1":"9117b748c1aef915df5ca1f990c470dd91ee9f7c376c546f7f6ca6f7632d268d"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.updateExistPlacementPolicy (cognitive 18): ddl.updateExistPlacementPolicy has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, loops 5 (nesting depth added 4). Of this number, 15 points are the body\u0027s own statements and 3 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":"pkg/ddl/placement_policy.go"},"region":{"startLine":285}}}],"partialFingerprints":{"codehealthFindingId/v1":"c2ead3a59be8097a7cb304f0e08dfe302e5a4b0c738a4503579932de119e7b92"}},{"ruleId":"D2","level":"warning","message":{"text":"tableScanWorker.scanRecords (cognitive 18): tableScanWorker.scanRecords has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14, loops 3, boolean chains 1 (nesting depth added 4). Most of this is not in the body itself: 4 of the 18 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 552, 541). 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":"pkg/ddl/backfilling_operators.go"},"region":{"startLine":528}}}],"partialFingerprints":{"codehealthFindingId/v1":"a0f5e018d85f8d7062ce0606fe2bb79c307c9323e974df81267244a659bf1a4b"}},{"ruleId":"D2","level":"warning","message":{"text":"updateColumnWorker.getRowRecord (cognitive 18): updateColumnWorker.getRowRecord has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, boolean chains 2, loops 1 (nesting depth added 2). Of this number, 14 points are the body\u0027s own statements and 4 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":"pkg/ddl/column.go"},"region":{"startLine":749}}}],"partialFingerprints":{"codehealthFindingId/v1":"ed0b719afd5d28b16e8efa49e942e40b83946e6414385d7dde0a7f637efe8477"}},{"ruleId":"D2","level":"warning","message":{"text":"executor.CreatePrimaryKey (cognitive 18): executor.CreatePrimaryKey has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14, boolean chains 3, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/executor.go"},"region":{"startLine":4781}}}],"partialFingerprints":{"codehealthFindingId/v1":"7bb19dbc596ab5dd95b809a3f6ebb051e517a174ea1865a63c27462e0a1c1a5e"}},{"ruleId":"D2","level":"warning","message":{"text":"executor.createColumnarIndex (cognitive 18): executor.createColumnarIndex has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, match/switch 2, boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/executor.go"},"region":{"startLine":4946}}}],"partialFingerprints":{"codehealthFindingId/v1":"bbb2c5260e6224246bcd8542de91550e55e266cb1bba036b4f5a8b2d4b68e811"}},{"ruleId":"D2","level":"warning","message":{"text":"worker.syncMaskingPolicyForModifiedColumn (cognitive 18): worker.syncMaskingPolicyForModifiedColumn has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, boolean chains 2, 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":"pkg/ddl/masking_policy.go"},"region":{"startLine":647}}}],"partialFingerprints":{"codehealthFindingId/v1":"db8a2c2a89640791ecbbad32a3296584c2b74d81511ea844294cfe141ecee5b4"}},{"ruleId":"D2","level":"warning","message":{"text":"worker.runReorgJob (cognitive 18): worker.runReorgJob has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, match/switch 2, loops 1 (nesting depth added 8). Of this number, 17 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, 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/ddl/reorg.go"},"region":{"startLine":359}}}],"partialFingerprints":{"codehealthFindingId/v1":"0e9321e8209096617b75c6371dbc3a22d3f910f814278a8395ea072032a36544"}},{"ruleId":"D2","level":"warning","message":{"text":"SchemaChangeEvent.String (cognitive 18): SchemaChangeEvent.String has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12, loops 6 (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/ddl/notifier/events.go"},"region":{"startLine":36}}}],"partialFingerprints":{"codehealthFindingId/v1":"f473320ad45b076751594353e491c8df1bc64fa3360e47a0cd9a695aa4fb2de8"}},{"ruleId":"D2","level":"warning","message":{"text":"resourcegroup.NewGroupFromOptions (cognitive 18): resourcegroup.NewGroupFromOptions has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, boolean chains 3 (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":"pkg/ddl/resourcegroup/group.go"},"region":{"startLine":27}}}],"partialFingerprints":{"codehealthFindingId/v1":"916c2b3e84a115e9752c3c302aaa5c832e30d2a412d1f3025e08a316e14b2c54"}},{"ruleId":"D2","level":"warning","message":{"text":"schemaver.calculateUpdatedMap (cognitive 18): schemaver.calculateUpdatedMap has cognitive complexity 18 (threshold 15). Drivers by points: if/else 17, 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/ddl/schemaver/syncer.go"},"region":{"startLine":638}}}],"partialFingerprints":{"codehealthFindingId/v1":"a2f5cf21d7ce03688729b0cdaaa18355002027f9a60ec6c00e553450d790957c"}},{"ruleId":"D2","level":"warning","message":{"text":"MemSyncer.WaitVersionSynced (cognitive 18): MemSyncer.WaitVersionSynced has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, boolean chains 2, match/switch 2, loops 1 (nesting depth added 9). Of this number, 16 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":"pkg/ddl/schemaver/mem_syncer.go"},"region":{"startLine":106}}}],"partialFingerprints":{"codehealthFindingId/v1":"948ff5ec6bbfea47a468687408e288f4fe5a2c274244ea49590c0333dc035d6f"}},{"ruleId":"D2","level":"warning","message":{"text":"sortedSelectResults.Next (cognitive 18): sortedSelectResults.Next has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14, loops 4 (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/distsql/select_result.go"},"region":{"startLine":224}}}],"partialFingerprints":{"codehealthFindingId/v1":"6dd6585fa0164b38e70b25b2aacaa7d36dbfb83b27d03d4d28c1fc02d6708f47"}},{"ruleId":"D2","level":"warning","message":{"text":"domain.resultSetToStringSlice (cognitive 18): domain.resultSetToStringSlice has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14, loops 3, boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/domain/plan_replayer_dump.go"},"region":{"startLine":906}}}],"partialFingerprints":{"codehealthFindingId/v1":"7ff376001035ccce7b8f2a6869f0876e97341422e627d7a6ba45700640612306"}},{"ruleId":"D2","level":"warning","message":{"text":"parquetfile.sparkRebaseTimeZoneID (cognitive 18): parquetfile.sparkRebaseTimeZoneID has cognitive complexity 18 (threshold 15). Drivers by points: if/else 17, 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":"pkg/dumpformat/parquetfile/spark_rebase.go"},"region":{"startLine":109}}}],"partialFingerprints":{"codehealthFindingId/v1":"54551856ee407370cfa423b672afa31c53b446082ab42ee0ba714a3862019840"}},{"ruleId":"D2","level":"warning","message":{"text":"Manager.cleanupFinishedTasks (cognitive 18): Manager.cleanupFinishedTasks has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14, loops 4 (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":"pkg/dxf/framework/scheduler/scheduler_manager.go"},"region":{"startLine":468}}}],"partialFingerprints":{"codehealthFindingId/v1":"1d88e28c1d2b096209d7cf623802db8466b55638afe7eedd7f019c9f8a3c5a76"}},{"ruleId":"D2","level":"warning","message":{"text":"importStepExecutor.RunSubtask (cognitive 18): importStepExecutor.RunSubtask has cognitive complexity 18 (threshold 15). Drivers by points: if/else 16, boolean chains 1, loops 1 (nesting depth added 4). Of this number, 16 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":"pkg/dxf/importinto/task_executor.go"},"region":{"startLine":242}}}],"partialFingerprints":{"codehealthFindingId/v1":"3e80432a95e33ad69720f8ee3fd7f6875b435847f734a586a50ae26847a4ab6a"}},{"ruleId":"D2","level":"warning","message":{"text":"ExecStmt.SummaryStmt (cognitive 18): ExecStmt.SummaryStmt has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14, boolean chains 4 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/adapter.go"},"region":{"startLine":2193}}}],"partialFingerprints":{"codehealthFindingId/v1":"87c1cb7097eb842941dec18f0a7e41e6970a438d25aa88f9c0e41108bd08900b"}},{"ruleId":"D2","level":"warning","message":{"text":"AnalyzeExec.handleResultsErrorWithConcurrency (cognitive 18): AnalyzeExec.handleResultsErrorWithConcurrency has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, loops 5 (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":"pkg/executor/analyze.go"},"region":{"startLine":678}}}],"partialFingerprints":{"codehealthFindingId/v1":"ea8c1ed8fdad7363aa44381a39004f689c43da331894a6046ea9971d8603159c"}},{"ruleId":"D2","level":"warning","message":{"text":"executorBuilder.buildUpdate (cognitive 18): executorBuilder.buildUpdate has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14, loops 4 (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":"pkg/executor/builder.go"},"region":{"startLine":2955}}}],"partialFingerprints":{"codehealthFindingId/v1":"4c895f62051f76f74222e18b124f2d78b3064f3f83be0cd37ee7e4bad6c862bf"}},{"ruleId":"D2","level":"warning","message":{"text":"cteProducer.setupTblsForNewIteration (cognitive 18): cteProducer.setupTblsForNewIteration has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, 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":"pkg/executor/cte.go"},"region":{"startLine":499}}}],"partialFingerprints":{"codehealthFindingId/v1":"e8551cfa009db18dc78fc3ad0b748482fe04805d77794d0c29e51ecd645c2bd9"}},{"ruleId":"D2","level":"warning","message":{"text":"indexWorker.buildAndDispatchLookupTasks (cognitive 18): indexWorker.buildAndDispatchLookupTasks has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, match/switch 4, boolean chains 1 (nesting depth added 6). Of this number, 15 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":"pkg/executor/distsql.go"},"region":{"startLine":1589}}}],"partialFingerprints":{"codehealthFindingId/v1":"4b013be61a383e107dd95c7a4380b8a3b99443a65a1fc7269cb8c0712928f46a"}},{"ruleId":"D2","level":"warning","message":{"text":"kvSizeSampler.sampleOneFile (cognitive 18): kvSizeSampler.sampleOneFile has cognitive complexity 18 (threshold 15). Drivers by points: if/else 16, boolean chains 1, loops 1 (nesting depth added 6). 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 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/executor/importer/sampler.go"},"region":{"startLine":323}}}],"partialFingerprints":{"codehealthFindingId/v1":"ebda4192cc37ea3f53d33ab88015da51514623fe7595263ed8a70a7cf8a08da2"}},{"ruleId":"D2","level":"warning","message":{"text":"antiSemiJoinProbe.probeForRightSideBuildNoOtherCondition (cognitive 18): antiSemiJoinProbe.probeForRightSideBuildNoOtherCondition has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, boolean chains 2, 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":"pkg/executor/join/anti_semi_join_probe.go"},"region":{"startLine":264}}}],"partialFingerprints":{"codehealthFindingId/v1":"b9545664234f2a02e86175c6532bc1ccc3f08c69ed9a768e56e05d731ecd6dbf"}},{"ruleId":"D2","level":"warning","message":{"text":"HashJoinV1Exec.Close (cognitive 18): HashJoinV1Exec.Close has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12, loops 5, boolean chains 1 (nesting depth added 6). Of this number, 16 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":"pkg/executor/join/hash_join_v1.go"},"region":{"startLine":122}}}],"partialFingerprints":{"codehealthFindingId/v1":"d5d48c55c141617ed21fe3f1e38041e70c40eee1175059cafcd932b4419c2d13"}},{"ruleId":"D2","level":"warning","message":{"text":"hashRowContainer.GetMatchedRowsAndPtrs (cognitive 18): hashRowContainer.GetMatchedRowsAndPtrs has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14, 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":"pkg/executor/join/hash_table_v1.go"},"region":{"startLine":261}}}],"partialFingerprints":{"codehealthFindingId/v1":"e22afda97ee1041f72ade3fa525484739fe6e4e6da79f4f889a0c3e769b8ce79"}},{"ruleId":"D2","level":"warning","message":{"text":"semiJoinProbe.probeForLeftSideBuildNoOtherCondition (cognitive 18): semiJoinProbe.probeForLeftSideBuildNoOtherCondition has cognitive complexity 18 (threshold 15). Drivers by points: if/else 17, 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":"pkg/executor/join/semi_join_probe.go"},"region":{"startLine":183}}}],"partialFingerprints":{"codehealthFindingId/v1":"45c93fa7a76f60d6ca6d51b21cdef7c6b9d1af329ff570dcc3b332b0cba20d86"}},{"ruleId":"D2","level":"warning","message":{"text":"hotRegionsHistoryRetriver.startRetrieving (cognitive 18): hotRegionsHistoryRetriver.startRetrieving has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, loops 3 (nesting depth added 11). Most of this is not in the body itself: 6 of the 18 points are its own statements and the rest belongs to one function literal inside it that branches (line 751). 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":"pkg/executor/memtable_reader.go"},"region":{"startLine":736}}}],"partialFingerprints":{"codehealthFindingId/v1":"9ee5c97701dfbb1c713254dab0b7f0f8e4681f45f56a09e00427f86f933fce8a"}},{"ruleId":"D2","level":"warning","message":{"text":"hotRegionsHistoryRetriver.getHotRegionRowWithSchemaInfo (cognitive 18): hotRegionsHistoryRetriver.getHotRegionRowWithSchemaInfo has cognitive complexity 18 (threshold 15). Drivers by points: if/else 16, 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":"pkg/executor/memtable_reader.go"},"region":{"startLine":845}}}],"partialFingerprints":{"codehealthFindingId/v1":"665a08be69f9be896e425102986b0dfb56e4e96ce158c744bc1f4374df703ea9"}},{"ruleId":"D2","level":"warning","message":{"text":"AlterDDLJobExec.processAlterDDLJobConfig (cognitive 18): AlterDDLJobExec.processAlterDDLJobConfig has cognitive complexity 18 (threshold 15). Drivers by points: if/else 16, boolean chains 1, loops 1 (nesting depth added 8). Of this number, 16 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":"pkg/executor/operate_ddl_jobs.go"},"region":{"startLine":158}}}],"partialFingerprints":{"codehealthFindingId/v1":"cda2200346690cd0fbe51de62bb887e213770135dc5888948fc458cccce5ee65"}},{"ruleId":"D2","level":"warning","message":{"text":"ParallelNestedLoopApplyExec.innerWorkerOrdered (cognitive 18): ParallelNestedLoopApplyExec.innerWorkerOrdered has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 10, if/else 7, loops 1 (nesting depth added 10). Of this number, 13 points are the body\u0027s own statements and 5 belong to one function literal inside it that branches. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/parallel_apply.go"},"region":{"startLine":388}}}],"partialFingerprints":{"codehealthFindingId/v1":"4d5a2da513d4bd53913333b72e4b638877db32aa9cf008b6a28ab8cab97b3838"}},{"ruleId":"D2","level":"warning","message":{"text":"ParallelNestedLoopApplyExec.fetchNextOuterRow (cognitive 18): ParallelNestedLoopApplyExec.fetchNextOuterRow has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, match/switch 2, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/parallel_apply.go"},"region":{"startLine":718}}}],"partialFingerprints":{"codehealthFindingId/v1":"8f2ca515e9e517ac299052c7e6ed38972d2f277ee83ef367f40007c57a74a58a"}},{"ruleId":"D2","level":"warning","message":{"text":"PointGetExecutor.getAndLock (cognitive 18): PointGetExecutor.getAndLock has cognitive complexity 18 (threshold 15). Drivers by points: if/else 18 (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":"pkg/executor/point_get.go"},"region":{"startLine":550}}}],"partialFingerprints":{"codehealthFindingId/v1":"d082e13a4b01a542c830fc5507d4f25de9630f395627402b3eab7905bae3f266"}},{"ruleId":"D2","level":"warning","message":{"text":"RevokeExec.revokeOneUser (cognitive 18): RevokeExec.revokeOneUser has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, boolean chains 1, loops 1, match/switch 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":"pkg/executor/revoke.go"},"region":{"startLine":155}}}],"partialFingerprints":{"codehealthFindingId/v1":"034d9835666f83065b1ba30dae57b8ee6de95cf19e803ae129210563b1385cb8"}},{"ruleId":"D2","level":"warning","message":{"text":"ShowExec.fetchShowTableStatus (cognitive 18): ShowExec.fetchShowTableStatus has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, boolean chains 4, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/show.go"},"region":{"startLine":636}}}],"partialFingerprints":{"codehealthFindingId/v1":"b12199c6aaf281d092768036f24e8a020557b4824774e7523728dba78cca7ebd"}},{"ruleId":"D2","level":"warning","message":{"text":"ShowExec.fetchShowDistributions (cognitive 18): ShowExec.fetchShowDistributions has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12, 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":"pkg/executor/show.go"},"region":{"startLine":2202}}}],"partialFingerprints":{"codehealthFindingId/v1":"5b58bc60d02a9d92e300e7decdceedbcd2217de73c06136c83f4893036a2a764"}},{"ruleId":"D2","level":"warning","message":{"text":"SimpleExec.setDefaultRoleForCurrentUser (cognitive 18): SimpleExec.setDefaultRoleForCurrentUser has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, loops 2, match/switch 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":"pkg/executor/simple.go"},"region":{"startLine":370}}}],"partialFingerprints":{"codehealthFindingId/v1":"2ffa92579a27c792d6aec1e424329bc55cc6889808e70df785690669e0e92b7f"}},{"ruleId":"D2","level":"warning","message":{"text":"passwordOrLockOptionsInfo.loadOptions (cognitive 18): passwordOrLockOptionsInfo.loadOptions has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5, match/switch 5, jumps 4, loops 3, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/simple.go"},"region":{"startLine":877}}}],"partialFingerprints":{"codehealthFindingId/v1":"7c9bd79e09baeda4682c15ba8d820bade0e87c54f0e520badfecb57513f99159"}},{"ruleId":"D2","level":"warning","message":{"text":"parallelSortWorker.multiWayMergeLocalSortedRows (cognitive 18): parallelSortWorker.multiWayMergeLocalSortedRows has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, loops 2, boolean chains 1 (nesting depth added 8). Of this number, 13 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":"pkg/executor/sortexec/parallel_sort_worker.go"},"region":{"startLine":109}}}],"partialFingerprints":{"codehealthFindingId/v1":"826034aacb877661e4587e0585754cdd2fd7ce1bd2491ffa9b7f7b82c22e9d52"}},{"ruleId":"D2","level":"warning","message":{"text":"SortExec.generateResultFromMemory (cognitive 18): SortExec.generateResultFromMemory has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9, loops 5, 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":"pkg/executor/sortexec/sort.go"},"region":{"startLine":385}}}],"partialFingerprints":{"codehealthFindingId/v1":"99d50af3ee4d9674cf3bc1c097ac08d3380b753a5b08565ec445786f1f5fa412"}},{"ruleId":"D2","level":"warning","message":{"text":"UnionScanExec.getSnapshotRow (cognitive 18): UnionScanExec.getSnapshotRow has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14, loops 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":"pkg/executor/union_scan.go"},"region":{"startLine":242}}}],"partialFingerprints":{"codehealthFindingId/v1":"d61686b2d98b2eb099200c9cbbd877442e72bcbe81b6fa2486363c21027554b0"}},{"ruleId":"D2","level":"warning","message":{"text":"baseFuncDesc.typeInfer4GroupConcat (cognitive 18): baseFuncDesc.typeInfer4GroupConcat has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, 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":"pkg/expression/aggregation/base_func.go"},"region":{"startLine":325}}}],"partialFingerprints":{"codehealthFindingId/v1":"01cb3d614d3ac9f0d5562999b8e69fd7be3760bcaad56be8384f69c751635f07"}},{"ruleId":"D2","level":"warning","message":{"text":"countFunction.Update (cognitive 18): countFunction.Update has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, 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":"pkg/expression/aggregation/count.go"},"region":{"startLine":29}}}],"partialFingerprints":{"codehealthFindingId/v1":"65c3e703d9a0943da27fb929e209810b9fa4616f59f894ad36c6cd56807be004"}},{"ruleId":"D2","level":"warning","message":{"text":"expression.formatDecimal (cognitive 18): expression.formatDecimal has cognitive complexity 18 (threshold 15). Drivers by points: if/else 16, 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":"pkg/expression/builtin_string_vec.go"},"region":{"startLine":2994}}}],"partialFingerprints":{"codehealthFindingId/v1":"ff441b6bae73bc9cf4dff417a1adf2836413a025da4d6c6a333a5cdb0466765d"}},{"ruleId":"D2","level":"warning","message":{"text":"expression.formatReal (cognitive 18): expression.formatReal has cognitive complexity 18 (threshold 15). Drivers by points: if/else 16, 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":"pkg/expression/builtin_string_vec.go"},"region":{"startLine":3044}}}],"partialFingerprints":{"codehealthFindingId/v1":"ea9bfa7828498c2a045ef5ca5c93de468e22ccbaa911a431c57d412a47f4f6f5"}},{"ruleId":"D2","level":"warning","message":{"text":"expression.getValidPrefix (cognitive 18): expression.getValidPrefix has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7, boolean chains 4, jumps 3, match/switch 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":"pkg/expression/util.go"},"region":{"startLine":735}}}],"partialFingerprints":{"codehealthFindingId/v1":"2631746c2b0fa3b3e3d9c8b11b0fe312f53809abc2966f88cc4987dda2e68ca6"}},{"ruleId":"D2","level":"warning","message":{"text":"expression.SubstituteCorCol2Constant (cognitive 18): expression.SubstituteCorCol2Constant has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14, loops 2, boolean chains 1, match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction \u2014 a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full \u2014 so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/util.go"},"region":{"startLine":774}}}],"partialFingerprints":{"codehealthFindingId/v1":"9a1b05ba50da876215104de74e5c93e3c5b97b32b6e21cb8fd47eb3604e287ba"}},{"ruleId":"D2","level":"warning","message":{"text":"expression.DeriveRelaxedFiltersFromDNF (cognitive 18): expression.DeriveRelaxedFiltersFromDNF has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, 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":"pkg/expression/util.go"},"region":{"startLine":1296}}}],"partialFingerprints":{"codehealthFindingId/v1":"8b45cf96689e71a7289f9ab527874f30f3be84351c5bd89b626d70c7b6bf278d"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinCastIntAsStringSig.vecEvalString (cognitive 18): builtinCastIntAsStringSig.vecEvalString has cognitive complexity 18 (threshold 15). Drivers by points: if/else 16, boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/builtin_cast_vec.go"},"region":{"startLine":697}}}],"partialFingerprints":{"codehealthFindingId/v1":"ad590bdb4f33dee8620fbb9c23ebb85a21fb99c1a194a513f31f302be1b9e3e0"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinAesDecryptSig.vecEvalString (cognitive 18): builtinAesDecryptSig.vecEvalString has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, boolean chains 2, 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":"pkg/expression/builtin_encryption_vec.go"},"region":{"startLine":45}}}],"partialFingerprints":{"codehealthFindingId/v1":"43c596854530342fd6a11b59ef25b931c1d2bc65d61a59a190c308a7406e3def"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinUncompressSig.vecEvalString (cognitive 18): builtinUncompressSig.vecEvalString has cognitive complexity 18 (threshold 15). Drivers by points: if/else 17, 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":"pkg/expression/builtin_encryption_vec.go"},"region":{"startLine":786}}}],"partialFingerprints":{"codehealthFindingId/v1":"88829a232c0f316b4accc6de66f6fa56f675e9444a4f137f319f2e370888b4ae"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinJSONObjectSig.evalJSON (cognitive 18): builtinJSONObjectSig.evalJSON has cognitive complexity 18 (threshold 15). Drivers by points: if/else 17, 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":"pkg/expression/builtin_json.go"},"region":{"startLine":718}}}],"partialFingerprints":{"codehealthFindingId/v1":"ed1deeb3498b60773d1550128a1ddd6d2458838fa6f2bf332ea98d3dad89836b"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinBinToUUIDSig.vecEvalString (cognitive 18): builtinBinToUUIDSig.vecEvalString has cognitive complexity 18 (threshold 15). Drivers by points: if/else 16, boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/builtin_miscellaneous_vec.go"},"region":{"startLine":869}}}],"partialFingerprints":{"codehealthFindingId/v1":"0223ad40323cbd6e13e9e4229893a1094a8496dac53e4a339a6f4733c93f9af1"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinCharSig.vecEvalString (cognitive 18): builtinCharSig.vecEvalString has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, loops 5 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/builtin_string_vec.go"},"region":{"startLine":2340}}}],"partialFingerprints":{"codehealthFindingId/v1":"34595039cc8010cff7c8190fa00800d6f6c979b7c29f34ec4cc3b0d42e8af35e"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinEltSig.vecEvalString (cognitive 18): builtinEltSig.vecEvalString has cognitive complexity 18 (threshold 15). Drivers by points: if/else 16, 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":"pkg/expression/builtin_string_vec.go"},"region":{"startLine":1835}}}],"partialFingerprints":{"codehealthFindingId/v1":"db5100194693cd9a6637d0fa9bb2a7f4a191fb83dd0268fc12d0ce3ed828acbd"}},{"ruleId":"D2","level":"warning","message":{"text":"fromUnixTimeFunctionClass.getFunction (cognitive 18): fromUnixTimeFunctionClass.getFunction has cognitive complexity 18 (threshold 15). Drivers by points: if/else 17, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/builtin_time.go"},"region":{"startLine":1764}}}],"partialFingerprints":{"codehealthFindingId/v1":"1a3e84fb9ae82b4d895b459535ba14725ccbae5259c755e51606f976c2ebf16f"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinAddSubDateAsStringSig.vecEvalString (cognitive 18): builtinAddSubDateAsStringSig.vecEvalString has cognitive complexity 18 (threshold 15). Drivers by points: if/else 17, 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":"pkg/expression/builtin_time_vec.go"},"region":{"startLine":2802}}}],"partialFingerprints":{"codehealthFindingId/v1":"a67a56abe2af42172245836f6a135c9a39999dba2f64a3f7a10b78dd31b42cec"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinAddStringAndStringSig.evalString (cognitive 18): builtinAddStringAndStringSig.evalString has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, boolean chains 3 (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":"pkg/expression/builtin_time.go"},"region":{"startLine":5244}}}],"partialFingerprints":{"codehealthFindingId/v1":"3de6ec2e52f0bfa8ea98e6132c054b283a3050254d619501a5b23d82a50d2009"}},{"ruleId":"D2","level":"warning","message":{"text":"propOuterJoinConstSolver.propagateColumnEQ (cognitive 18): propOuterJoinConstSolver.propagateColumnEQ has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14, loops 4 (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/expression/constant_propagation.go"},"region":{"startLine":886}}}],"partialFingerprints":{"codehealthFindingId/v1":"e6ebbdae8686dfd166aeba828263d8596278c36de8ae77acdae67c292ef3cb5e"}},{"ruleId":"D2","level":"warning","message":{"text":"infoschema.GetPDServerInfo (cognitive 18): infoschema.GetPDServerInfo has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14, loops 3, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/infoschema/tables.go"},"region":{"startLine":2098}}}],"partialFingerprints":{"codehealthFindingId/v1":"8de76eb64b92c2c8cf1171758fc8136c502fe84a3b470c96da071a09fb21e4d0"}},{"ruleId":"D2","level":"warning","message":{"text":"validator.isRelatedTablesChanged (cognitive 18): validator.isRelatedTablesChanged has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9, loops 8, 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":"pkg/infoschema/isvalidator/validator.go"},"region":{"startLine":138}}}],"partialFingerprints":{"codehealthFindingId/v1":"9519e7cacb41b7d93546c2b71f8da33dfba20f672144c534d6d6e7c6abe07b47"}},{"ruleId":"D2","level":"warning","message":{"text":"globalsort.readOneFile (cognitive 18): globalsort.readOneFile has cognitive complexity 18 (threshold 15). Drivers by points: if/else 17, 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":"pkg/ingestor/globalsort/reader.go"},"region":{"startLine":159}}}],"partialFingerprints":{"codehealthFindingId/v1":"42b9f8e3ab93fdc734b32cd113523487a9d5b31d2040d4bbd36795058d550072"}},{"ruleId":"D2","level":"warning","message":{"text":"OneFileWriter.handleDupAndWrite (cognitive 18): OneFileWriter.handleDupAndWrite has cognitive complexity 18 (threshold 15). Drivers by points: if/else 17, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ingestor/simplesst/onefile_writer.go"},"region":{"startLine":188}}}],"partialFingerprints":{"codehealthFindingId/v1":"35436f254d2028d31049ccc0a0fc12ca978b1d6d941e4b6ae009cd4407184eaa"}},{"ruleId":"D2","level":"warning","message":{"text":"HandleMap.Range (cognitive 18): HandleMap.Range has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10, loops 8 (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/kv/key.go"},"region":{"startLine":563}}}],"partialFingerprints":{"codehealthFindingId/v1":"69f40f922527f9e8ff95d67894a98abd3b6666e6e7dbe1fbed041ec7af125080"}},{"ruleId":"D2","level":"warning","message":{"text":"MemAwareHandleMap.Range (cognitive 18): MemAwareHandleMap.Range has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10, loops 8 (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/kv/key.go"},"region":{"startLine":676}}}],"partialFingerprints":{"codehealthFindingId/v1":"7be4db2de3220a0abbb944c5dcae4b9e204ea005501c263e24a819fa57f433e4"}},{"ruleId":"D2","level":"warning","message":{"text":"tableKVEncoder.Encode (cognitive 18): tableKVEncoder.Encode has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, 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":"pkg/lightning/backend/kv/sql2kv.go"},"region":{"startLine":219}}}],"partialFingerprints":{"codehealthFindingId/v1":"de795c6eadfeb52f05f66502d0bb7ac4b1a97120fd642f406aea11db4e54dcce"}},{"ruleId":"D2","level":"warning","message":{"text":"CSVConfig.adjust (cognitive 18): CSVConfig.adjust has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, boolean chains 5 (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":"pkg/lightning/config/config.go"},"region":{"startLine":852}}}],"partialFingerprints":{"codehealthFindingId/v1":"2778a3552bd170d8895e80aad6d7826fcbd74b97fc568eb85fa921c1c52efc63"}},{"ruleId":"D2","level":"warning","message":{"text":"Buffer.tryAllocBytes (cognitive 18): Buffer.tryAllocBytes has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, boolean chains 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":"pkg/lightning/membuf/buffer.go"},"region":{"startLine":308}}}],"partialFingerprints":{"codehealthFindingId/v1":"5b8b724786c66e69946e2af152fb0fa873fb5d33ac422aac9eeafa3e4e5c3062"}},{"ruleId":"D2","level":"warning","message":{"text":"AllocatorRuntimeStats.String (cognitive 18): AllocatorRuntimeStats.String has cognitive complexity 18 (threshold 15). Drivers by points: if/else 17, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/meta/autoid/autoid.go"},"region":{"startLine":1306}}}],"partialFingerprints":{"codehealthFindingId/v1":"0fdddeb5566e3236ec3d657a609f3874e18873ce41057c38493f54c812c76c09"}},{"ruleId":"D2","level":"warning","message":{"text":"metaservice.GetPDAddrs (cognitive 18): metaservice.GetPDAddrs has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12, loops 6 (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/metaservice/etcd.go"},"region":{"startLine":250}}}],"partialFingerprints":{"codehealthFindingId/v1":"c95a73686367fce83506ba22116bd6409f4e17a67869f02b33cda2686caa1255"}},{"ruleId":"D2","level":"warning","message":{"text":"ownerManager.campaignLoop (cognitive 18): ownerManager.campaignLoop has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, match/switch 2, loops 1 (nesting depth added 10). Of this number, 14 points are the body\u0027s own statements and 4 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":"pkg/owner/manager.go"},"region":{"startLine":352}}}],"partialFingerprints":{"codehealthFindingId/v1":"4651f7b3986ecc77f8b6046429d2881ae174e43c372ea3705347477f27a42232"}},{"ruleId":"D2","level":"warning","message":{"text":"cardinality.GetUsableSetsByGreedy (cognitive 18): cardinality.GetUsableSetsByGreedy has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, loops 3 (nesting depth added 10). Of this number, 17 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, 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/planner/cardinality/selectivity.go"},"region":{"startLine":640}}}],"partialFingerprints":{"codehealthFindingId/v1":"93b1efe209508bc1c2d69945e372b6ad0451885186a1e608286531b0c6cfffe5"}},{"ruleId":"D2","level":"warning","message":{"text":"core.iterateChildPlan4LogicalSequenceGE (cognitive 18): core.iterateChildPlan4LogicalSequenceGE has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, boolean chains 4, 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":"pkg/planner/core/find_best_task.go"},"region":{"startLine":365}}}],"partialFingerprints":{"codehealthFindingId/v1":"b3d88090e9dc34acda59b76550d73d0e0343eedb043ec08bc26d08fdfecbca96"}},{"ruleId":"D2","level":"warning","message":{"text":"core.iterateChildPlan4LogicalSequence (cognitive 18): core.iterateChildPlan4LogicalSequence has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, boolean chains 4, 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":"pkg/planner/core/find_best_task.go"},"region":{"startLine":422}}}],"partialFingerprints":{"codehealthFindingId/v1":"1147ef26d337470dba9db50889e6beb774365fcc4a4187677b172a615d491a91"}},{"ruleId":"D2","level":"warning","message":{"text":"core.compareRiskRatio (cognitive 18): core.compareRiskRatio has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12, boolean chains 6 (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":"pkg/planner/core/find_best_task.go"},"region":{"startLine":815}}}],"partialFingerprints":{"codehealthFindingId/v1":"bbde1e3682aa6f2fb0abdf21d7f3c43cb3733e08804a2ad6de59e83df1728bef"}},{"ruleId":"D2","level":"warning","message":{"text":"core.getBestIndexJoinPathResultByProp (cognitive 18): core.getBestIndexJoinPathResultByProp has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14, loops 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":"pkg/planner/core/index_join_path.go"},"region":{"startLine":797}}}],"partialFingerprints":{"codehealthFindingId/v1":"9f636594ea361eb64417db8b5775db587bf70e8cef97ca715dfbdb04ff9748ac"}},{"ruleId":"D2","level":"warning","message":{"text":"core.containsLateralTableSource (cognitive 18): core.containsLateralTableSource has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12, loops 3, boolean chains 2, match/switch 1 (nesting depth added 9). The drivers above price the dispatch low by construction \u2014 a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full \u2014 so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/logical_plan_builder.go"},"region":{"startLine":676}}}],"partialFingerprints":{"codehealthFindingId/v1":"030dafa67611fdd1cc697deae3ff2e4958233ae1673cf6665a11bd66b3a8bb5c"}},{"ruleId":"D2","level":"warning","message":{"text":"core.getTiFlashServerMinLogicalCores (cognitive 18): core.getTiFlashServerMinLogicalCores has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12, loops 5, boolean chains 1 (nesting depth added 10). Of this number, 16 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":"pkg/planner/core/optimizer.go"},"region":{"startLine":702}}}],"partialFingerprints":{"codehealthFindingId/v1":"69c36ed93b8c8050f77145f4403ec6627a281c9228f4b77c1429d8312cb61016"}},{"ruleId":"D2","level":"warning","message":{"text":"core.isPhysicalPlanCacheable (cognitive 18): core.isPhysicalPlanCacheable has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, boolean chains 3, loops 1, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/plan_cacheable_checker.go"},"region":{"startLine":595}}}],"partialFingerprints":{"codehealthFindingId/v1":"621f476ad859d42290f9bba55f1e773695ddd20208b5399215bffc6d819cb79a"}},{"ruleId":"D2","level":"warning","message":{"text":"core.getCost4PhysicalHashJoin (cognitive 18): core.getCost4PhysicalHashJoin has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, boolean chains 5 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/plan_cost_ver1.go"},"region":{"startLine":814}}}],"partialFingerprints":{"codehealthFindingId/v1":"4d1ced3f1dc1f9fc677483bdb85011ea346e4515b9813df5dfa17a894b0723ff"}},{"ruleId":"D2","level":"warning","message":{"text":"core.buildShowSchema (cognitive 18): core.buildShowSchema has cognitive complexity 18 (threshold 15). Drivers by points: if/else 17, match/switch 1 (nesting depth added 7). 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":"pkg/planner/core/planbuilder.go"},"region":{"startLine":5918}}}],"partialFingerprints":{"codehealthFindingId/v1":"f2bd5efab49ed9dc22550508f3fda654dbf82fd49b52308e05916160e0678f8a"}},{"ruleId":"D2","level":"warning","message":{"text":"core.buildPointUpdatePlan (cognitive 18): core.buildPointUpdatePlan has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12, loops 6 (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/planner/core/point_get_plan.go"},"region":{"startLine":1204}}}],"partialFingerprints":{"codehealthFindingId/v1":"8ef56836a72b2e67c2dbf73be2501ca8e3001f14601bd5ff45d484db458df666"}},{"ruleId":"D2","level":"warning","message":{"text":"core.detachCondAndBuildRangeForPath (cognitive 18): core.detachCondAndBuildRangeForPath has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, loops 4, boolean chains 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/stats.go"},"region":{"startLine":421}}}],"partialFingerprints":{"codehealthFindingId/v1":"e383ec09937e1b5caa6ee96f4d6cf64477b7f168d506bb84d94ae74aff3faeae"}},{"ruleId":"D2","level":"warning","message":{"text":"core.convertPartitionKeysIfNeed4PhysicalHashJoin (cognitive 18): core.convertPartitionKeysIfNeed4PhysicalHashJoin has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, loops 2, boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/task.go"},"region":{"startLine":334}}}],"partialFingerprints":{"codehealthFindingId/v1":"7cda72ae7a8494f8bc5f931e9e76decf0e8f50f2ee9363e8475582ea49ba9f55"}},{"ruleId":"D2","level":"warning","message":{"text":"tidbCodecFuncHelper.buildHandle (cognitive 18): tidbCodecFuncHelper.buildHandle has cognitive complexity 18 (threshold 15). Drivers by points: if/else 16, 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":"pkg/planner/core/expression_codec_fn.go"},"region":{"startLine":121}}}],"partialFingerprints":{"codehealthFindingId/v1":"43e1c0c3e73103dac34c0531730a5ad34cc3d3b8a93104bbdc647eb1514658b3"}},{"ruleId":"D2","level":"warning","message":{"text":"logicalop.extractStatsMetaFilters (cognitive 18): logicalop.extractStatsMetaFilters has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, loops 5 (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/planner/core/operator/logicalop/logical_show.go"},"region":{"startLine":208}}}],"partialFingerprints":{"codehealthFindingId/v1":"4e3aacdd4735db34e51112ff2705cc624ce0df4151a483c4b400887f55d5b5e8"}},{"ruleId":"D2","level":"warning","message":{"text":"LogicalSelection.BuildKeyInfo (cognitive 18): LogicalSelection.BuildKeyInfo has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12, loops 4, boolean chains 2 (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/planner/core/operator/logicalop/logical_selection.go"},"region":{"startLine":141}}}],"partialFingerprints":{"codehealthFindingId/v1":"afdd7cc0db3eaf7c021b5c863f9cf20ea58310065c199a2ea34ae664b32aef65"}},{"ruleId":"D2","level":"warning","message":{"text":"physicalop.getStreamAggs (cognitive 18): physicalop.getStreamAggs has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, loops 4, boolean chains 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":"pkg/planner/core/operator/physicalop/physical_stream_agg.go"},"region":{"startLine":89}}}],"partialFingerprints":{"codehealthFindingId/v1":"346e15c4f7da5775053a3268195d96e83391ea9c44f0d5be635f371f7e0003dc"}},{"ruleId":"D2","level":"warning","message":{"text":"Update.BuildOnUpdateFKTriggers (cognitive 18): Update.BuildOnUpdateFKTriggers has cognitive complexity 18 (threshold 15). Drivers by points: if/else 16, 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":"pkg/planner/core/operator/physicalop/foreign_key.go"},"region":{"startLine":244}}}],"partialFingerprints":{"codehealthFindingId/v1":"f540f1fb835086e69aed6bbd3f3bd40b10acc9223a45c98179cf9ed6de12ea33"}},{"ruleId":"D2","level":"warning","message":{"text":"PlanBuilder.buildProjectionFieldNameFromExpressions (cognitive 18): PlanBuilder.buildProjectionFieldNameFromExpressions has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, boolean chains 2, match/switch 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":"pkg/planner/core/logical_plan_builder.go"},"region":{"startLine":1451}}}],"partialFingerprints":{"codehealthFindingId/v1":"3c5d4c0a1287a0a508b7ce46ed1dac56f3c74b9f0bcb9f49c8880b1a99032a5f"}},{"ruleId":"D2","level":"warning","message":{"text":"PlanBuilder.buildIntersect (cognitive 18): PlanBuilder.buildIntersect has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14, match/switch 3, 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":"pkg/planner/core/logical_plan_builder.go"},"region":{"startLine":2240}}}],"partialFingerprints":{"codehealthFindingId/v1":"5ee4e971ec1f4391038c2a6ae6b81f58a65b706d209ab2e19c5bd290132c96be"}},{"ruleId":"D2","level":"warning","message":{"text":"PlanBuilder.buildJoinFuncDepend (cognitive 18): PlanBuilder.buildJoinFuncDepend has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11, match/switch 4, loops 2, boolean chains 1 (nesting depth added 10). The drivers above price the dispatch low by construction \u2014 a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full \u2014 so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/logical_plan_builder.go"},"region":{"startLine":3544}}}],"partialFingerprints":{"codehealthFindingId/v1":"562b39a5e678499c948cf3b00ef036e035fa3248de88e40fcf1133d16d5e421d"}},{"ruleId":"D2","level":"warning","message":{"text":"importIntoCollAssignmentChecker.Leave (cognitive 18): importIntoCollAssignmentChecker.Leave has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14, match/switch 3, boolean chains 1 (nesting depth added 10). The drivers above price the dispatch low by construction \u2014 a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full \u2014 so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/planbuilder.go"},"region":{"startLine":4668}}}],"partialFingerprints":{"codehealthFindingId/v1":"0ba1eafed6d381a6386fc7650aaae69350383471fc145baba7efb8076acf0698"}},{"ruleId":"D2","level":"warning","message":{"text":"exprPrefixAdder.addExprPrefix4DNFCond (cognitive 18): exprPrefixAdder.addExprPrefix4DNFCond has cognitive complexity 18 (threshold 15). Drivers by points: if/else 16, boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/rule_predicate_push_down.go"},"region":{"startLine":142}}}],"partialFingerprints":{"codehealthFindingId/v1":"9402088891a28b2dd6d548234a29d7576f02463cce0a2b12e4ab92201b966ac3"}},{"ruleId":"D2","level":"warning","message":{"text":"ResultReorder.completeSort (cognitive 18): ResultReorder.completeSort has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, loops 5 (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/planner/core/rule_result_reorder.go"},"region":{"startLine":54}}}],"partialFingerprints":{"codehealthFindingId/v1":"1ad00231d873371a963d3e32b8a19686c2e513d94103e670036bdb87bb455fa9"}},{"ruleId":"D2","level":"warning","message":{"text":"FDSet.addEquivalence (cognitive 18): FDSet.addEquivalence has cognitive complexity 18 (threshold 15). Drivers by points: if/else 16, 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":"pkg/planner/funcdep/fd_graph.go"},"region":{"startLine":346}}}],"partialFingerprints":{"codehealthFindingId/v1":"fe72bbef89d1155eb35a8e54f1e05310401cf19e2be8333a199c703f9a8d5fa4"}},{"ruleId":"D2","level":"warning","message":{"text":"indexadvisor.adviseIndexesWithOption (cognitive 18): indexadvisor.adviseIndexesWithOption has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, loops 4, boolean chains 1 (nesting depth added 6). Of this number, 17 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, 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/planner/indexadvisor/indexadvisor.go"},"region":{"startLine":61}}}],"partialFingerprints":{"codehealthFindingId/v1":"bb8027be7168b22ff5b3c9a31158ca2f1e726246ffb59235fe43b921cc8b846c"}},{"ruleId":"D2","level":"warning","message":{"text":"indexadvisor.prepareQuerySet (cognitive 18): indexadvisor.prepareQuerySet has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, loops 2, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/indexadvisor/indexadvisor.go"},"region":{"startLine":137}}}],"partialFingerprints":{"codehealthFindingId/v1":"5eef1d934244745ca1044a032c37c095a6434947be4e38585c6de699f98c7322"}},{"ruleId":"D2","level":"warning","message":{"text":"util.proveNullRejectedScalarFunc (cognitive 18): util.proveNullRejectedScalarFunc has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9, boolean chains 6, loops 2, 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":"pkg/planner/util/null_misc.go"},"region":{"startLine":172}}}],"partialFingerprints":{"codehealthFindingId/v1":"ac35807f81857c831f8f3fa755fe0b3532bc1c59eddeca7f7b5247f7d65ed257"}},{"ruleId":"D2","level":"warning","message":{"text":"privileges.checkCertSAN (cognitive 18): privileges.checkCertSAN has cognitive complexity 18 (threshold 15). Drivers by points: loops 9, if/else 7, match/switch 2 (nesting depth added 10). 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":"pkg/privilege/privileges/privileges.go"},"region":{"startLine":892}}}],"partialFingerprints":{"codehealthFindingId/v1":"57575bde41d4be2610034030a73375f760ed8657505874e700cda340ef01a69b"}},{"ruleId":"D2","level":"warning","message":{"text":"UserPrivileges.CheckPasswordExpired (cognitive 18): UserPrivileges.CheckPasswordExpired has cognitive complexity 18 (threshold 15). Drivers by points: if/else 17, 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":"pkg/privilege/privileges/privileges.go"},"region":{"startLine":488}}}],"partialFingerprints":{"codehealthFindingId/v1":"9f886c0cc861c735f69118def11a552be47b2f997721004c920c2a4132009c79"}},{"ruleId":"D2","level":"warning","message":{"text":"TaskManager.iter (cognitive 18): TaskManager.iter has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, loops 3 (nesting depth added 11). 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 46). 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":"pkg/resourcemanager/poolmanager/task_manager_iterator.go"},"region":{"startLine":43}}}],"partialFingerprints":{"codehealthFindingId/v1":"98a9f0aebfa946efbbf9b934d79bb52898c8be401dde13cb6fb73ba35176c81f"}},{"ruleId":"D2","level":"warning","message":{"text":"PacketIO.WritePacket (cognitive 18): PacketIO.WritePacket has cognitive complexity 18 (threshold 15). Drivers by points: if/else 17, 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/server/internal/packetio.go"},"region":{"startLine":244}}}],"partialFingerprints":{"codehealthFindingId/v1":"b61cbab4729789d1939f426c4e2716d8974d4834cf09af7aed03a919cec1dd9c"}},{"ruleId":"D2","level":"warning","message":{"text":"session.ParseSQL (cognitive 18): session.ParseSQL has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14, loops 3, boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/session/session.go"},"region":{"startLine":1684}}}],"partialFingerprints":{"codehealthFindingId/v1":"a0916285949f76dba542d4719c62a44b418ace6cc7ba12bd12e9695923438d6d"}},{"ruleId":"D2","level":"warning","message":{"text":"session.SetProcessInfo (cognitive 18): session.SetProcessInfo has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, boolean chains 5 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/session/session.go"},"region":{"startLine":1733}}}],"partialFingerprints":{"codehealthFindingId/v1":"2395bd12a6db6c41ec0809a92d414ba279432c87973644c54f7d053081844d8b"}},{"ruleId":"D2","level":"warning","message":{"text":"variable.parseByteSize (cognitive 18): variable.parseByteSize has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 9, if/else 9. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/sessionctx/variable/varsutil.go"},"region":{"startLine":317}}}],"partialFingerprints":{"codehealthFindingId/v1":"571d74cb7120e439e8e749313b14e5c0ee4890f4587512fb19ea5c99f77ec092"}},{"ruleId":"D2","level":"warning","message":{"text":"SessionVars.GetReplicaRead (cognitive 18): SessionVars.GetReplicaRead has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, loops 3, boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/sessionctx/variable/session.go"},"region":{"startLine":2638}}}],"partialFingerprints":{"codehealthFindingId/v1":"866b51dede3d30785bac4216d3b9ba82cedf850818f8b3dc71d85ca2b257e088"}},{"ruleId":"D2","level":"warning","message":{"text":"statistics.MergeHistograms (cognitive 18): statistics.MergeHistograms has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9, loops 6, boolean chains 3 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/statistics/histogram.go"},"region":{"startLine":960}}}],"partialFingerprints":{"codehealthFindingId/v1":"3226ac80a77d2ec6f7db4d0018b4d4fd5b74d238d3dd4be449d95b82b1b07c8b"}},{"ruleId":"D2","level":"warning","message":{"text":"statistics.mergeBucketNDV (cognitive 18): statistics.mergeBucketNDV has cognitive complexity 18 (threshold 15). Drivers by points: if/else 18 (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":"pkg/statistics/histogram.go"},"region":{"startLine":1495}}}],"partialFingerprints":{"codehealthFindingId/v1":"dc3897b9a9171d78420fce0ad51938d5eaabef04f1b29a082bb12b4d687b4ee1"}},{"ruleId":"D2","level":"warning","message":{"text":"AsyncMergePartitionStats2GlobalStats.loadHistogramAndTopN (cognitive 18): AsyncMergePartitionStats2GlobalStats.loadHistogramAndTopN has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12, loops 3, match/switch 2, boolean chains 1 (nesting depth added 9). Of this number, 17 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, 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/statistics/handle/globalstats/global_stats_async.go"},"region":{"startLine":401}}}],"partialFingerprints":{"codehealthFindingId/v1":"8273e31c4aa7778d8d4196743333a5f4f0c1aa95eacbaa40a5860e5f3491ca8f"}},{"ruleId":"D2","level":"warning","message":{"text":"statsSyncLoad.SyncWaitStatsLoad (cognitive 18): statsSyncLoad.SyncWaitStatsLoad has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14, loops 2, match/switch 2 (nesting depth added 8). Of this number, 17 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, 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/statistics/handle/syncload/stats_syncload.go"},"region":{"startLine":154}}}],"partialFingerprints":{"codehealthFindingId/v1":"07eb4cba12fe06e3ed90ede613b42acfa0d55f6d094bf088b72a11b0c1e3310e"}},{"ruleId":"D2","level":"warning","message":{"text":"coprHandler.handleAnalyzeColumnsReq (cognitive 18): coprHandler.handleAnalyzeColumnsReq has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, loops 4, boolean chains 1 (nesting depth added 1). Of this number, 16 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. 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":"pkg/store/mockstore/mockcopr/analyze.go"},"region":{"startLine":137}}}],"partialFingerprints":{"codehealthFindingId/v1":"520507590e90ecace60699d11f3630e5f9ac5869b7762e9e896937f945e1e5af"}},{"ruleId":"D2","level":"warning","message":{"text":"tableScanExec.Next (cognitive 18): tableScanExec.Next 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/store/mockstore/mockcopr/executor.go"},"region":{"startLine":123}}}],"partialFingerprints":{"codehealthFindingId/v1":"742b40cbb2b0fa362b30673a9023d7c58c7825be0a51fee1ef92aa5f81bb4cf1"}},{"ruleId":"D2","level":"warning","message":{"text":"cophandler.buildClosureExecutorFromExecutorList (cognitive 18): cophandler.buildClosureExecutorFromExecutorList has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10, loops 6, boolean chains 1, match/switch 1 (nesting depth added 4). 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":"pkg/store/mockstore/unistore/cophandler/closure_exec.go"},"region":{"startLine":103}}}],"partialFingerprints":{"codehealthFindingId/v1":"aa25dd2a30148897b19e630c47782efd00bcfd7a1324f61bb2948c75d2198655"}},{"ruleId":"D2","level":"warning","message":{"text":"countColumnProcessor.Process (cognitive 18): countColumnProcessor.Process has cognitive complexity 18 (threshold 15). Drivers by points: if/else 18 (nesting depth added 6). Of this number, 16 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":"pkg/store/mockstore/unistore/cophandler/closure_exec.go"},"region":{"startLine":682}}}],"partialFingerprints":{"codehealthFindingId/v1":"cdc29e2fe382fe21765926156668c879f62b2d78ba07413850ee71bc716792f1"}},{"ruleId":"D2","level":"warning","message":{"text":"tableScanExec.open (cognitive 18): tableScanExec.open has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12, loops 3, match/switch 2, boolean chains 1 (nesting depth added 7). Most of this is not in the body itself: 6 of the 18 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":"pkg/store/mockstore/unistore/cophandler/mpp_exec.go"},"region":{"startLine":192}}}],"partialFingerprints":{"codehealthFindingId/v1":"d18cd2419db1b0b82beb29852ae7ecaa951041aac173258306a56eae6c8f2eca"}},{"ruleId":"D2","level":"warning","message":{"text":"joinExec.fetchRows (cognitive 18): joinExec.fetchRows has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, loops 4, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/store/mockstore/unistore/cophandler/mpp_exec.go"},"region":{"startLine":1232}}}],"partialFingerprints":{"codehealthFindingId/v1":"75437303f232488e761860f29ac736ed3ecfe08672b85d595ed01d81728ccabc"}},{"ruleId":"D2","level":"warning","message":{"text":"StandAloneRegionManager.runSplitWorker (cognitive 18): StandAloneRegionManager.runSplitWorker has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9, loops 7, match/switch 2 (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/store/mockstore/unistore/tikv/region.go"},"region":{"startLine":629}}}],"partialFingerprints":{"codehealthFindingId/v1":"45ca984d1447bac3af322249c5927c5cfb2839fe28860fb667a6fb585d79c757"}},{"ruleId":"D2","level":"warning","message":{"text":"Waiter.Wait (cognitive 18): Waiter.Wait has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, match/switch 2, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/store/mockstore/unistore/util/lockwaiter/lockwaiter.go"},"region":{"startLine":109}}}],"partialFingerprints":{"codehealthFindingId/v1":"53b2655df988163d42c482473d84f46442761ece4ae00bd75e14fc26b9ebedf5"}},{"ruleId":"D2","level":"warning","message":{"text":"tables.partitionedTableAddRecord (cognitive 18): tables.partitionedTableAddRecord has cognitive complexity 18 (threshold 15). Drivers by points: if/else 16, boolean chains 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":"pkg/table/tables/partition.go"},"region":{"startLine":1748}}}],"partialFingerprints":{"codehealthFindingId/v1":"526138560ba9e983a34ec1de1f0062cabd0a3226824b2069106f8ee2f0a8f048"}},{"ruleId":"D2","level":"warning","message":{"text":"ForListColumnPruning.buildListPartitionValueMapAndSorted (cognitive 18): ForListColumnPruning.buildListPartitionValueMapAndSorted has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, loops 3, boolean chains 1, jumps 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/table/tables/partition.go"},"region":{"startLine":1188}}}],"partialFingerprints":{"codehealthFindingId/v1":"e12585d7c336f15a28c8586db7f4a926bbc0bd56104bc9a11448ce68d5bed7e6"}},{"ruleId":"D2","level":"warning","message":{"text":"TableCommon.ResetColumnsCache (cognitive 18): TableCommon.ResetColumnsCache has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11, loops 4, boolean chains 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":"pkg/table/tables/tables.go"},"region":{"startLine":92}}}],"partialFingerprints":{"codehealthFindingId/v1":"61d72a62e7b7597e4a4f069c7ae65045d94ab9280cdb88249f55edf3a9e95058"}},{"ruleId":"D2","level":"warning","message":{"text":"tablecodec.decodeIndexKvGeneral (cognitive 18): tablecodec.decodeIndexKvGeneral has cognitive complexity 18 (threshold 15). Drivers by points: if/else 18 (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":"pkg/tablecodec/tablecodec.go"},"region":{"startLine":2000}}}],"partialFingerprints":{"codehealthFindingId/v1":"3ab9465305fa57452cf0ce232ce8a8358053dcab7799d0348cdfe0d9076b65f5"}},{"ruleId":"D2","level":"warning","message":{"text":"PhysicalTable.SplitScanRanges (cognitive 18): PhysicalTable.SplitScanRanges has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9, match/switch 8, 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":"pkg/ttl/cache/table.go"},"region":{"startLine":287}}}],"partialFingerprints":{"codehealthFindingId/v1":"2327715ddf95c09f2f265b8c4589cc46ead14bb0acb39a5f8fa5574429acb485"}},{"ruleId":"D2","level":"warning","message":{"text":"taskManager.rescheduleTasks (cognitive 18): taskManager.rescheduleTasks has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12, match/switch 3, jumps 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":"pkg/ttl/ttlworker/task_manager.go"},"region":{"startLine":305}}}],"partialFingerprints":{"codehealthFindingId/v1":"55d7e61d63264e3535c2c9caa8048e350d881e3f37bc8a0cc5a13ec2a2992509"}},{"ruleId":"D2","level":"warning","message":{"text":"types.matchDuration (cognitive 18): types.matchDuration has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, boolean chains 3 (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":"pkg/types/time.go"},"region":{"startLine":1722}}}],"partialFingerprints":{"codehealthFindingId/v1":"8f2d4d8877d16b63ebaf3abc4962ed164627fc8076b68ae76c2caabc1c539339"}},{"ruleId":"D2","level":"warning","message":{"text":"admin.iterRecords (cognitive 18): admin.iterRecords has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, loops 3, boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/util/admin/admin.go"},"region":{"startLine":208}}}],"partialFingerprints":{"codehealthFindingId/v1":"2250183da8c0a0347c99a50edd7f671f8790c2a42840dfa80fe9573f6b687d01"}},{"ruleId":"D2","level":"warning","message":{"text":"codec.DecodeRange (cognitive 18): codec.DecodeRange has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, match/switch 2, 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":"pkg/util/codec/codec.go"},"region":{"startLine":1290}}}],"partialFingerprints":{"codehealthFindingId/v1":"26262db56701a7f934c36dc5724bd563f0159fcb0330b83a8fbd86b6ae18505d"}},{"ruleId":"D2","level":"warning","message":{"text":"dbutil.GetBucketsInfo (cognitive 18): dbutil.GetBucketsInfo has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, loops 2, match/switch 2, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/util/dbutil/common.go"},"region":{"startLine":465}}}],"partialFingerprints":{"codehealthFindingId/v1":"fc746c0ea69b7a85f3af9387dae232995932d5b63f68a1673586eae804c54be0"}},{"ruleId":"D2","level":"warning","message":{"text":"MemArbitrator.updateAvoidSize (cognitive 18): MemArbitrator.updateAvoidSize has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14, boolean chains 2, loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/util/memory/arbitrator.go"},"region":{"startLine":2249}}}],"partialFingerprints":{"codehealthFindingId/v1":"901219c9158b84404cac009d12d69ded15db7946bd3c78f181cdf9410172ed17"}},{"ruleId":"D2","level":"warning","message":{"text":"ranger.handleBoundCol (cognitive 18): ranger.handleBoundCol has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 10, if/else 6, boolean chains 2 (nesting depth added 8). 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/util/ranger/points.go"},"region":{"startLine":478}}}],"partialFingerprints":{"codehealthFindingId/v1":"7a225c451142ac65aadc37e021e5f25aac612a26e9e277cd1230b2795ec8cecc"}},{"ruleId":"D2","level":"warning","message":{"text":"RouteTable.Route (cognitive 18): RouteTable.Route has cognitive complexity 18 (threshold 15). Drivers by points: if/else 16, boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/util/regexpr-router/regexpr_router.go"},"region":{"startLine":110}}}],"partialFingerprints":{"codehealthFindingId/v1":"8f2e3c73352fdfd70afa9257a9b59e0e719683fd3b79ae398f30cb4e122b2be3"}},{"ruleId":"D2","level":"warning","message":{"text":"Table.Route (cognitive 18): Table.Route has cognitive complexity 18 (threshold 15). Drivers by points: if/else 16, boolean chains 1, 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":"pkg/util/table-router/router.go"},"region":{"startLine":186}}}],"partialFingerprints":{"codehealthFindingId/v1":"253491e87ca6f396ee7a7d2a0cd8c99580d95904e8ff628db031bb37efd9501b"}},{"ruleId":"D2","level":"warning","message":{"text":"ruWindowAggregator.addBatch (cognitive 18): ruWindowAggregator.addBatch has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12, 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":"pkg/util/topsql/reporter/ru_window_aggregator.go"},"region":{"startLine":65}}}],"partialFingerprints":{"codehealthFindingId/v1":"817c60dc3942e310205badef8d624f44de7d80c4823371b7349e3c9efa74ea2f"}},{"ruleId":"D2","level":"warning","message":{"text":"Handle.SaveTableReadCostMetrics (cognitive 18): Handle.SaveTableReadCostMetrics has cognitive complexity 18 (threshold 15). Drivers by points: if/else 17, loops 1 (nesting depth added 5). Of this number, 16 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":"pkg/workloadlearning/handle.go"},"region":{"startLine":244}}}],"partialFingerprints":{"codehealthFindingId/v1":"075482edfaade6437ec0c153e5e5f2424c91610b04c6ce4c20a127f31a7c3b2d"}},{"ruleId":"D2","level":"warning","message":{"text":"main.main (cognitive 18): main.main has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12, loops 6 (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":"tools/dashboard-linter/main.go"},"region":{"startLine":48}}}],"partialFingerprints":{"codehealthFindingId/v1":"fd63f062d0dc9d92e569504649111e8d366be44e3cca316bca3c2178500f3c3d"}},{"ruleId":"D2","level":"warning","message":{"text":"parser.startWithNumber (cognitive 18): parser.startWithNumber has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10, boolean chains 6, 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":"pkg/parser/lexer.go"},"region":{"startLine":842}}}],"partialFingerprints":{"codehealthFindingId/v1":"e16a8738e0171f6b4b2334c30517dbc24e63eb626745a95772038da87e119708"}},{"ruleId":"D2","level":"warning","message":{"text":"ValueExpr.Restore (cognitive 18): ValueExpr.Restore has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14, 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":"pkg/parser/test_driver/test_driver.go"},"region":{"startLine":60}}}],"partialFingerprints":{"codehealthFindingId/v1":"2799419f3b705fa814bbb1977b0c1a65bb28c8680e0040d64f2805c0faa85855"}},{"ruleId":"D2","level":"warning","message":{"text":"backup.ObserveStoreChangesAsync (cognitive 17): backup.ObserveStoreChangesAsync has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, loops 5, match/switch 3 (nesting depth added 8). 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 296). 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":"br/pkg/backup/store.go"},"region":{"startLine":295}}}],"partialFingerprints":{"codehealthFindingId/v1":"5ef841d2a0902e35616ef8bb6904dcf7ff68231e13469eda70879a61d3c3a7d6"}},{"ruleId":"D2","level":"warning","message":{"text":"pdutil.pauseSchedulerByKeyRangeWithTTL (cognitive 17): pdutil.pauseSchedulerByKeyRangeWithTTL has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10, jumps 2, loops 2, match/switch 2, boolean chains 1 (nesting depth added 6). 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 806). 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":"br/pkg/pdutil/pd.go"},"region":{"startLine":770}}}],"partialFingerprints":{"codehealthFindingId/v1":"62f1951f311c5b611ac7a5e0f1c35c8ba5e4218c7ee0db63a0af513ca0713e79"}},{"ruleId":"D2","level":"warning","message":{"text":"PdController.pauseSchedulersAndConfigWith (cognitive 17): PdController.pauseSchedulersAndConfigWith has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, match/switch 2, loops 1 (nesting depth added 9). 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 317). 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":"br/pkg/pdutil/pd.go"},"region":{"startLine":294}}}],"partialFingerprints":{"codehealthFindingId/v1":"df4ca725bb2128661f9a2aba7037be11acf569eff83fb2e90c2c3616b502c491"}},{"ruleId":"D2","level":"warning","message":{"text":"Registry.resolveRestoreTS (cognitive 17): Registry.resolveRestoreTS has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15, boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"br/pkg/registry/registration.go"},"region":{"startLine":681}}}],"partialFingerprints":{"codehealthFindingId/v1":"2dae53c29060947a8f8ffc2041de497806b4732bc9f37117b2b4ccbdde038f23"}},{"ruleId":"D2","level":"warning","message":{"text":"Recovery.ReadRegionMeta (cognitive 17): Recovery.ReadRegionMeta has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, loops 4, match/switch 2 (nesting depth added 7). Most of this is not in the body itself: 6 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 229). 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":"br/pkg/restore/data/data.go"},"region":{"startLine":212}}}],"partialFingerprints":{"codehealthFindingId/v1":"b111ccd230a516bd3066694b6d8e488ec868af3cc67e192008bcc77000662134"}},{"ruleId":"D2","level":"warning","message":{"text":"Recovery.SpawnTiKVShutDownWatchers (cognitive 17): Recovery.SpawnTiKVShutDownWatchers has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, loops 4, match/switch 2 (nesting depth added 11). 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 353). 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":"br/pkg/restore/data/data.go"},"region":{"startLine":341}}}],"partialFingerprints":{"codehealthFindingId/v1":"cfa5e65997548a727f8076373f9466851b0fed1a6da946d468650d64725bb0d0"}},{"ruleId":"D2","level":"warning","message":{"text":"Recovery.MakeRecoveryPlan (cognitive 17): Recovery.MakeRecoveryPlan has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10, loops 7 (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":"br/pkg/restore/data/data.go"},"region":{"startLine":448}}}],"partialFingerprints":{"codehealthFindingId/v1":"7fd6053db8656aa9fecb4bfef363ad6be09aaddccc3a92a979dee9017bbbbfbd"}},{"ruleId":"D2","level":"warning","message":{"text":"LogClient.saveIDMap2Table (cognitive 17): LogClient.saveIDMap2Table has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, loops 4 (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":"br/pkg/restore/log_client/id_map.go"},"region":{"startLine":108}}}],"partialFingerprints":{"codehealthFindingId/v1":"d663c78a9a277311fa72651cc738a357f2d7ec323b39d027ecfcb83bb91e8cb5"}},{"ruleId":"D2","level":"warning","message":{"text":"BatchRestorer.GoRestore (cognitive 17): BatchRestorer.GoRestore has cognitive complexity 17 (threshold 15). Drivers by points: loops 10, if/else 7 (nesting depth added 9). 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 260). 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":"br/pkg/restore/restorer.go"},"region":{"startLine":259}}}],"partialFingerprints":{"codehealthFindingId/v1":"75158784262f631aa5682824cbb5ea405cb8c71f77ce6a627c4313f4374c232a"}},{"ruleId":"D2","level":"warning","message":{"text":"snapclient.getSSTMetaFromFile (cognitive 17): snapclient.getSSTMetaFromFile has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, 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":"br/pkg/restore/snap_client/import.go"},"region":{"startLine":567}}}],"partialFingerprints":{"codehealthFindingId/v1":"e07c5408d92545623f1e74c22329c8ed1079a56263c649dd5a7105d99986ad81"}},{"ruleId":"D2","level":"warning","message":{"text":"SnapClient.execAndValidateChecksum (cognitive 17): SnapClient.execAndValidateChecksum has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15, boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"br/pkg/restore/snap_client/client.go"},"region":{"startLine":1552}}}],"partialFingerprints":{"codehealthFindingId/v1":"40100c2c38ac5de2ba4e35bdce5fb774d43fb416c6ce85b1a28d3d45dd923ffa"}},{"ruleId":"D2","level":"warning","message":{"text":"SnapClient.restoreSystemSchema (cognitive 17): SnapClient.restoreSystemSchema has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, boolean chains 2, loops 1 (nesting depth added 5). Of this number, 16 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":"br/pkg/restore/snap_client/systable_restore.go"},"region":{"startLine":373}}}],"partialFingerprints":{"codehealthFindingId/v1":"4f89067a804b772738e94d2a76940108b8ebee9ad3c4c78f595a3c2d0b129f75"}},{"ruleId":"D2","level":"warning","message":{"text":"SnapFileImporter.download (cognitive 17): SnapFileImporter.download has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, boolean chains 6 (nesting depth added 1). 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 655). 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":"br/pkg/restore/snap_client/import.go"},"region":{"startLine":647}}}],"partialFingerprints":{"codehealthFindingId/v1":"5e7051dc33a4922795affb52804c9982cabff415fb9eb0cd910e0955edd50068"}},{"ruleId":"D2","level":"warning","message":{"text":"pitrCollector.onBatch (cognitive 17): pitrCollector.onBatch has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, loops 5 (nesting depth added 7). Of this number, 9 points are the body\u0027s own statements and 8 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":"br/pkg/restore/snap_client/pitr_collector.go"},"region":{"startLine":237}}}],"partialFingerprints":{"codehealthFindingId/v1":"4b9190eada73a1d98c5417032187b2f32ec7ae00fc0a018a4d22de694642fdb6"}},{"ruleId":"D2","level":"warning","message":{"text":"stream.UpdateShiftTSFromMetadata (cognitive 17): stream.UpdateShiftTSFromMetadata has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10, boolean chains 4, 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":"br/pkg/stream/stream_metas.go"},"region":{"startLine":316}}}],"partialFingerprints":{"codehealthFindingId/v1":"9eaea559469e4d1752c7edf7eb4f0e53672158c5486731eeeffe66b75b77776e"}},{"ruleId":"D2","level":"warning","message":{"text":"StreamBackupSearch.resolveMetaData (cognitive 17): StreamBackupSearch.resolveMetaData has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, 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":"br/pkg/stream/search.go"},"region":{"startLine":125}}}],"partialFingerprints":{"codehealthFindingId/v1":"8acd527353e2603acba749343e55d5b8c4e482ee46c4a0bc686dc022885b5ae4"}},{"ruleId":"D2","level":"warning","message":{"text":"MigrationExt.applyMetaEditTo (cognitive 17): MigrationExt.applyMetaEditTo has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15, boolean chains 1, loops 1 (nesting depth added 7). Of this number, 9 points are the body\u0027s own statements and 8 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"br/pkg/stream/stream_metas.go"},"region":{"startLine":1196}}}],"partialFingerprints":{"codehealthFindingId/v1":"d3c8aad98b445d794bc25ed57f14f9d00311a307ebe9df4d439bb62c21968c46"}},{"ruleId":"D2","level":"warning","message":{"text":"CheckpointAdvancer.onTaskEvent (cognitive 17): CheckpointAdvancer.onTaskEvent has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction \u2014 a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full \u2014 so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"br/pkg/streamhelper/advancer.go"},"region":{"startLine":541}}}],"partialFingerprints":{"codehealthFindingId/v1":"1eb2c15cd56af69cd674dbbefc85b0cae093898b97beca5b39729e0b3bc26617"}},{"ruleId":"D2","level":"warning","message":{"text":"task.VerifyDBAndTableInBackup (cognitive 17): task.VerifyDBAndTableInBackup has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10, loops 5, boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"br/pkg/task/restore.go"},"region":{"startLine":888}}}],"partialFingerprints":{"codehealthFindingId/v1":"1a80477e84c687f0b54c827e285bdee08d8e7734a825a692a5b067930844816e"}},{"ruleId":"D2","level":"warning","message":{"text":"task.cleanUpCheckpoints (cognitive 17): task.cleanUpCheckpoints has cognitive complexity 17 (threshold 15). Drivers by points: if/else 17 (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":"br/pkg/task/restore.go"},"region":{"startLine":1204}}}],"partialFingerprints":{"codehealthFindingId/v1":"4b1185fdcc8e4883d9d411d4d945729eccad6062fcab3c01c06295e8fb2ebe2c"}},{"ruleId":"D2","level":"warning","message":{"text":"utils.unescapedKey (cognitive 17): utils.unescapedKey has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, match/switch 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"br/pkg/utils/key.go"},"region":{"startLine":42}}}],"partialFingerprints":{"codehealthFindingId/v1":"8e8939fc30164a52b1139c2e24b4d0892e0ddef1d7bb5e148e14999e2b6f5ed3"}},{"ruleId":"D2","level":"warning","message":{"text":"TestHarness.AssertDownstreamCanRestoreTo (cognitive 17): TestHarness.AssertDownstreamCanRestoreTo has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, loops 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"br/pkg/utiltest/crr/harness.go"},"region":{"startLine":166}}}],"partialFingerprints":{"codehealthFindingId/v1":"99c70e6ded48ce846c275c5ac65e334dbca602736202d5abc1d00a75c4c82466"}},{"ruleId":"D2","level":"warning","message":{"text":"bootstrap.checkBootstrapDotGo (cognitive 17): bootstrap.checkBootstrapDotGo has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, loops 4, 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":"build/linter/bootstrap/analyzer.go"},"region":{"startLine":139}}}],"partialFingerprints":{"codehealthFindingId/v1":"c575616001319fb7a10accbcd79bf0e0f5d513bbbfbf4613f631c6c75415de50"}},{"ruleId":"D2","level":"warning","message":{"text":"lll.getLLLIssuesForFile (cognitive 17): lll.getLLLIssuesForFile has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15, 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":"build/linter/lll/analyzer.go"},"region":{"startLine":92}}}],"partialFingerprints":{"codehealthFindingId/v1":"9b359ad27b61b3b2bb166e79bf0e3cc7ce2a5d8bfb9efde0ef165f3e6098ddf0"}},{"ruleId":"D2","level":"warning","message":{"text":"main.main (cognitive 17): main.main has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, boolean chains 1 (nesting depth added 1). Of this number, 16 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. 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":"cmd/pluginpkg/pluginpkg.go"},"region":{"startLine":91}}}],"partialFingerprints":{"codehealthFindingId/v1":"42451ac409d271cddd4d61562b85e0eee2679d1fb1121b8fb9571c559421833a"}},{"ruleId":"D2","level":"warning","message":{"text":"export.buildLockTablesSQL (cognitive 17): export.buildLockTablesSQL has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, loops 3 (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":"dumpling/export/sql.go"},"region":{"startLine":1229}}}],"partialFingerprints":{"codehealthFindingId/v1":"80807cdcd92912e1cc931da01130d8551fcbba3512435c85e805c40aa552a649"}},{"ruleId":"D2","level":"warning","message":{"text":"export.infiniteChan (cognitive 17): export.infiniteChan has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, loops 3, match/switch 3 (nesting depth added 9). 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 74). 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":"dumpling/export/util.go"},"region":{"startLine":71}}}],"partialFingerprints":{"codehealthFindingId/v1":"0161d0c3d36144b839bfcb62dbb4e62581c5f69f4811f0b4173ae17cdc686487"}},{"ruleId":"D2","level":"warning","message":{"text":"multiQueriesChunkIter.nextRows (cognitive 17): multiQueriesChunkIter.nextRows has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, loops 1 (nesting depth added 8). Of this number, 16 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":"dumpling/export/ir_impl.go"},"region":{"startLine":78}}}],"partialFingerprints":{"codehealthFindingId/v1":"adeb585ff244e2d3a1672d04138abd696879175116434787a5c5437e93bef437"}},{"ruleId":"D2","level":"warning","message":{"text":"MySQLCheckpointsDB.Initialize (cognitive 17): MySQLCheckpointsDB.Initialize has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, loops 3 (nesting depth added 8). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to one function literal inside it that branches (line 809). 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":"lightning/pkg/checkpoints/checkpoints.go"},"region":{"startLine":805}}}],"partialFingerprints":{"codehealthFindingId/v1":"c2d80d282484ffafcb13408d4e9956811e18c04533933b1137e3686fb50499d7"}},{"ruleId":"D2","level":"warning","message":{"text":"MySQLCheckpointsDB.DestroyErrorCheckpoint (cognitive 17): MySQLCheckpointsDB.DestroyErrorCheckpoint has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15, boolean chains 1, loops 1 (nesting depth added 3). Most of this is not in the body itself: 3 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 1765). 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":"lightning/pkg/checkpoints/checkpoints.go"},"region":{"startLine":1710}}}],"partialFingerprints":{"codehealthFindingId/v1":"e0dd760d7c691b2e8d4c69fd40e7beeb3cea23d47a488dc9ef41a68f4222fe15"}},{"ruleId":"D2","level":"warning","message":{"text":"FileCheckpointsDB.GetLocalStoringTables (cognitive 17): FileCheckpointsDB.GetLocalStoringTables has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, loops 6, 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":"lightning/pkg/checkpoints/checkpoints.go"},"region":{"startLine":1941}}}],"partialFingerprints":{"codehealthFindingId/v1":"3d65063791073c1a9f5a2fc1212491161d39d14683ffceff0116fe4cb1a72a77"}},{"ruleId":"D2","level":"warning","message":{"text":"importer.getDDLStatus (cognitive 17): importer.getDDLStatus has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, boolean chains 2, loops 2, 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":"lightning/pkg/importer/table_import.go"},"region":{"startLine":1633}}}],"partialFingerprints":{"codehealthFindingId/v1":"a0c083df57eface0c3692448c76132bb606f668baa930ee63f90b956ad16ea88"}},{"ruleId":"D2","level":"warning","message":{"text":"DefaultJobOrchestrator.updateCheckpointsAfterCancel (cognitive 17): DefaultJobOrchestrator.updateCheckpointsAfterCancel has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10, boolean chains 4, match/switch 2, 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":"lightning/pkg/importinto/job_orchestrator.go"},"region":{"startLine":266}}}],"partialFingerprints":{"codehealthFindingId/v1":"79a0f2deeca4f98beabfad6a05351de7602de83eaac61470be59e95d3147933a"}},{"ruleId":"D2","level":"warning","message":{"text":"server.initDBAndKeyspace (cognitive 17): server.initDBAndKeyspace has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, 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":"lightning/pkg/server/lightning.go"},"region":{"startLine":600}}}],"partialFingerprints":{"codehealthFindingId/v1":"b4b483c443d77f5242ad7ec95cbdfc862c918cc3f412daddf74a1c0d42353007"}},{"ruleId":"D2","level":"warning","message":{"text":"ruleBasedPlanPerfPredictor.PerfPredicate (cognitive 17): ruleBasedPlanPerfPredictor.PerfPredicate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, loops 3, boolean chains 2 (nesting depth added 4). Of this number, 15 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":"pkg/bindinfo/binding_plan_evolution.go"},"region":{"startLine":36}}}],"partialFingerprints":{"codehealthFindingId/v1":"f3df31483f0d3a9c94e1f70ec8886b6d427fdd3f61998102970cc4834ffb2b3c"}},{"ruleId":"D2","level":"warning","message":{"text":"config.GetJSONConfig (cognitive 17): config.GetJSONConfig has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, loops 4 (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":"pkg/config/config.go"},"region":{"startLine":1970}}}],"partialFingerprints":{"codehealthFindingId/v1":"690534d247488cb88020963f4fee7f7226aac76e45ce7de2e034d20c22d5f6a3"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.splitSubtaskMetaForOneKVMetaGroup (cognitive 17): ddl.splitSubtaskMetaForOneKVMetaGroup has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15, boolean chains 1, loops 1 (nesting depth added 5). Of this number, 16 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":"pkg/ddl/backfilling_dist_scheduler.go"},"region":{"startLine":560}}}],"partialFingerprints":{"codehealthFindingId/v1":"940a37b054e4d29dd33ba7d041e85fbfdd4f36e35eb1186723517dee6c05ae4b"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.checkTableForeignKeyValid (cognitive 17): ddl.checkTableForeignKeyValid has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, boolean chains 3, 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":"pkg/ddl/foreign_key.go"},"region":{"startLine":186}}}],"partialFingerprints":{"codehealthFindingId/v1":"f743e1eb3b0684a3752a4d0ec602e50f7d544d57ef20ac5b2f870c8f0ca241ca"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.runReorgJobAndHandleErr (cognitive 17): ddl.runReorgJobAndHandleErr has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, boolean chains 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/index.go"},"region":{"startLine":2009}}}],"partialFingerprints":{"codehealthFindingId/v1":"7db64609d3a315cd37c382b0e9fd59cb83b9975b76a959f687207b935b8329d0"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.getModifyColumnType (cognitive 17): ddl.getModifyColumnType has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10, boolean chains 7 (nesting depth added 1). Of this number, 15 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. 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":"pkg/ddl/modify_column.go"},"region":{"startLine":83}}}],"partialFingerprints":{"codehealthFindingId/v1":"c88a6f784f2b44afedb54e5b1fa83d6208ea9b80c04f72c317d761715d9fdbc7"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.checkOperateSameColAndIdx (cognitive 17): ddl.checkOperateSameColAndIdx has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15, loops 2 (nesting depth added 4). Most of this is not in the body itself: 7 of the 17 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 334, 347). 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":"pkg/ddl/multi_schema_change.go"},"region":{"startLine":330}}}],"partialFingerprints":{"codehealthFindingId/v1":"7d27ba1826ba9e0e109b346550cd83e5d1be0583d8d4dab390c5ee13eafc4211"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.doPartitionReorgWork (cognitive 17): ddl.doPartitionReorgWork has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15, boolean chains 1, 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":"pkg/ddl/partition.go"},"region":{"startLine":3786}}}],"partialFingerprints":{"codehealthFindingId/v1":"f04da589f9e71d74dd24e0058e5d557a658456c8c3769c29fe4cb5282e98caeb"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.updateBackfillProgress (cognitive 17): ddl.updateBackfillProgress has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15, boolean chains 1, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/reorg.go"},"region":{"startLine":519}}}],"partialFingerprints":{"codehealthFindingId/v1":"08370017e0dc10bafa65610aa1c9a8f4cdf4cdbc92f06a34b95e94ef25008983"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.GetEngineAttributeFromStorageClassTableOptions (cognitive 17): ddl.GetEngineAttributeFromStorageClassTableOptions has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10, match/switch 4, loops 2, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/storage_class.go"},"region":{"startLine":168}}}],"partialFingerprints":{"codehealthFindingId/v1":"e4c26c6350eb9d1879fe5128d1dba4fccda1bf7f178720ed023a4f955dbb0ed3"}},{"ruleId":"D2","level":"warning","message":{"text":"bdr.IsDenied (cognitive 17): bdr.IsDenied has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, boolean chains 3, match/switch 1 (nesting depth added 7). 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":"pkg/ddl/bdr/bdr.go"},"region":{"startLine":101}}}],"partialFingerprints":{"codehealthFindingId/v1":"ec2108be55f4b64dc8903cf15aad7f2453315ab9404ab7d6891d3d6071536b5f"}},{"ruleId":"D2","level":"warning","message":{"text":"ddlCtx.addIndexWithLocalIngest (cognitive 17): ddlCtx.addIndexWithLocalIngest has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15, 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":"pkg/ddl/backfilling.go"},"region":{"startLine":740}}}],"partialFingerprints":{"codehealthFindingId/v1":"cce380da49364c82707515946cbb8c30cbad036340be23780d8de44ce4831e25"}},{"ruleId":"D2","level":"warning","message":{"text":"addIndexTxnWorker.BackfillData (cognitive 17): addIndexTxnWorker.BackfillData has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, boolean chains 2, loops 1 (nesting depth added 5). Most of this is not in the body itself: 0 of the 17 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 2858, 2919, 2848). 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":"pkg/ddl/index.go"},"region":{"startLine":2847}}}],"partialFingerprints":{"codehealthFindingId/v1":"199ea2b345dca474e6a6d17b63e8b39eda33e17276126e8123e1218cd8443626"}},{"ruleId":"D2","level":"warning","message":{"text":"ingest.CleanUpTempDir (cognitive 17): ingest.CleanUpTempDir has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, loops 3 (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":"pkg/ddl/ingest/env.go"},"region":{"startLine":130}}}],"partialFingerprints":{"codehealthFindingId/v1":"9bf22179032d7c86d67732850372851f7a0aeac6bf9a210b4e635d132bc77179"}},{"ruleId":"D2","level":"warning","message":{"text":"SchemaTracker.renameColumn (cognitive 17): SchemaTracker.renameColumn 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":"pkg/ddl/schematracker/dm_tracker.go"},"region":{"startLine":574}}}],"partialFingerprints":{"codehealthFindingId/v1":"fb5765da399f3fd9d39f441ebaeb1c9cf97b94581b257cf5e1d214fb221a368a"}},{"ruleId":"D2","level":"warning","message":{"text":"selectResult.readFromChunk (cognitive 17): selectResult.readFromChunk has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15, 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":"pkg/distsql/select_result.go"},"region":{"startLine":574}}}],"partialFingerprints":{"codehealthFindingId/v1":"b7d8550218a51eda588624de599c81a311166cc4d1bee1c56c794046e4f0c731"}},{"ruleId":"D2","level":"warning","message":{"text":"domain.getShowCreateTable (cognitive 17): domain.getShowCreateTable has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15, boolean chains 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":"pkg/domain/plan_replayer_dump.go"},"region":{"startLine":869}}}],"partialFingerprints":{"codehealthFindingId/v1":"d733e91de8150905c60d2d19b44ae810212beb19c5eaa4442b6e282f8124176d"}},{"ruleId":"D2","level":"warning","message":{"text":"domain.generateSQL (cognitive 17): domain.generateSQL has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, loops 3, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/domain/ru_stats.go"},"region":{"startLine":259}}}],"partialFingerprints":{"codehealthFindingId/v1":"31675d730da1451b5ee49e2c832f11d203f983c758cee9c2312431555a7dbba9"}},{"ruleId":"D2","level":"warning","message":{"text":"Domain.batchReadMoreData (cognitive 17): Domain.batchReadMoreData has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, match/switch 2, 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/domain/domain.go"},"region":{"startLine":1358}}}],"partialFingerprints":{"codehealthFindingId/v1":"11fa27e40f6e57e1ddbe3bdc267f0294b7b4e88c7f7124cfba7c8ac30ebe5f9f"}},{"ruleId":"D2","level":"warning","message":{"text":"parquetfile.getInt64Setter (cognitive 17): parquetfile.getInt64Setter has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, match/switch 1 (nesting depth added 9). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 259, 276, 248). 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":"pkg/dumpformat/parquetfile/type_converter.go"},"region":{"startLine":232}}}],"partialFingerprints":{"codehealthFindingId/v1":"68ec2175ea1bdc554e041bc30ac15002e3c01cea3b4179474fbb63801dec5405"}},{"ruleId":"D2","level":"warning","message":{"text":"executor.prepareColumns (cognitive 17): executor.prepareColumns has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, loops 3, boolean chains 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":"pkg/executor/analyze_col.go"},"region":{"startLine":146}}}],"partialFingerprints":{"codehealthFindingId/v1":"641544fefcd4cb183fd9e8fcec8f661896783afe01b021d0f354cb646f11baf2"}},{"ruleId":"D2","level":"warning","message":{"text":"executor.getKeysNeedCheck (cognitive 17): executor.getKeysNeedCheck has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, 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":"pkg/executor/batch_checker.go"},"region":{"startLine":56}}}],"partialFingerprints":{"codehealthFindingId/v1":"768283f804f070fe249274eda225879f6dc60b0cca7d3285ae838d0bd2db3653"}},{"ruleId":"D2","level":"warning","message":{"text":"executor.verifyIndexSideQuery (cognitive 17): executor.verifyIndexSideQuery has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, boolean chains 3, 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/executor/check_table_index.go"},"region":{"startLine":415}}}],"partialFingerprints":{"codehealthFindingId/v1":"09a4f2dc0186725e763865042dbdcfffc542ba7111c5a63b78163bc025b50ac0"}},{"ruleId":"D2","level":"warning","message":{"text":"executor.loadBindings (cognitive 17): executor.loadBindings has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15, boolean chains 1, loops 1 (nesting depth added 7). Of this number, 14 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":"pkg/executor/plan_replayer.go"},"region":{"startLine":483}}}],"partialFingerprints":{"codehealthFindingId/v1":"9b60f6641c3c935b4ed293369682a85b1971d79f0bd022dcda76868065326560"}},{"ruleId":"D2","level":"warning","message":{"text":"executor.getUserPasswordLimit (cognitive 17): executor.getUserPasswordLimit has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/simple.go"},"region":{"startLine":1355}}}],"partialFingerprints":{"codehealthFindingId/v1":"ec00342e42ed3b5f4168c4260040ba1f3bf2cbee93f8c9f26e94fa6893d421ff"}},{"ruleId":"D2","level":"warning","message":{"text":"executor.findMatchedRightBracket (cognitive 17): executor.findMatchedRightBracket has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15, boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/slow_query.go"},"region":{"startLine":813}}}],"partialFingerprints":{"codehealthFindingId/v1":"4343330b65cf64ad5dfa1432d2e569ce2096c96882ca7bfdd82f0f65ebcc729d"}},{"ruleId":"D2","level":"warning","message":{"text":"ExecStmt.PointGet (cognitive 17): ExecStmt.PointGet has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15, boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/adapter.go"},"region":{"startLine":398}}}],"partialFingerprints":{"codehealthFindingId/v1":"643abb4e498778dc244f81796058c4082502c74402d036676991423f73f1056c"}},{"ruleId":"D2","level":"warning","message":{"text":"groupConcat.UpdatePartialResult (cognitive 17): groupConcat.UpdatePartialResult has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, loops 3 (nesting depth added 7). Of this number, 16 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":"pkg/executor/aggfuncs/func_group_concat.go"},"region":{"startLine":249}}}],"partialFingerprints":{"codehealthFindingId/v1":"6bd2ad4a6a8b0ef1f2fd50873d5f004396b1e02e0ae485ff465460e32b470686"}},{"ruleId":"D2","level":"warning","message":{"text":"AnalyzeColumnsExec.analyzeColumnsPushDown (cognitive 17): AnalyzeColumnsExec.analyzeColumnsPushDown has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, loops 3, boolean chains 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":"pkg/executor/analyze_col_sampling.go"},"region":{"startLine":53}}}],"partialFingerprints":{"codehealthFindingId/v1":"7bc0fd3299b766e030f4afbdf9c4e34d53c05c7caa69ff2eed152d9f7e721500"}},{"ruleId":"D2","level":"warning","message":{"text":"analyzeSaveStatsWorker.run (cognitive 17): analyzeSaveStatsWorker.run has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, loops 1 (nesting depth added 8). Of this number, 14 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":"pkg/executor/analyze_worker.go"},"region":{"startLine":51}}}],"partialFingerprints":{"codehealthFindingId/v1":"f891507035f7b9d88af484da2b57733fa79f01a3ab815c34e6f7b8013e3166d0"}},{"ruleId":"D2","level":"warning","message":{"text":"executorBuilder.buildIndexLookUpMergeJoin (cognitive 17): executorBuilder.buildIndexLookUpMergeJoin has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, loops 4, 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":"pkg/executor/builder.go"},"region":{"startLine":3653}}}],"partialFingerprints":{"codehealthFindingId/v1":"98e972f70cd2c566ed9fe138f79d98fcfdb994fdf59c56530c1e6a27a174e04d"}},{"ruleId":"D2","level":"warning","message":{"text":"dataReaderBuilder.buildIndexLookUpReaderForIndexJoin (cognitive 17): dataReaderBuilder.buildIndexLookUpReaderForIndexJoin has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/builder.go"},"region":{"startLine":5349}}}],"partialFingerprints":{"codehealthFindingId/v1":"827313b27a1a557b450a3c7334bcffac76dd504964e2c8a1a9d3479bb318b7a6"}},{"ruleId":"D2","level":"warning","message":{"text":"DDLExec.getRecoverDBByName (cognitive 17): DDLExec.getRecoverDBByName has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, loops 1 (nesting depth added 6). Most of this is not in the body itself: 6 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 678). 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":"pkg/executor/ddl.go"},"region":{"startLine":668}}}],"partialFingerprints":{"codehealthFindingId/v1":"940737e1d7b4231b22c40a26462f8033f4dba10396d38fe13eb5ed283657517a"}},{"ruleId":"D2","level":"warning","message":{"text":"DistributeTableExec.getKeyRanges (cognitive 17): DistributeTableExec.getKeyRanges has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10, loops 6, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/distribute.go"},"region":{"startLine":178}}}],"partialFingerprints":{"codehealthFindingId/v1":"22d597019f4047a253e1b590600e38998b4475c4b32d58911d0e01fff4d4989b"}},{"ruleId":"D2","level":"warning","message":{"text":"IndexLookUpExecutor.getHandle (cognitive 17): IndexLookUpExecutor.getHandle has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, loops 2, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/distsql.go"},"region":{"startLine":1887}}}],"partialFingerprints":{"codehealthFindingId/v1":"e295ab128a3ab495bb2c167d527e72cdc94c14607ca28320c12bc746be1b8118"}},{"ruleId":"D2","level":"warning","message":{"text":"FKCheckExec.getIndexKeyValueInTable (cognitive 17): FKCheckExec.getIndexKeyValueInTable has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, loops 2, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/foreign_key.go"},"region":{"startLine":426}}}],"partialFingerprints":{"codehealthFindingId/v1":"dfd72ae8f4c5ea415d0964c7f5164d49644627ff0e3c7f42902a1db9d54e071e"}},{"ruleId":"D2","level":"warning","message":{"text":"LoadDataController.checkFieldParams (cognitive 17): LoadDataController.checkFieldParams has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, boolean chains 5 (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":"pkg/executor/importer/import.go"},"region":{"startLine":709}}}],"partialFingerprints":{"codehealthFindingId/v1":"d21446a5be182436aaab7a809adff119c7f1b8ac68bbc345d68ef7eebdd8b795"}},{"ruleId":"D2","level":"warning","message":{"text":"InsertValues.removeRow (cognitive 17): InsertValues.removeRow has cognitive complexity 17 (threshold 15). Drivers by points: if/else 17 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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":"pkg/executor/insert_common.go"},"region":{"startLine":1383}}}],"partialFingerprints":{"codehealthFindingId/v1":"ed18bf227c78c7d6035dcbc213d004cbc9cd8a2021c0d9381ce362edfcb71bc2"}},{"ruleId":"D2","level":"warning","message":{"text":"antiSemiJoinProbe.probeForLeftSideBuildNoOtherCondition (cognitive 17): antiSemiJoinProbe.probeForLeftSideBuildNoOtherCondition has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, 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":"pkg/executor/join/anti_semi_join_probe.go"},"region":{"startLine":191}}}],"partialFingerprints":{"codehealthFindingId/v1":"bbfe93b6c06314ef1841dc82a64f9f7fb1353ae7e1cd1a86b653976320659a98"}},{"ruleId":"D2","level":"warning","message":{"text":"probeSideTupleFetcherBase.fetchProbeSideChunks (cognitive 17): probeSideTupleFetcherBase.fetchProbeSideChunks has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, loops 1 (nesting depth added 9). Of this number, 14 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":"pkg/executor/join/hash_join_base.go"},"region":{"startLine":161}}}],"partialFingerprints":{"codehealthFindingId/v1":"55351f5602e3bcb4af95bd3f0e76e98e6231b8254f1dc52ec6529010f05e7d8c"}},{"ruleId":"D2","level":"warning","message":{"text":"hashJoinSpillHelper.close (cognitive 17): hashJoinSpillHelper.close has cognitive complexity 17 (threshold 15). Drivers by points: loops 11, if/else 6 (nesting depth added 8). 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":"pkg/executor/join/hash_join_spill_helper.go"},"region":{"startLine":128}}}],"partialFingerprints":{"codehealthFindingId/v1":"c19fbe020100c6fa17c9ce233fe0ca58db3c7b198cbd5b5608f8acacb4420cb4"}},{"ruleId":"D2","level":"warning","message":{"text":"hashJoinSpillHelper.spillSegmentsToDiskImpl (cognitive 17): hashJoinSpillHelper.spillSegmentsToDiskImpl has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, loops 3 (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/executor/join/hash_join_spill_helper.go"},"region":{"startLine":336}}}],"partialFingerprints":{"codehealthFindingId/v1":"87634303d876c37f0e6735cc5925e8e12f479bc8f8c39af7942f9573e48a4429"}},{"ruleId":"D2","level":"warning","message":{"text":"hashJoinSpillHelper.prepareForRestoring (cognitive 17): hashJoinSpillHelper.prepareForRestoring has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, loops 4, boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/join/hash_join_spill_helper.go"},"region":{"startLine":533}}}],"partialFingerprints":{"codehealthFindingId/v1":"81569b7e32541847c3b233ab363357ac879e91d4065716a9f88cf03f5b7bc1be"}},{"ruleId":"D2","level":"warning","message":{"text":"ProbeWorkerV1.joinMatchedProbeSideRow2Chunk (cognitive 17): ProbeWorkerV1.joinMatchedProbeSideRow2Chunk has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, boolean chains 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/join/hash_join_v1.go"},"region":{"startLine":777}}}],"partialFingerprints":{"codehealthFindingId/v1":"209a318da1668ca9af706a3e4baa7e7404426523c68fba220c4b4b4e93d62d40"}},{"ruleId":"D2","level":"warning","message":{"text":"ProbeWorkerV2.restoreAndProbe (cognitive 17): ProbeWorkerV2.restoreAndProbe has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, boolean chains 3, match/switch 2, 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":"pkg/executor/join/hash_join_v2.go"},"region":{"startLine":358}}}],"partialFingerprints":{"codehealthFindingId/v1":"72f1923885cf4cdb9cab768fcbfe3445224dcb8d22293206ae5e9044c587cce2"}},{"ruleId":"D2","level":"warning","message":{"text":"ProbeWorkerV2.runJoinWorker (cognitive 17): ProbeWorkerV2.runJoinWorker has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, boolean chains 3, match/switch 2, 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":"pkg/executor/join/hash_join_v2.go"},"region":{"startLine":970}}}],"partialFingerprints":{"codehealthFindingId/v1":"7b032cc9205b73b2639e799f17c79b90af0bf692458bcce753aa7ba73f93ca92"}},{"ruleId":"D2","level":"warning","message":{"text":"HashContext.InitHash (cognitive 17): HashContext.InitHash has cognitive complexity 17 (threshold 15). Drivers by points: loops 10, if/else 7 (nesting depth added 7). 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":"pkg/executor/join/hash_table_v1.go"},"region":{"startLine":51}}}],"partialFingerprints":{"codehealthFindingId/v1":"65a642166c3ecb268bd7c4036fc32927228c43d83e64063948e5d6e35b2e9d84"}},{"ruleId":"D2","level":"warning","message":{"text":"indexHashJoinOuterWorker.run (cognitive 17): indexHashJoinOuterWorker.run has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, loops 1 (nesting depth added 9). Of this number, 15 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":"pkg/executor/join/index_lookup_hash_join.go"},"region":{"startLine":374}}}],"partialFingerprints":{"codehealthFindingId/v1":"6f464d4a6dc64d56b0f79c30d8e5e842488ef73662a0199305d1b965b0f6e081"}},{"ruleId":"D2","level":"warning","message":{"text":"innerWorker.fetchInnerResults (cognitive 17): innerWorker.fetchInnerResults has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, boolean chains 2, match/switch 2, loops 1 (nesting depth added 5). Of this number, 15 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":"pkg/executor/join/index_lookup_join.go"},"region":{"startLine":739}}}],"partialFingerprints":{"codehealthFindingId/v1":"fbd1133834efcac495fc29014e2a4e3b109f95d49fdf5f54da6d8ba9ff26b6b9"}},{"ruleId":"D2","level":"warning","message":{"text":"innerJoinProbe.Probe (cognitive 17): innerJoinProbe.Probe has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, boolean chains 2, 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":"pkg/executor/join/inner_join_probe.go"},"region":{"startLine":27}}}],"partialFingerprints":{"codehealthFindingId/v1":"ef367c1875d9a1e31ed5ec5a80d967473b21990d85fefd7e56dbe1169520713b"}},{"ruleId":"D2","level":"warning","message":{"text":"TopNExec.GenerateTopNResultsWhenSpillOnlyOnce (cognitive 17): TopNExec.GenerateTopNResultsWhenSpillOnlyOnce has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, loops 3, match/switch 3 (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/executor/sortexec/topn.go"},"region":{"startLine":767}}}],"partialFingerprints":{"codehealthFindingId/v1":"16c46a42fd069cad89eb947f64a3041aac966cd96bd41b9e0f65c7ea1bb64783"}},{"ruleId":"D2","level":"warning","message":{"text":"UpdateExec.mergeGenerated (cognitive 17): UpdateExec.mergeGenerated has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, 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/executor/update.go"},"region":{"startLine":192}}}],"partialFingerprints":{"codehealthFindingId/v1":"12ba059149d6eb7c5aef309f17b6e54ef49dc5622f8002e8bb5296c979f678d0"}},{"ruleId":"D2","level":"warning","message":{"text":"expression.setFlenDecimal4RealOrDecimal (cognitive 17): expression.setFlenDecimal4RealOrDecimal has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, boolean chains 3 (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":"pkg/expression/builtin_arithmetic.go"},"region":{"startLine":106}}}],"partialFingerprints":{"codehealthFindingId/v1":"92ae8d342efd5f42dc7941cc7c2d5a7c92d203782ecf532620a42fdf5861ce64"}},{"ruleId":"D2","level":"warning","message":{"text":"expression.caseWhenHandler (cognitive 17): expression.caseWhenHandler has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, boolean chains 4, 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/expression/constant_fold.go"},"region":{"startLine":120}}}],"partialFingerprints":{"codehealthFindingId/v1":"a74d4a85778d6b764444d8ad8bea32ef5604956d372c6a1c4459cb70e2a685b0"}},{"ruleId":"D2","level":"warning","message":{"text":"expression.scalarExprSupportedByTiKV (cognitive 17): expression.scalarExprSupportedByTiKV has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, match/switch 5, boolean chains 3 (nesting depth added 7). 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":"pkg/expression/infer_pushdown.go"},"region":{"startLine":186}}}],"partialFingerprints":{"codehealthFindingId/v1":"c4e3c7a34b21a9c298b1225eb0beb3c33738ad86cf5ef8d0e89ce8d9c26f8ba5"}},{"ruleId":"D2","level":"warning","message":{"text":"expression.typeInferForNull (cognitive 17): expression.typeInferForNull has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8, boolean chains 7, loops 2 (nesting depth added 3). Of this number, 16 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":"pkg/expression/scalar_function.go"},"region":{"startLine":168}}}],"partialFingerprints":{"codehealthFindingId/v1":"02108b69145119cb812bb5fc1358d0e5bfffc2ef7ddfb0788c598b2110a0f532"}},{"ruleId":"D2","level":"warning","message":{"text":"expression.GetUsedList (cognitive 17): expression.GetUsedList has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10, loops 5, boolean chains 2 (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/expression/schema.go"},"region":{"startLine":338}}}],"partialFingerprints":{"codehealthFindingId/v1":"1202d0358fe2a093c9b5c4a54091e27afc2d2c65340df20f4121419d4899d1a1"}},{"ruleId":"D2","level":"warning","message":{"text":"expression.FindUpperBound (cognitive 17): expression.FindUpperBound has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15, boolean chains 2 (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/expression/util.go"},"region":{"startLine":316}}}],"partialFingerprints":{"codehealthFindingId/v1":"0490b223ce0155fe4819050dc1b8b98ec772be624e7aa2c31e0b7281f29f9ed6"}},{"ruleId":"D2","level":"warning","message":{"text":"arithmeticMinusFunctionClass.getFunction (cognitive 17): arithmeticMinusFunctionClass.getFunction has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, boolean chains 5 (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":"pkg/expression/builtin_arithmetic.go"},"region":{"startLine":341}}}],"partialFingerprints":{"codehealthFindingId/v1":"df67aee06ab4009950a82f0d0a1a8698e648e8a2df55f564f68187e3e8496ae6"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinCastDecimalAsRealSig.vecEvalReal (cognitive 17): builtinCastDecimalAsRealSig.vecEvalReal has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, boolean chains 2, 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":"pkg/expression/builtin_cast_vec.go"},"region":{"startLine":1433}}}],"partialFingerprints":{"codehealthFindingId/v1":"cae2e112ebd0a2784f4843ba4ab375c761e130b9887ec5bfc074de37eb9145ea"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinCastStringAsIntSig.evalInt (cognitive 17): builtinCastStringAsIntSig.evalInt has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, boolean chains 6 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/builtin_cast.go"},"region":{"startLine":1782}}}],"partialFingerprints":{"codehealthFindingId/v1":"571c697ef6f7c70b05957e293d3b9c8e9b4db7817c29b06cc05506887f99bcc5"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinGreatestStringSig.vecEvalString (cognitive 17): builtinGreatestStringSig.vecEvalString has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, loops 3, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/builtin_compare_vec.go"},"region":{"startLine":761}}}],"partialFingerprints":{"codehealthFindingId/v1":"f7325adb6210d3558c444d4429fa5c2f2a845444333f4a32bef0cbbf366dc7c7"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinLeastStringSig.vecEvalString (cognitive 17): builtinLeastStringSig.vecEvalString has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, loops 3, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/builtin_compare_vec.go"},"region":{"startLine":237}}}],"partialFingerprints":{"codehealthFindingId/v1":"25e26719c16b97cc5943d4f22108a703340bba25c7a568aef83ab205ff7f601d"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinAesEncryptSig.vecEvalString (cognitive 17): builtinAesEncryptSig.vecEvalString has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, boolean chains 2, 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":"pkg/expression/builtin_encryption_vec.go"},"region":{"startLine":650}}}],"partialFingerprints":{"codehealthFindingId/v1":"138a117a8a12558878fa512001ea4abb8ee01b8bf3224199c91380f56ce66732"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinTiDBMVCCInfoSig.evalString (cognitive 17): builtinTiDBMVCCInfoSig.evalString has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, boolean chains 4 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/builtin_info.go"},"region":{"startLine":959}}}],"partialFingerprints":{"codehealthFindingId/v1":"933c68288dfbb6c44d347267925ca04f4281b6e9622d717704d9df0aac685ea7"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinJSONSumCRC32Sig.vecEvalInt (cognitive 17): builtinJSONSumCRC32Sig.vecEvalInt has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, loops 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/builtin_json_vec.go"},"region":{"startLine":924}}}],"partialFingerprints":{"codehealthFindingId/v1":"b6a1914214717f44b3a46c48ea47beb69d53a25a15392bbe2fca0bca8f1c2895"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinJSONContainsPathSig.evalInt (cognitive 17): builtinJSONContainsPathSig.evalInt has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 7, if/else 7, match/switch 2, loops 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":"pkg/expression/builtin_json.go"},"region":{"startLine":850}}}],"partialFingerprints":{"codehealthFindingId/v1":"2f363edfc3376914c46c7b6b6f4f22e6b354e10745393d1ed4032931c116482d"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinJSONMemberOfSig.vecEvalInt (cognitive 17): builtinJSONMemberOfSig.vecEvalInt has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, loops 4 (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":"pkg/expression/builtin_json_vec.go"},"region":{"startLine":281}}}],"partialFingerprints":{"codehealthFindingId/v1":"581e2434506e9d1a3103e862eb656ef41ecfb151eccee922d7a1eb9cd5969f6f"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinJSONMergePatchSig.vecEvalJSON (cognitive 17): builtinJSONMergePatchSig.vecEvalJSON has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, loops 4 (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":"pkg/expression/builtin_json_vec.go"},"region":{"startLine":1409}}}],"partialFingerprints":{"codehealthFindingId/v1":"1d135e013909c0c2f8b5de02dec307666a02779d366a4e5dfd84d9c1dd972ea9"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinSleepSig.vecEvalInt (cognitive 17): builtinSleepSig.vecEvalInt has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, loops 4, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/builtin_miscellaneous_vec.go"},"region":{"startLine":436}}}],"partialFingerprints":{"codehealthFindingId/v1":"fedb22740863476d39ecf76d6e15132691c1ee8c356ce4c42bae9ce84a72d559"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinInetAtonSig.evalInt (cognitive 17): builtinInetAtonSig.evalInt has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, boolean chains 3, loops 1, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/builtin_miscellaneous.go"},"region":{"startLine":607}}}],"partialFingerprints":{"codehealthFindingId/v1":"19e95d54474d45c78e62fc0e51b72e4c80de90bc678733f205349e0e21a6a315"}},{"ruleId":"D2","level":"warning","message":{"text":"inFunctionClass.getFunction (cognitive 17): inFunctionClass.getFunction has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, loops 2, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/builtin_other.go"},"region":{"startLine":89}}}],"partialFingerprints":{"codehealthFindingId/v1":"8d843334477a7c804ed9e160d3c7c408db1d7dbafe99a5aa7477709997a6a00c"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinSubstringIndexSig.evalString (cognitive 17): builtinSubstringIndexSig.evalString has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, boolean chains 4 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/builtin_string.go"},"region":{"startLine":1447}}}],"partialFingerprints":{"codehealthFindingId/v1":"5a764573f4f1d669279d7b2d37a8f51703be2fadfe4a5f5f61ba7d0e63e3946a"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinExportSet5ArgSig.vecEvalString (cognitive 17): builtinExportSet5ArgSig.vecEvalString has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, boolean chains 2, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/builtin_string_vec.go"},"region":{"startLine":1965}}}],"partialFingerprints":{"codehealthFindingId/v1":"fe66a32532d4425189bcf3653ebc1c476e2a413b5c9fcacedfc881102e89c846"}},{"ruleId":"D2","level":"warning","message":{"text":"Constant.Eval (cognitive 17): Constant.Eval has cognitive complexity 17 (threshold 15). Drivers by points: if/else 17 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/constant.go"},"region":{"startLine":331}}}],"partialFingerprints":{"codehealthFindingId/v1":"46eb99dad8ff6c07de54e86fa5565e4c8421e6be57cbb66ff124d835df379b5c"}},{"ruleId":"D2","level":"warning","message":{"text":"GroupingSets.MergeOne (cognitive 17): GroupingSets.MergeOne has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, 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":"pkg/expression/grouping_sets.go"},"region":{"startLine":86}}}],"partialFingerprints":{"codehealthFindingId/v1":"a84bf7abcaaebf29db830d9e6343f5b945b35240a0b9eb678466f85af12666af"}},{"ruleId":"D2","level":"warning","message":{"text":"sqlGenerator.buildOptions (cognitive 17): sqlGenerator.buildOptions has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, boolean chains 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":"pkg/importsdk/sql_generator.go"},"region":{"startLine":80}}}],"partialFingerprints":{"codehealthFindingId/v1":"e2930c461c5f2b71476e81d499c8be705a1192a6bdecf1e423fcc3f9f9461c51"}},{"ruleId":"D2","level":"warning","message":{"text":"inference.appendOptionType (cognitive 17): inference.appendOptionType has cognitive complexity 17 (threshold 15). Drivers by points: loops 8, if/else 7, boolean chains 1, match/switch 1 (nesting depth added 7). 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":"pkg/inference/sqlembed.go"},"region":{"startLine":438}}}],"partialFingerprints":{"codehealthFindingId/v1":"1b83b018679f33eed438f4263855fc20f70a249a869ff25da2b666dd1d8cd073"}},{"ruleId":"D2","level":"warning","message":{"text":"infoschema.getMicroServiceServerInfo (cognitive 17): infoschema.getMicroServiceServerInfo has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, loops 3, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/infoschema/tables.go"},"region":{"startLine":2182}}}],"partialFingerprints":{"codehealthFindingId/v1":"fad060dfbb24956ec8dec51141862bca11083a982c5ba5c44cbd3a1509fa89b6"}},{"ruleId":"D2","level":"warning","message":{"text":"InfoCache.Insert (cognitive 17): InfoCache.Insert has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, 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":"pkg/infoschema/cache.go"},"region":{"startLine":306}}}],"partialFingerprints":{"codehealthFindingId/v1":"cb521725a89531f0f5e2e9ee1e9a6c73bda92a3eae1adc69120c5c1a14112120"}},{"ruleId":"D2","level":"warning","message":{"text":"dispatcher.run (cognitive 17): dispatcher.run has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, match/switch 4, 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/ingestor/ingestctrl/region_job.go"},"region":{"startLine":962}}}],"partialFingerprints":{"codehealthFindingId/v1":"f4dff16710aadf1d313b2935efc4631f37c85bdcb52742f56ef72bcad2566287"}},{"ruleId":"D2","level":"warning","message":{"text":"simplesst.openAndGetFirstElem (cognitive 17): simplesst.openAndGetFirstElem has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, loops 3 (nesting depth added 7). 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, 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/ingestor/simplesst/iter.go"},"region":{"startLine":116}}}],"partialFingerprints":{"codehealthFindingId/v1":"dc9ebe5440ebf33384f3be0a88c19e6cda494ba54d3461039c7a657dbe7deb75"}},{"ruleId":"D2","level":"warning","message":{"text":"Lightning.adjust (cognitive 17): Lightning.adjust has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction \u2014 a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full \u2014 so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/lightning/config/config.go"},"region":{"startLine":350}}}],"partialFingerprints":{"codehealthFindingId/v1":"2f3784a0af75212e68071254068b3e1bdbeea69be53adccb4e4c5b53bbb71660"}},{"ruleId":"D2","level":"warning","message":{"text":"cardinality.GetAvgRowSize (cognitive 17): cardinality.GetAvgRowSize has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10, boolean chains 5, 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":"pkg/planner/cardinality/row_size.go"},"region":{"startLine":63}}}],"partialFingerprints":{"codehealthFindingId/v1":"1d1d3621da285ed52e20a7950e47f3d6ff0a1a44bb72159d4b7773b9e929a918"}},{"ruleId":"D2","level":"warning","message":{"text":"Optimizer.exploreGroup (cognitive 17): Optimizer.exploreGroup has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, loops 6 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/cascades/old/optimize.go"},"region":{"startLine":140}}}],"partialFingerprints":{"codehealthFindingId/v1":"bdef5107a8136958c64cf7a549fe25b13b44637a4362fa95a786311c7f33ce3d"}},{"ruleId":"D2","level":"warning","message":{"text":"InjectProjectionBelowAgg.OnTransform (cognitive 17): InjectProjectionBelowAgg.OnTransform has cognitive complexity 17 (threshold 15). Drivers by points: loops 8, match/switch 5, boolean chains 3, if/else 1 (nesting depth added 5). 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":"pkg/planner/cascades/old/transformation_rules.go"},"region":{"startLine":2366}}}],"partialFingerprints":{"codehealthFindingId/v1":"51759da6f13e6831836bccb08f87e27ce373c2e822b5ac865b3de0bf1c945ba3"}},{"ruleId":"D2","level":"warning","message":{"text":"core.getOperatorInfo (cognitive 17): core.getOperatorInfo has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15, boolean chains 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":"pkg/planner/core/common_plans.go"},"region":{"startLine":1132}}}],"partialFingerprints":{"codehealthFindingId/v1":"94ced6257898563fe3b91fbb10abc3627a6eb6f1362aa885bb5bbb0baca2a1f4"}},{"ruleId":"D2","level":"warning","message":{"text":"core.IsPointGetWithPKOrUniqueKeyByAutoCommit (cognitive 17): core.IsPointGetWithPKOrUniqueKeyByAutoCommit has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, boolean chains 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":"pkg/planner/core/common_plans.go"},"region":{"startLine":1421}}}],"partialFingerprints":{"codehealthFindingId/v1":"de9a001f9027dd7298fb9ca7d2c8396a3b688ccf08c88a06dd3fd84828e0a012"}},{"ruleId":"D2","level":"warning","message":{"text":"core.recordIndexJoinHintWarnings (cognitive 17): core.recordIndexJoinHintWarnings has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, boolean chains 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":"pkg/planner/core/exhaust_physical_plans.go"},"region":{"startLine":1428}}}],"partialFingerprints":{"codehealthFindingId/v1":"2e423e329f93b5c70bf35992a91a9e7a058e181cf1d787becd7bcb33dcd025d6"}},{"ruleId":"D2","level":"warning","message":{"text":"core.isNoDecorrelate (cognitive 17): core.isNoDecorrelate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, boolean chains 4 (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":"pkg/planner/core/expression_rewriter.go"},"region":{"startLine":1497}}}],"partialFingerprints":{"codehealthFindingId/v1":"b06d782c02db34ea6c6c8b7572f37561ba610d4305c61cc7122a29c9af6c1dcd"}},{"ruleId":"D2","level":"warning","message":{"text":"core.pruneAndBuildSingleTableColPosInfoForDelete (cognitive 17): core.pruneAndBuildSingleTableColPosInfoForDelete has cognitive complexity 17 (threshold 15). Drivers by points: loops 9, if/else 7, boolean chains 1 (nesting depth added 6). 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":"pkg/planner/core/logical_plan_builder.go"},"region":{"startLine":5971}}}],"partialFingerprints":{"codehealthFindingId/v1":"cfa0bee20da8f6989c3bc08807a1a04ad0c7c0a4f8c0e7079c24361dbf66f52c"}},{"ruleId":"D2","level":"warning","message":{"text":"core.getPlanCostVer14PhysicalTableReader (cognitive 17): core.getPlanCostVer14PhysicalTableReader has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, boolean chains 2, match/switch 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":"pkg/planner/core/plan_cost_ver1.go"},"region":{"startLine":244}}}],"partialFingerprints":{"codehealthFindingId/v1":"e805b1f620dbcbcd32d60c868d822b2044a0324d527c7a39f738a0c1797b8b87"}},{"ruleId":"D2","level":"warning","message":{"text":"core.isTableAliasDuplicate (cognitive 17): core.isTableAliasDuplicate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, 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":"pkg/planner/core/preprocess.go"},"region":{"startLine":1158}}}],"partialFingerprints":{"codehealthFindingId/v1":"a47bb636b7ee2c0779cc338dd4470cbe572438a1497979e95d53114c31b95c8b"}},{"ruleId":"D2","level":"warning","message":{"text":"core.resetStatsForCorrelatedDS (cognitive 17): core.resetStatsForCorrelatedDS has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, 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":"pkg/planner/core/rule_correlate.go"},"region":{"startLine":301}}}],"partialFingerprints":{"codehealthFindingId/v1":"58f98d4361275c635d48f6ac8c9b5d570af40899a855eff3d0a6c8262947762a"}},{"ruleId":"D2","level":"warning","message":{"text":"tidbCodecFuncHelper.encodeIndexKeyFromRow (cognitive 17): tidbCodecFuncHelper.encodeIndexKeyFromRow has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, boolean chains 3, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/expression_codec_fn.go"},"region":{"startLine":168}}}],"partialFingerprints":{"codehealthFindingId/v1":"4bea7a9b1c076b1ed5dd103201b56bb62b39674c8d6518e214a5d64b3105a1fb"}},{"ruleId":"D2","level":"warning","message":{"text":"joinorder.optimizeRecursive (cognitive 17): joinorder.optimizeRecursive has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, loops 3, boolean chains 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":"pkg/planner/core/joinorder/join_order.go"},"region":{"startLine":237}}}],"partialFingerprints":{"codehealthFindingId/v1":"94890bc15d0f7de06313398e8fe6db0761740358dce5035af54a3d6c0374f531"}},{"ruleId":"D2","level":"warning","message":{"text":"correlatedAggregateResolver.resolveSelect (cognitive 17): correlatedAggregateResolver.resolveSelect has cognitive complexity 17 (threshold 15). Drivers by points: if/else 17 (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":"pkg/planner/core/logical_plan_builder.go"},"region":{"startLine":3163}}}],"partialFingerprints":{"codehealthFindingId/v1":"66a1e8cece561a214225854c3b2f3ed41b7febaaa9900a501c9107a4103961c2"}},{"ruleId":"D2","level":"warning","message":{"text":"InfoSchemaBaseExtractor.Extract (cognitive 17): InfoSchemaBaseExtractor.Extract has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, loops 4 (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/planner/core/memtable_infoschema_extractor.go"},"region":{"startLine":189}}}],"partialFingerprints":{"codehealthFindingId/v1":"d3e40b6eea145ecf499dff78768d3fe10a3b494a90266064122721b7f83eb859"}},{"ruleId":"D2","level":"warning","message":{"text":"InfoSchemaTiDBIndexUsageExtractor.ListIndexes (cognitive 17): InfoSchemaTiDBIndexUsageExtractor.ListIndexes has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8, loops 6, boolean chains 2, jumps 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":"pkg/planner/core/memtable_infoschema_extractor.go"},"region":{"startLine":998}}}],"partialFingerprints":{"codehealthFindingId/v1":"0e0c24585748b4228f2a9cb31d4b702c0ec6e099d2289c92a43bab94e0e9fa8a"}},{"ruleId":"D2","level":"warning","message":{"text":"LogicalExpand.GenLevelProjections (cognitive 17): LogicalExpand.GenLevelProjections has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, loops 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/operator/logicalop/logical_expand.go"},"region":{"startLine":189}}}],"partialFingerprints":{"codehealthFindingId/v1":"4c7d19278c65eee95d93f2ebe24f840192e45b6132a71603892d7f8170c9df03"}},{"ruleId":"D2","level":"warning","message":{"text":"BatchPointGetPlan.OperatorInfo (cognitive 17): BatchPointGetPlan.OperatorInfo has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, loops 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":"pkg/planner/core/operator/physicalop/physical_batch_point_get.go"},"region":{"startLine":641}}}],"partialFingerprints":{"codehealthFindingId/v1":"c68c889584ca157969ae59dcf7c2e796f09feb6946d37fd5ec371026ebbca39e"}},{"ruleId":"D2","level":"warning","message":{"text":"Insert.ResolveIndices (cognitive 17): Insert.ResolveIndices 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":"pkg/planner/core/operator/physicalop/physical_common_plans.go"},"region":{"startLine":366}}}],"partialFingerprints":{"codehealthFindingId/v1":"f955ceb6aa9cef4d7c4d48e0b18602ebf117a8869b6e488523b2cbb2a2f4109c"}},{"ruleId":"D2","level":"warning","message":{"text":"Delete.BuildOnDeleteFKTriggers (cognitive 17): Delete.BuildOnDeleteFKTriggers has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, loops 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":"pkg/planner/core/operator/physicalop/foreign_key.go"},"region":{"startLine":288}}}],"partialFingerprints":{"codehealthFindingId/v1":"d9b13a8413a3ef8e2c6c5b0db156660d7ca9fe2397b876cb3703bee654599855"}},{"ruleId":"D2","level":"warning","message":{"text":"PlanBuilder.buildLateralJoin (cognitive 17): PlanBuilder.buildLateralJoin has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, loops 4, match/switch 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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":"pkg/planner/core/logical_plan_builder.go"},"region":{"startLine":962}}}],"partialFingerprints":{"codehealthFindingId/v1":"d79ef247c2b4da48e78828b4b7c7c3db7e2b609f4d4903a9ff0bc37b10a5c1ac"}},{"ruleId":"D2","level":"warning","message":{"text":"PlanBuilder.buildValuesListOfInsert (cognitive 17): PlanBuilder.buildValuesListOfInsert has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, loops 3, boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/planbuilder.go"},"region":{"startLine":4339}}}],"partialFingerprints":{"codehealthFindingId/v1":"f73c33813946da4c98c01965404bd6746c41375053b7fc8c5c8a4aeb06b65568"}},{"ruleId":"D2","level":"warning","message":{"text":"rule.pruneIndexesForDataSource (cognitive 17): rule.pruneIndexesForDataSource has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, loops 4, boolean chains 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":"pkg/planner/core/rule/rule_collect_plan_stats.go"},"region":{"startLine":225}}}],"partialFingerprints":{"codehealthFindingId/v1":"d25dc21c97592739d93f0e0a4ef4073739f958a444e1cf30fc17a0d31677fe1d"}},{"ruleId":"D2","level":"warning","message":{"text":"rule.unsatisfiable (cognitive 17): rule.unsatisfiable has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, boolean chains 5 (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":"pkg/planner/core/rule/rule_predicate_simplification.go"},"region":{"startLine":285}}}],"partialFingerprints":{"codehealthFindingId/v1":"aef4d9b43c001a99317cddba32d0cbddf1f666ce76c73ef9201ff082f76bbdfd"}},{"ruleId":"D2","level":"warning","message":{"text":"PartitionProcessor.findUsedListPartitions (cognitive 17): PartitionProcessor.findUsedListPartitions has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, loops 3, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/rule/rule_partition_processor.go"},"region":{"startLine":823}}}],"partialFingerprints":{"codehealthFindingId/v1":"36850f152e35d5a0b423971ea567c2ec463da0aa92b2afec2e8de9c3c39322fe"}},{"ruleId":"D2","level":"warning","message":{"text":"RangeColumnsPruner.partitionRangeForExpr (cognitive 17): RangeColumnsPruner.partitionRangeForExpr has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, boolean chains 5, match/switch 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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":"pkg/planner/core/rule/rule_partition_processor.go"},"region":{"startLine":2011}}}],"partialFingerprints":{"codehealthFindingId/v1":"1675d89b4c4620b8a8a00ccd8fc33e49ff06a83d689bfdce0afacedfd8b9a2c8"}},{"ruleId":"D2","level":"warning","message":{"text":"AggregationPushDownSolver.collectGbyCols (cognitive 17): AggregationPushDownSolver.collectGbyCols has cognitive complexity 17 (threshold 15). Drivers by points: loops 9, if/else 8 (nesting depth added 6). 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":"pkg/planner/core/rule_aggregation_push_down.go"},"region":{"startLine":146}}}],"partialFingerprints":{"codehealthFindingId/v1":"2b88a5e5e58d52397efd1094ed0a049061b0ac222c370f00d20a82fe1ba2a1ef"}},{"ruleId":"D2","level":"warning","message":{"text":"OuterJoinEliminator.tryToEliminateOuterJoin (cognitive 17): OuterJoinEliminator.tryToEliminateOuterJoin has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, loops 4, boolean chains 1, match/switch 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":"pkg/planner/core/rule_join_elimination.go"},"region":{"startLine":88}}}],"partialFingerprints":{"codehealthFindingId/v1":"ce1f055196d06b18d05969530dfe5a3f2813d6f899d142816e3f28f46425ff5d"}},{"ruleId":"D2","level":"warning","message":{"text":"FDSet.MakeNotNull (cognitive 17): FDSet.MakeNotNull has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15, loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/funcdep/fd_graph.go"},"region":{"startLine":536}}}],"partialFingerprints":{"codehealthFindingId/v1":"8474f05ddb607f1e87bbd665c32ae039ff6d98f700a5f04dc4743e4b32ffed55"}},{"ruleId":"D2","level":"warning","message":{"text":"autoAdmin.selectIndexCandidates (cognitive 17): autoAdmin.selectIndexCandidates has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, loops 6 (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/planner/indexadvisor/algorithm.go"},"region":{"startLine":429}}}],"partialFingerprints":{"codehealthFindingId/v1":"69857a799b5eb4c06590fd7923060396f7b41ec0d3ebc7b03bac0c93daed7fce"}},{"ruleId":"D2","level":"warning","message":{"text":"costusage.SumCostVer2 (cognitive 17): costusage.SumCostVer2 has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, loops 4 (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/planner/util/costusage/cost_misc.go"},"region":{"startLine":125}}}],"partialFingerprints":{"codehealthFindingId/v1":"c938dff0cc57a2aba8360dfb1fe44f0fb755fddedc157160a95cf07b4785a16a"}},{"ruleId":"D2","level":"warning","message":{"text":"MySQLPrivilege.matchIdentity (cognitive 17): MySQLPrivilege.matchIdentity has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10, loops 6, 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":"pkg/privilege/privileges/cache.go"},"region":{"startLine":1447}}}],"partialFingerprints":{"codehealthFindingId/v1":"566e0c69adbac6e3158d8f3b1feb38db84f4bdd2685e9260e3cec5c2edf9265f"}},{"ruleId":"D2","level":"warning","message":{"text":"ldapSASLAuthImpl.AuthLDAPSASL (cognitive 17): ldapSASLAuthImpl.AuthLDAPSASL has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, loops 1 (nesting depth added 6). 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, 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/privilege/privileges/ldap/sasl.go"},"region":{"startLine":32}}}],"partialFingerprints":{"codehealthFindingId/v1":"9147d2b4071bcd72f39ed8a6682826fc9ecb39e9de6a1aa972448fe8d3652674"}},{"ruleId":"D2","level":"warning","message":{"text":"Manager.AddRunawayWatch (cognitive 17): Manager.AddRunawayWatch has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, match/switch 3, loops 1 (nesting depth added 6). Of this number, 15 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":"pkg/resourcegroup/runaway/record.go"},"region":{"startLine":409}}}],"partialFingerprints":{"codehealthFindingId/v1":"2dcef68165c2c69ea2046254d855044a64673b0170825c12140bf5b588e2d5d0"}},{"ruleId":"D2","level":"warning","message":{"text":"TikvHandlerTool.GetHandle (cognitive 17): TikvHandlerTool.GetHandle has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, loops 2, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/server/handler/tikv_handler.go"},"region":{"startLine":73}}}],"partialFingerprints":{"codehealthFindingId/v1":"a7d4f50e66e312047b9eac6fc0095936890c072436cd6aca843d594c883b3d81"}},{"ruleId":"D2","level":"warning","message":{"text":"tikvhandler.getSchemaTablesStorageInfo (cognitive 17): tikvhandler.getSchemaTablesStorageInfo has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, loops 5 (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":"pkg/server/handler/tikvhandler/tikv_handler.go"},"region":{"startLine":794}}}],"partialFingerprints":{"codehealthFindingId/v1":"d26c4632251385e0fd23a095bfd87767b49f4012050ba01cc84e63387687130e"}},{"ruleId":"D2","level":"warning","message":{"text":"DXFScheduleTuneHandler.ServeHTTP (cognitive 17): DXFScheduleTuneHandler.ServeHTTP has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, boolean chains 2, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/server/handler/tikvhandler/dxf.go"},"region":{"startLine":280}}}],"partialFingerprints":{"codehealthFindingId/v1":"e1ce39d4014f9b82358a2bd4ff1f8aa9eaf433480d1e478d5735b0f304badd63"}},{"ruleId":"D2","level":"warning","message":{"text":"session.bootstrapSchemas (cognitive 17): session.bootstrapSchemas has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, loops 3 (nesting depth added 9). 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 362). 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":"pkg/session/bootstrap.go"},"region":{"startLine":360}}}],"partialFingerprints":{"codehealthFindingId/v1":"29e7bf699c59c3a5ae00fdcbd057c23ef6c489a41ea0ddd5e2a95b7d3d92d3f4"}},{"ruleId":"D2","level":"warning","message":{"text":"session.approxCompilePlanTokenCnt (cognitive 17): session.approxCompilePlanTokenCnt has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, boolean chains 5, 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":"pkg/session/session.go"},"region":{"startLine":1641}}}],"partialFingerprints":{"codehealthFindingId/v1":"bc2fbb5bc4b1bcd6df915fd3847520e82d5294cdbcb1496954f1a4f4cd66cb22"}},{"ruleId":"D2","level":"warning","message":{"text":"session.doCommit (cognitive 17): session.doCommit has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, boolean chains 3 (nesting depth added 3). Of this number, 14 points are the body\u0027s own statements and 3 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":"pkg/session/session.go"},"region":{"startLine":531}}}],"partialFingerprints":{"codehealthFindingId/v1":"fcbdc02a3903d52ed5acd4ac867bbaedb1e842acb844d7a742fa158e4dd4173f"}},{"ruleId":"D2","level":"warning","message":{"text":"ProcessInfo.ToRow (cognitive 17): ProcessInfo.ToRow has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, 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":"pkg/session/sessmgr/processinfo.go"},"region":{"startLine":138}}}],"partialFingerprints":{"codehealthFindingId/v1":"a424e93f452be6e94e73d7eace5ccdca9090774f14414b119c1a8b546e6d3c37"}},{"ruleId":"D2","level":"warning","message":{"text":"AdvancedSessionPool.WithForceBlockGCSession (cognitive 17): AdvancedSessionPool.WithForceBlockGCSession has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, match/switch 3, loops 2 (nesting depth added 8). Of this number, 15 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":"pkg/session/syssession/pool.go"},"region":{"startLine":283}}}],"partialFingerprints":{"codehealthFindingId/v1":"86d976f07aca30f5ffdcda72bf280002219c07fd736be098ad2ef0dae3529d58"}},{"ruleId":"D2","level":"warning","message":{"text":"AnalysisPriorityQueue.handleAddIndexEvent (cognitive 17): AnalysisPriorityQueue.handleAddIndexEvent has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, loops 3, boolean chains 1 (nesting depth added 6). Of this number, 14 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":"pkg/statistics/handle/autoanalyze/priorityqueue/queue_ddl_handler.go"},"region":{"startLine":178}}}],"partialFingerprints":{"codehealthFindingId/v1":"9ffafa9d4bf96b4b7068b8e7505481e62e613334ae5afd1d6e905acb0cbcb7b3"}},{"ruleId":"D2","level":"warning","message":{"text":"statsHistoryImpl.RecordHistoricalStatsMeta (cognitive 17): statsHistoryImpl.RecordHistoricalStatsMeta has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, loops 4, boolean chains 1 (nesting depth added 6). Of this number, 16 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":"pkg/statistics/handle/history/history_stats.go"},"region":{"startLine":71}}}],"partialFingerprints":{"codehealthFindingId/v1":"54b26c1c8aa242395c72d76838126366c14a159795677f8b29aa8237ec30004d"}},{"ruleId":"D2","level":"warning","message":{"text":"lockstats.RemoveLockedTables (cognitive 17): lockstats.RemoveLockedTables has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, 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":"pkg/statistics/handle/lockstats/unlock_stats.go"},"region":{"startLine":39}}}],"partialFingerprints":{"codehealthFindingId/v1":"b2cbbdf6dc55b03eac3b50d9b95ab1855e98e14a1d1dcee258636dd7f8ed1a5b"}},{"ruleId":"D2","level":"warning","message":{"text":"Histogram.RemoveVals (cognitive 17): Histogram.RemoveVals has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, loops 3 (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/statistics/histogram.go"},"region":{"startLine":416}}}],"partialFingerprints":{"codehealthFindingId/v1":"e90753f2c8a8510d1bd8080b02cb6881025f1fe6f0a7f62d6ccc23ed730ce02c"}},{"ruleId":"D2","level":"warning","message":{"text":"copr.firstOutOfBoundKeyRangeInLocation (cognitive 17): copr.firstOutOfBoundKeyRangeInLocation has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, boolean chains 3, 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/store/copr/range_diagnostics.go"},"region":{"startLine":69}}}],"partialFingerprints":{"codehealthFindingId/v1":"24213859679f1722935b38f68b37f6f54c68278e7039f2a8ff88925121fdbc9c"}},{"ruleId":"D2","level":"warning","message":{"text":"hashAggExec.Next (cognitive 17): hashAggExec.Next has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, loops 5 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/store/mockstore/mockcopr/aggregate.go"},"region":{"startLine":94}}}],"partialFingerprints":{"codehealthFindingId/v1":"444b388f7435c502f50bb47c83112596dfa3d44b5a8c085ad150c5467f19c9bc"}},{"ruleId":"D2","level":"warning","message":{"text":"tableScanExec.getRowFromRange (cognitive 17): tableScanExec.getRowFromRange has cognitive complexity 17 (threshold 15). Drivers by points: if/else 17 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/store/mockstore/mockcopr/executor.go"},"region":{"startLine":180}}}],"partialFingerprints":{"codehealthFindingId/v1":"f30346558cdce7a15804a917f341a37c2a61b8279f13c46a9ed9a12878806e22"}},{"ruleId":"D2","level":"warning","message":{"text":"table.HasForeignKeyRefAction (cognitive 17): table.HasForeignKeyRefAction has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, loops 7, 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":"pkg/table/constraint.go"},"region":{"startLine":182}}}],"partialFingerprints":{"codehealthFindingId/v1":"ec169103030f0331cae4f1bc399193a2e476d49c22c0f94baa149846eaabb953"}},{"ruleId":"D2","level":"warning","message":{"text":"TableCommon.removeRecord (cognitive 17): TableCommon.removeRecord has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, boolean chains 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":"pkg/table/tables/tables.go"},"region":{"startLine":1187}}}],"partialFingerprints":{"codehealthFindingId/v1":"f675b776de055eb2b279cb84ef96f0268522c3089ec325ffd1e0c750bb313166"}},{"ruleId":"D2","level":"warning","message":{"text":"TableCommon.GetSequenceNextVal (cognitive 17): TableCommon.GetSequenceNextVal has cognitive complexity 17 (threshold 15). Drivers by points: if/else 17 (nesting depth added 3). 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 1649). 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":"pkg/table/tables/tables.go"},"region":{"startLine":1640}}}],"partialFingerprints":{"codehealthFindingId/v1":"07931330e399709d6740a34f1cf41484a80e89b8648519fde6eee7f04c5b5b1c"}},{"ruleId":"D2","level":"warning","message":{"text":"TimerCond.Match (cognitive 17): TimerCond.Match has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, boolean chains 4, 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":"pkg/timer/api/store.go"},"region":{"startLine":110}}}],"partialFingerprints":{"codehealthFindingId/v1":"4433a8545ca756baeb246c06c880f67c442dc3ba0904e72f9e9f0eb4a0cbffa0"}},{"ruleId":"D2","level":"warning","message":{"text":"types.convertScientificNotation (cognitive 17): types.convertScientificNotation has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15, boolean chains 1, 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":"pkg/types/convert.go"},"region":{"startLine":187}}}],"partialFingerprints":{"codehealthFindingId/v1":"1885b8b33faea6b4b007b224a6136d9dc01c67a03daed01409d23b7ac164dc11"}},{"ruleId":"D2","level":"warning","message":{"text":"types.strToInt (cognitive 17): types.strToInt has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, boolean chains 3, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/types/helper.go"},"region":{"startLine":133}}}],"partialFingerprints":{"codehealthFindingId/v1":"7689136573431bb9a117ac501fff5bf68b17106e55ac9fb1456a1cf34476543f"}},{"ruleId":"D2","level":"warning","message":{"text":"types.mysqlTimeFix (cognitive 17): types.mysqlTimeFix has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, match/switch 3, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/types/time.go"},"region":{"startLine":2966}}}],"partialFingerprints":{"codehealthFindingId/v1":"6af2e920dec477342313b3b37c38cdb0cb4455df134601748bf3d063ccf8c0f5"}},{"ruleId":"D2","level":"warning","message":{"text":"Datum.toSignedInteger (cognitive 17): Datum.toSignedInteger has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction \u2014 a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full \u2014 so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/types/datum.go"},"region":{"startLine":1990}}}],"partialFingerprints":{"codehealthFindingId/v1":"bb2790bd7ad921022985ed00a77133073824a0bd3dd8e26b92a89b72618b0942"}},{"ruleId":"D2","level":"warning","message":{"text":"Row.ToString (cognitive 17): Row.ToString has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 11, if/else 5, loops 1 (nesting depth added 10). 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/util/chunk/row.go"},"region":{"startLine":222}}}],"partialFingerprints":{"codehealthFindingId/v1":"f708b9723ab4cfda5dd8d23db60767ab0e523831cca0fada02ca040318f744be"}},{"ruleId":"D2","level":"warning","message":{"text":"util.NewSession (cognitive 17): util.NewSession has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, loops 1 (nesting depth added 9). Most of this is not in the body itself: 7 of the 17 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 55, 63). 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":"pkg/util/etcd.go"},"region":{"startLine":45}}}],"partialFingerprints":{"codehealthFindingId/v1":"cb7d10598cf59dc87357fb2e6b1f600c76738e5ec0ad62f2593c6360ea30c644"}},{"ruleId":"D2","level":"warning","message":{"text":"disk.InitializeTempDir (cognitive 17): disk.InitializeTempDir has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, match/switch 5, loops 2, boolean chains 1 (nesting depth added 7). Of this number, 9 points are the body\u0027s own statements and 8 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/util/disk/tempDir.go"},"region":{"startLine":63}}}],"partialFingerprints":{"codehealthFindingId/v1":"7b8cfb677c28f79aa61da2342b1687a752f2141d69aa90e9fb31df8ef285ae8a"}},{"ruleId":"D2","level":"warning","message":{"text":"repairInfo.RemoveFromRepairInfo (cognitive 17): repairInfo.RemoveFromRepairInfo has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, loops 5 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/util/domainutil/repair_vars.go"},"region":{"startLine":140}}}],"partialFingerprints":{"codehealthFindingId/v1":"bd04e7497e8300a9d205b4009c1d3c3026acaae993497a6ac4edef14d17271bf"}},{"ruleId":"D2","level":"warning","message":{"text":"hint.ExtractTableHintsFromStmtNode (cognitive 17): hint.ExtractTableHintsFromStmtNode has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, loops 5, match/switch 1 (nesting depth added 10). The drivers above price the dispatch low by construction \u2014 a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full \u2014 so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/util/hint/hint_processor.go"},"region":{"startLine":82}}}],"partialFingerprints":{"codehealthFindingId/v1":"0d5e0f674cce6228596146840c713a0d455cec5e62e98679ed951d2d6f5c2bfa"}},{"ruleId":"D2","level":"warning","message":{"text":"hintProcessor.Enter (cognitive 17): hintProcessor.Enter has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, match/switch 1 (nesting depth added 7). 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":"pkg/util/hint/hint_processor.go"},"region":{"startLine":263}}}],"partialFingerprints":{"codehealthFindingId/v1":"13e283ab359e73c6bc87c3858201f0b51f737b9c0a99d970dd1eabad15286755"}},{"ruleId":"D2","level":"warning","message":{"text":"consistency.DecodeRowMvccData (cognitive 17): consistency.DecodeRowMvccData has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, loops 5 (nesting depth added 9). 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 112). 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":"pkg/util/logutil/consistency/reporter.go"},"region":{"startLine":111}}}],"partialFingerprints":{"codehealthFindingId/v1":"885f03e6c530fe640525f2d19a28f6f62974e31937c8f2e67fbf77929c4be8d5"}},{"ruleId":"D2","level":"warning","message":{"text":"validator.ValidateUserNameInPassword (cognitive 17): validator.ValidateUserNameInPassword 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":"pkg/util/password-validation/password_validation.go"},"region":{"startLine":56}}}],"partialFingerprints":{"codehealthFindingId/v1":"fe3adb9da4e2317a9c71c4d74649f92d289625a4c4ca1ed3b146bfb89611020a"}},{"ruleId":"D2","level":"warning","message":{"text":"ranger.detachColumnDNFConditions (cognitive 17): ranger.detachColumnDNFConditions has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15, boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/util/ranger/detacher.go"},"region":{"startLine":67}}}],"partialFingerprints":{"codehealthFindingId/v1":"9b6ae51daf6752727446888e5de265d585f192155f31d5b3d5cf6e58803e7fe0"}},{"ruleId":"D2","level":"warning","message":{"text":"ranger.AddGcColumn4InCond (cognitive 17): ranger.AddGcColumn4InCond has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, 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":"pkg/util/ranger/detacher.go"},"region":{"startLine":1267}}}],"partialFingerprints":{"codehealthFindingId/v1":"0f82460a2c88a52af0c9c8e29a0e2ee309901eeafe36ca307f12db0e3698172b"}},{"ruleId":"D2","level":"warning","message":{"text":"BytesDecoder.decodeToBytesInternal (cognitive 17): BytesDecoder.decodeToBytesInternal has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15, 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":"pkg/util/rowcodec/decoder.go"},"region":{"startLine":401}}}],"partialFingerprints":{"codehealthFindingId/v1":"97ed3799f867ee6f6167cba321bb1cff666e356f3bf0a820c717a2acd510549b"}},{"ruleId":"D2","level":"warning","message":{"text":"TableRule.Valid (cognitive 17): TableRule.Valid has cognitive complexity 17 (threshold 15). Drivers by points: if/else 17 (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/util/table-router/router.go"},"region":{"startLine":60}}}],"partialFingerprints":{"codehealthFindingId/v1":"79c1a38971d9d5b144347d644079d4e41d2207db0f21946e564f763a97621266"}},{"ruleId":"D2","level":"warning","message":{"text":"SQLCPUCollector.parseCPUProfileForProcess (cognitive 17): SQLCPUCollector.parseCPUProfileForProcess has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, loops 4, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/util/topsql/collector/cpu.go"},"region":{"startLine":292}}}],"partialFingerprints":{"codehealthFindingId/v1":"cd64733dddcf1cbac3f14a7af9637f95e33b28feedaec11bfc40b548a2b8849f"}},{"ruleId":"D2","level":"warning","message":{"text":"traceevent.ConvertEventsForRendering (cognitive 17): traceevent.ConvertEventsForRendering has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, loops 2, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/util/traceevent/traceevent.go"},"region":{"startLine":538}}}],"partialFingerprints":{"codehealthFindingId/v1":"6fe1464fac4f9a4cde03e77b73894241fbd6f1a38dc3e34228c61a1ab07ef746"}},{"ruleId":"D2","level":"warning","message":{"text":"worker.startRepository (cognitive 17): worker.startRepository has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, match/switch 2, loops 1 (nesting depth added 10). 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 311). 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":"pkg/util/workloadrepo/worker.go"},"region":{"startLine":308}}}],"partialFingerprints":{"codehealthFindingId/v1":"24a882800f6cfa3f2fea4d7dbecd5afd33f4db496d07c2bd9ce2c26a832a8458"}},{"ruleId":"D2","level":"warning","message":{"text":"VariableAssignment.Restore (cognitive 17): VariableAssignment.Restore has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15, boolean chains 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/parser/ast/misc.go"},"region":{"startLine":997}}}],"partialFingerprints":{"codehealthFindingId/v1":"3e193969988104e08cdf0167ac9a773f8f2c6d5eaa2bb911f7f601a0e0cd9fd9"}},{"ruleId":"D2","level":"warning","message":{"text":"LeadingList.RestoreWithQB (cognitive 17): LeadingList.RestoreWithQB has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, boolean chains 2, match/switch 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":"pkg/parser/ast/misc.go"},"region":{"startLine":4166}}}],"partialFingerprints":{"codehealthFindingId/v1":"6889b8d8c927d6a4515f93426089ad3f5547d30ab720b932594f6b2b257ec688"}},{"ruleId":"D2","level":"warning","message":{"text":"hintScanner.updateSetVarValueState (cognitive 17): hintScanner.updateSetVarValueState has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, boolean chains 2, match/switch 1 (nesting depth added 5). 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":"pkg/parser/hintparserimpl.go"},"region":{"startLine":66}}}],"partialFingerprints":{"codehealthFindingId/v1":"0b41145790084e106734d611a5ef80f491d558546208fc9d50ff79cfa46b5c8d"}},{"ruleId":"D2","level":"warning","message":{"text":"Scanner.isTokenIdentifier (cognitive 17): Scanner.isTokenIdentifier has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, boolean chains 3, loops 2 (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":"pkg/parser/misc.go"},"region":{"startLine":1144}}}],"partialFingerprints":{"codehealthFindingId/v1":"9d1b78abc025b9612e5d6ad80b83a9762063ff3c5eb8370d3486fe594c3609c9"}},{"ruleId":"D2","level":"warning","message":{"text":"backup.doSendBackup (cognitive 16): backup.doSendBackup has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, loops 1, match/switch 1 (nesting depth added 6). Of this number, 9 points are the body\u0027s own statements and 7 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":"br/pkg/backup/store.go"},"region":{"startLine":121}}}],"partialFingerprints":{"codehealthFindingId/v1":"996c4f51ecc4831a31c1c7108d0bf6c6cd1daf1e365541e4059d6c2eeecfed0a"}},{"ruleId":"D2","level":"warning","message":{"text":"checkpoint.mergeSelectCheckpoint (cognitive 16): checkpoint.mergeSelectCheckpoint has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, 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":"br/pkg/checkpoint/storage.go"},"region":{"startLine":168}}}],"partialFingerprints":{"codehealthFindingId/v1":"e1820fbc3f4fd8715864533270a815fc075802705a8f20cd6ab0e2f4cf7ac895"}},{"ruleId":"D2","level":"warning","message":{"text":"Mgr.ProcessTiKVConfigs (cognitive 16): Mgr.ProcessTiKVConfigs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, boolean chains 3 (nesting depth added 4). Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 344). 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":"br/pkg/conn/conn.go"},"region":{"startLine":334}}}],"partialFingerprints":{"codehealthFindingId/v1":"3f46b8de8070eaadf3306cc73dc0ee228534fabab8fa8bc3cb0efa0f5d8658e6"}},{"ruleId":"D2","level":"warning","message":{"text":"metautil.DecodeMetaFile (cognitive 16): metautil.DecodeMetaFile has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, loops 1 (nesting depth added 7). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 92). 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":"br/pkg/metautil/debug.go"},"region":{"startLine":80}}}],"partialFingerprints":{"codehealthFindingId/v1":"c5843ca84c484a54594d743b59e4d50bc2dcd5c63fd5d6f6165785a91d7d51e7"}},{"ruleId":"D2","level":"warning","message":{"text":"metautil.detectUnknownProtobufFields (cognitive 16): metautil.detectUnknownProtobufFields 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":"br/pkg/metautil/metafile.go"},"region":{"startLine":102}}}],"partialFingerprints":{"codehealthFindingId/v1":"0b918354ac5d286a6a628d93e90250b9c1e5d18784aa3248d0891643f4cbdc3a"}},{"ruleId":"D2","level":"warning","message":{"text":"prealloctableid.collectTableIDs (cognitive 16): prealloctableid.collectTableIDs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, loops 4, boolean chains 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":"br/pkg/restore/internal/prealloc_table_id/alloc.go"},"region":{"startLine":66}}}],"partialFingerprints":{"codehealthFindingId/v1":"6e87193f18e536a90c62de37e569a15b36f87f17017e8fce7256852c4503edf5"}},{"ruleId":"D2","level":"warning","message":{"text":"LogClient.InsertGCRows (cognitive 16): LogClient.InsertGCRows has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, loops 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":"br/pkg/restore/log_client/client.go"},"region":{"startLine":2343}}}],"partialFingerprints":{"codehealthFindingId/v1":"3940dc831d2d3529d46999969b4bba34aa12af62a4e71112158965f997a6ec5e"}},{"ruleId":"D2","level":"warning","message":{"text":"SnapClient.RestoreSSTFiles (cognitive 16): SnapClient.RestoreSSTFiles has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7, loops 7, match/switch 2 (nesting depth added 10). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to one function literal inside it that branches (line 465). 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":"br/pkg/restore/snap_client/tikv_sender.go"},"region":{"startLine":460}}}],"partialFingerprints":{"codehealthFindingId/v1":"ffb8fa0885779c94f86b61245290e9bc60ff8d22e9c074fbc27158075ba984d2"}},{"ruleId":"D2","level":"warning","message":{"text":"SchemasReplace.rewriteEntryForTable (cognitive 16): SchemasReplace.rewriteEntryForTable has cognitive complexity 16 (threshold 15). Drivers by points: if/else 16 (nesting depth added 5). 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":"br/pkg/stream/rewrite_meta_rawkv.go"},"region":{"startLine":365}}}],"partialFingerprints":{"codehealthFindingId/v1":"d81f5df0769d9a93720c89b6c50ca83e77d4efb4c3ba09db45e74361297f2d22"}},{"ruleId":"D2","level":"warning","message":{"text":"storeCollector.recvLoop (cognitive 16): storeCollector.recvLoop has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, match/switch 2, 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":"br/pkg/streamhelper/collector.go"},"region":{"startLine":88}}}],"partialFingerprints":{"codehealthFindingId/v1":"58fc3dc2e0b44750a6ceee4916b0f78343cc6da5a0d18ac9609120c8152c3e7a"}},{"ruleId":"D2","level":"warning","message":{"text":"task.checkDiskSpace (cognitive 16): task.checkDiskSpace has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, loops 2 (nesting depth added 5). Most of this is not in the body itself: 6 of the 16 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 2083, 2069). 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":"br/pkg/task/restore.go"},"region":{"startLine":2048}}}],"partialFingerprints":{"codehealthFindingId/v1":"727a8643f4eb73c8544948fbfe26190b36426daeeabc15cbbdc9312d35ba5332"}},{"ruleId":"D2","level":"warning","message":{"text":"task.checkOptionalClusterRequirements (cognitive 16): task.checkOptionalClusterRequirements has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, 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":"br/pkg/task/restore.go"},"region":{"startLine":2745}}}],"partialFingerprints":{"codehealthFindingId/v1":"6317ef0552a2fc32134de9e2894d985978685e539cb228546c5d6ba3511a0bef"}},{"ruleId":"D2","level":"warning","message":{"text":"task.RunResolveKvData (cognitive 16): task.RunResolveKvData has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, boolean chains 1. Of this number, 13 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":"br/pkg/task/restore_data.go"},"region":{"startLine":45}}}],"partialFingerprints":{"codehealthFindingId/v1":"c4f79ea9f843160f501794e36f5133e374cf1e730cc703af7100c86c99556bed"}},{"ruleId":"D2","level":"warning","message":{"text":"operator.RunForceFlush (cognitive 16): operator.RunForceFlush has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, loops 3, boolean chains 1 (nesting depth added 6). Most of this is not in the body itself: 7 of the 16 points are its own statements 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":"br/pkg/task/operator/force_flush.go"},"region":{"startLine":28}}}],"partialFingerprints":{"codehealthFindingId/v1":"9f2b48e62e66e2a97d82ebf2d44c723887c8c43f2da140f7699c44efce425569"}},{"ruleId":"D2","level":"warning","message":{"text":"bootstrap.checkSystemTablesDefinitionNode (cognitive 16): bootstrap.checkSystemTablesDefinitionNode 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":"build/linter/bootstrap/analyzer.go"},"region":{"startLine":77}}}],"partialFingerprints":{"codehealthFindingId/v1":"5df0bf42e489a8c0ef02a641095a80b6da60b13cebec73f1e9f9fb71cbbc0d1a"}},{"ruleId":"D2","level":"warning","message":{"text":"util.ParseDirectives (cognitive 16): util.ParseDirectives has cognitive complexity 16 (threshold 15). Drivers by points: loops 10, if/else 5, boolean chains 1 (nesting depth added 10). 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":"build/linter/util/util.go"},"region":{"startLine":64}}}],"partialFingerprints":{"codehealthFindingId/v1":"2054b5daaea57df30867a38d49c4b6e652306b3fd32d9881b1ca833809dcbd8c"}},{"ruleId":"D2","level":"warning","message":{"text":"export.dumpTableMeta (cognitive 16): export.dumpTableMeta has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, match/switch 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":"dumpling/export/dump.go"},"region":{"startLine":1337}}}],"partialFingerprints":{"codehealthFindingId/v1":"6a80d39b6364b82ed69f2f0b225fb7c50845dfad0466ff4a1b0a7c6b48558629"}},{"ruleId":"D2","level":"warning","message":{"text":"FileCheckpointsDB.Initialize (cognitive 16): FileCheckpointsDB.Initialize has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, loops 3 (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":"lightning/pkg/checkpoints/checkpoints.go"},"region":{"startLine":1275}}}],"partialFingerprints":{"codehealthFindingId/v1":"735375d6d5026326f6f9399de6e3487c757a0f365dbc36606232546d707985b5"}},{"ruleId":"D2","level":"warning","message":{"text":"importer.openParser (cognitive 16): importer.openParser has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, boolean chains 1, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lightning/pkg/importer/chunk_process.go"},"region":{"startLine":81}}}],"partialFingerprints":{"codehealthFindingId/v1":"cc4bac2f2fbb57a16e819f50b7e3f2f992956a114b8312669cd8bd077f8f613e"}},{"ruleId":"D2","level":"warning","message":{"text":"PreImportInfoGetterImpl.ReadFirstNRowsByFileMeta (cognitive 16): PreImportInfoGetterImpl.ReadFirstNRowsByFileMeta has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, loops 3, match/switch 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":"lightning/pkg/importer/get_pre_info.go"},"region":{"startLine":470}}}],"partialFingerprints":{"codehealthFindingId/v1":"d6a825d0022cac1adef5919cbef6c643ee0c29e63cc43c9299627423c6cdcddc"}},{"ruleId":"D2","level":"warning","message":{"text":"largeFileCheckItem.Check (cognitive 16): largeFileCheckItem.Check has cognitive complexity 16 (threshold 15). Drivers by points: loops 9, if/else 7 (nesting depth added 10). 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":"lightning/pkg/importer/precheck_impl.go"},"region":{"startLine":474}}}],"partialFingerprints":{"codehealthFindingId/v1":"af4738d4d79d52dba5f4d368712aeac8f3b982ca5cf82e728fa09b7bd91cc468"}},{"ruleId":"D2","level":"warning","message":{"text":"schemaCheckItem.Check (cognitive 16): schemaCheckItem.Check has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, loops 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":"lightning/pkg/importer/precheck_impl.go"},"region":{"startLine":918}}}],"partialFingerprints":{"codehealthFindingId/v1":"d3983d6c57efc7ca4f2c730dc176eeaf6754c9790067291105fea59bd9c14729"}},{"ruleId":"D2","level":"warning","message":{"text":"TableImporter.addIndexes (cognitive 16): TableImporter.addIndexes has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, boolean chains 1, loops 1 (nesting depth added 3). Of this number, 9 points are the body\u0027s own statements and 7 belong to 3 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lightning/pkg/importer/table_import.go"},"region":{"startLine":1456}}}],"partialFingerprints":{"codehealthFindingId/v1":"423732bd4557b0c1eacd11b45cae8da2a68c883ffe8479a5dbb379049f3874de"}},{"ruleId":"D2","level":"warning","message":{"text":"server.checkSchemaConflict (cognitive 16): server.checkSchemaConflict has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, loops 6, boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lightning/pkg/server/lightning.go"},"region":{"startLine":1056}}}],"partialFingerprints":{"codehealthFindingId/v1":"b24e79b4d42fa4525b4287d5320ee135fadbf738f1fb1a5fe02e84263485f1ec"}},{"ruleId":"D2","level":"warning","message":{"text":"LegacyCheckpointControl.DestroyError (cognitive 16): LegacyCheckpointControl.DestroyError has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, loops 6 (nesting depth added 7). Most of this is not in the body itself: 0 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 103). 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":"lightning/pkg/server/checkpoint_control.go"},"region":{"startLine":102}}}],"partialFingerprints":{"codehealthFindingId/v1":"0490cda29815a8f495047383fe1a01841bd7e905b0a5ea135425a1ca7c49cc2c"}},{"ruleId":"D2","level":"warning","message":{"text":"bindinfo.NormalizeStmtForBinding (cognitive 16): bindinfo.NormalizeStmtForBinding has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, match/switch 3, boolean chains 1 (nesting depth added 7). Of this number, 14 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, 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/bindinfo/binding.go"},"region":{"startLine":500}}}],"partialFingerprints":{"codehealthFindingId/v1":"efa566f5c14e6d4a032b7e985970add8a3a59681a822c5864a19ab4ded7cff0f"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.isColumnCanDropWithIndex (cognitive 16): ddl.isColumnCanDropWithIndex has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, loops 4, 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":"pkg/ddl/column.go"},"region":{"startLine":1194}}}],"partialFingerprints":{"codehealthFindingId/v1":"dd9668dcf169921b8d30ec8c0590a0100788cac53c38a08b9befce28231ac42f"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.checkColumnarIndexIfNeedTiFlashReplica (cognitive 16): ddl.checkColumnarIndexIfNeedTiFlashReplica has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/create_table.go"},"region":{"startLine":604}}}],"partialFingerprints":{"codehealthFindingId/v1":"f95f55505a146bae4d2521684c9ece938906d3331194ab528171ce2c8c2a9c3a"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.checkConstraintNames (cognitive 16): ddl.checkConstraintNames has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, 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":"pkg/ddl/create_table.go"},"region":{"startLine":1126}}}],"partialFingerprints":{"codehealthFindingId/v1":"444471481a7597efc1fc6aae25ddfc37610208fef79fd90dde4e70106b7d30a0"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.addIndexForForeignKey (cognitive 16): ddl.addIndexForForeignKey has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, loops 3, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/create_table.go"},"region":{"startLine":1674}}}],"partialFingerprints":{"codehealthFindingId/v1":"2edd47ad65c86f6a4be87d18db3976078a5fe6f53a863acfbad07d15db0cfdaa"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.GetDropOrTruncateTableInfoFromJobsByStore (cognitive 16): ddl.GetDropOrTruncateTableInfoFromJobsByStore has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, boolean chains 2, 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":"pkg/ddl/ddl.go"},"region":{"startLine":1330}}}],"partialFingerprints":{"codehealthFindingId/v1":"2b9c8a2eb4f4f190dbda05024564ccd0031ffbb194fc6f431e9bcc3746b1af05"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.ResolveCharsetCollation (cognitive 16): ddl.ResolveCharsetCollation 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":"pkg/ddl/executor.go"},"region":{"startLine":916}}}],"partialFingerprints":{"codehealthFindingId/v1":"17f345531fc546f238da606e0478cef94f9ae0e958972ee3e37384fac4112dfb"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.ResolveAlterTableSpec (cognitive 16): ddl.ResolveAlterTableSpec has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, 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":"pkg/ddl/executor.go"},"region":{"startLine":1659}}}],"partialFingerprints":{"codehealthFindingId/v1":"f72995e529a6cc89e7876ea731e1c1eb522005279ba3c2ff7b2b3928ad25c09c"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.getReplacedPartitionIDs (cognitive 16): ddl.getReplacedPartitionIDs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, loops 1, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/executor.go"},"region":{"startLine":2417}}}],"partialFingerprints":{"codehealthFindingId/v1":"a543e4aa70f70501e6829f5053f1bf5675f4fdebfdd56093d9dcd48f74352cd8"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.checkForeignKeyConstrain (cognitive 16): ddl.checkForeignKeyConstrain has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, loops 3 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/foreign_key.go"},"region":{"startLine":670}}}],"partialFingerprints":{"codehealthFindingId/v1":"3eb1c7dd7fdd0f9c221c0d37bf640b885ba79ddfe8a1fd9027f88d3ac63bec00"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.findDependedColumnNames (cognitive 16): ddl.findDependedColumnNames has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, loops 4, 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":"pkg/ddl/generated_column.go"},"region":{"startLine":125}}}],"partialFingerprints":{"codehealthFindingId/v1":"ae7273132f328792681ad42fc0e62867eadc14af66e5a1ca389e8f61814afd38"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.batchCheckTemporaryUniqueKey (cognitive 16): ddl.batchCheckTemporaryUniqueKey has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/index_merge_tmp.go"},"region":{"startLine":39}}}],"partialFingerprints":{"codehealthFindingId/v1":"76587aa4cff0806e56c4882ab06df659f3ad18e40580d14138918376417157cb"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.preSplitIndexRegions (cognitive 16): ddl.preSplitIndexRegions has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, loops 4, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/index_presplit.go"},"region":{"startLine":43}}}],"partialFingerprints":{"codehealthFindingId/v1":"3110a5a5f307bb420559903a663fe0bb484a45e7143707c6742d97ff9b9f26ee"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.doReorgWorkForModifyColumn (cognitive 16): ddl.doReorgWorkForModifyColumn has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, boolean chains 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":"pkg/ddl/modify_column.go"},"region":{"startLine":1344}}}],"partialFingerprints":{"codehealthFindingId/v1":"dcd7b74bbb01cfdacb1cc632cdbc28f631c3f2af7cff858f111c8e7b50e35527"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.checkPartitionReplica (cognitive 16): ddl.checkPartitionReplica has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, loops 4 (nesting depth added 5). Of this number, 14 points are the body\u0027s own statements and 2 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":"pkg/ddl/partition.go"},"region":{"startLine":469}}}],"partialFingerprints":{"codehealthFindingId/v1":"d61176c19a7cb7dc996650300fd72fc7a3fde7c515087fde1882f246e68abe0f"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.getRangeValue (cognitive 16): ddl.getRangeValue has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/partition.go"},"region":{"startLine":2051}}}],"partialFingerprints":{"codehealthFindingId/v1":"9ceef6cf7d1bf54bb28c46625f1b7bd59a6cc0653d693016dc265a798a0201d1"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.CheckDropTablePartition (cognitive 16): ddl.CheckDropTablePartition has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, loops 3, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/partition.go"},"region":{"startLine":2087}}}],"partialFingerprints":{"codehealthFindingId/v1":"0f6c4e1a8ad9ebd84ef13e341e4ae3f4634028e2d55cabe921108866189d1b00"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.adjustForeignKeyChildTableInfoAfterRenameTable (cognitive 16): ddl.adjustForeignKeyChildTableInfoAfterRenameTable has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, boolean chains 2, 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":"pkg/ddl/table.go"},"region":{"startLine":957}}}],"partialFingerprints":{"codehealthFindingId/v1":"8aff53bf62ff8753348e1bf84e1f9039551634873f9653da582a512d101ce864"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.onTTLInfoChange (cognitive 16): ddl.onTTLInfoChange has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/ttl.go"},"region":{"startLine":47}}}],"partialFingerprints":{"codehealthFindingId/v1":"7160560606e5362aef07800e8df705ef2488c98cf50d4f11235cce4625227b00"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.detectAndUpdateJobVersionOnce (cognitive 16): ddl.detectAndUpdateJobVersionOnce has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, boolean chains 1, 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":"pkg/ddl/ddl.go"},"region":{"startLine":1020}}}],"partialFingerprints":{"codehealthFindingId/v1":"4a0b330a0460fb8e0fe00c623583b562e4f6a3e30da5ebf5688312a43d20bf95"}},{"ruleId":"D2","level":"warning","message":{"text":"ddl.startCleanDeadTableLock (cognitive 16): ddl.startCleanDeadTableLock has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, loops 4, match/switch 2 (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/ddl/ddl.go"},"region":{"startLine":1184}}}],"partialFingerprints":{"codehealthFindingId/v1":"4bf9462d33b5fcbad5cd705a4d30cdf1f06af7a113fddb3ffad1d9bf46951742"}},{"ruleId":"D2","level":"warning","message":{"text":"executor.DropSchema (cognitive 16): executor.DropSchema has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, 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":"pkg/ddl/executor.go"},"region":{"startLine":763}}}],"partialFingerprints":{"codehealthFindingId/v1":"61a8ffb0e908156b1b4a983c161c54d71ac1836f5d7328c6fda19b0a443279fa"}},{"ruleId":"D2","level":"warning","message":{"text":"baseIndexWorker.getIndexRecord (cognitive 16): baseIndexWorker.getIndexRecord has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, boolean chains 2, match/switch 2, loops 1 (nesting depth added 7). Most of this is not in the body itself: 5 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 2450). 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":"pkg/ddl/index.go"},"region":{"startLine":2448}}}],"partialFingerprints":{"codehealthFindingId/v1":"d08fc13e8424331b1479cd9991e2108130cc39fe89528a442939fe9373398255"}},{"ruleId":"D2","level":"warning","message":{"text":"worker.updatePhysicalTableRow (cognitive 16): worker.updatePhysicalTableRow has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, match/switch 3, 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":"pkg/ddl/column.go"},"region":{"startLine":550}}}],"partialFingerprints":{"codehealthFindingId/v1":"de602e18b8f8a42d03da906835afcbc5e7cd2bf5abec0779ad9e199cda8fe229"}},{"ruleId":"D2","level":"warning","message":{"text":"worker.checkColumnarIndexProcessOnce (cognitive 16): worker.checkColumnarIndexProcessOnce has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, boolean chains 1, loops 1 (nesting depth added 3). Of this number, 11 points are the body\u0027s own statements and 5 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/index.go"},"region":{"startLine":1100}}}],"partialFingerprints":{"codehealthFindingId/v1":"2a7ee8f2b0a44bf1197d9fe0134465a7b26721a2388f58ba1fbab7a5e9ac781c"}},{"ruleId":"D2","level":"warning","message":{"text":"distsql.TableHandlesToKVRanges (cognitive 16): distsql.TableHandlesToKVRanges has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, loops 3, boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/distsql/request_builder.go"},"region":{"startLine":628}}}],"partialFingerprints":{"codehealthFindingId/v1":"9de24c6c08daa173eaaa6606561255d5e1ac156052420404563fc175165efbb6"}},{"ruleId":"D2","level":"warning","message":{"text":"selectResult.close (cognitive 16): selectResult.close has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, boolean chains 3, loops 3 (nesting depth added 6). Of this number, 10 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":"pkg/distsql/select_result.go"},"region":{"startLine":776}}}],"partialFingerprints":{"codehealthFindingId/v1":"a352685deeab767690d1a1ab0075eaa524e186cfcf92063be645a16d8c8576a3"}},{"ruleId":"D2","level":"warning","message":{"text":"Domain.Close (cognitive 16): Domain.Close has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, loops 1 (nesting depth added 2). Of this number, 14 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, 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":"pkg/domain/domain.go"},"region":{"startLine":476}}}],"partialFingerprints":{"codehealthFindingId/v1":"743db89812acf61e2d459066a65ba9bfe19dce59e2cb1556ecc992b94f8e99ed"}},{"ruleId":"D2","level":"warning","message":{"text":"Parser.buildRowGroupParser (cognitive 16): Parser.buildRowGroupParser has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, loops 3, match/switch 2 (nesting depth added 6). Most of this is not in the body itself: 4 of the 16 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 373, 384). 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":"pkg/dumpformat/parquetfile/parser.go"},"region":{"startLine":363}}}],"partialFingerprints":{"codehealthFindingId/v1":"8ce28f504a3f00afe83f1023c2f0530f4a4fc2687f77f011b246b439af5b13c1"}},{"ruleId":"D2","level":"warning","message":{"text":"BaseTaskExecutor.runSubtask (cognitive 16): BaseTaskExecutor.runSubtask has cognitive complexity 16 (threshold 15). Drivers by points: if/else 16 (nesting depth added 7). 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":"pkg/dxf/framework/taskexecutor/task_executor.go"},"region":{"startLine":472}}}],"partialFingerprints":{"codehealthFindingId/v1":"5e115835dd5cf72915de735cdc0b90c2c3f43680202de2699d810c93a88aa810"}},{"ruleId":"D2","level":"warning","message":{"text":"importinto.GetRuntimeInfoForJob (cognitive 16): importinto.GetRuntimeInfoForJob has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, boolean chains 1, loops 1, match/switch 1 (nesting depth added 2). 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: 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":"pkg/dxf/importinto/job.go"},"region":{"startLine":296}}}],"partialFingerprints":{"codehealthFindingId/v1":"a66fe66078dea0c6d60baa089b71e633fd61d3d1aee1b07d9625962cc0f51f21"}},{"ruleId":"D2","level":"warning","message":{"text":"importinto.generateImportSpecs (cognitive 16): importinto.generateImportSpecs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, 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":"pkg/dxf/importinto/planner.go"},"region":{"startLine":375}}}],"partialFingerprints":{"codehealthFindingId/v1":"21471c383d686c3112d1f1be5daec42701389f7e41c6dd369b6d32217d3eae53"}},{"ruleId":"D2","level":"warning","message":{"text":"PostProcessSpec.ToSubtaskMeta (cognitive 16): PostProcessSpec.ToSubtaskMeta has cognitive complexity 16 (threshold 15). Drivers by points: loops 8, if/else 7, boolean chains 1 (nesting depth added 6). 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":"pkg/dxf/importinto/planner.go"},"region":{"startLine":305}}}],"partialFingerprints":{"codehealthFindingId/v1":"4d1c4bd016776323f3f357dd5df558cd8d7c6d451f43b5e81bf04a8e130b79cb"}},{"ruleId":"D2","level":"warning","message":{"text":"importStepExecutor.onFinished (cognitive 16): importStepExecutor.onFinished has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, 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":"pkg/dxf/importinto/task_executor.go"},"region":{"startLine":371}}}],"partialFingerprints":{"codehealthFindingId/v1":"c1f2dadb3f95968631b3e10df1bab319b70fd78c05e875c8d7e42a0ce2f1270d"}},{"ruleId":"D2","level":"warning","message":{"text":"executor.readDataAndSendTask (cognitive 16): executor.readDataAndSendTask has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, match/switch 4, loops 3 (nesting depth added 8). Of this number, 9 points are the body\u0027s own statements and 7 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":"pkg/executor/analyze_col_sampling.go"},"region":{"startLine":919}}}],"partialFingerprints":{"codehealthFindingId/v1":"f9b75711bec969d02ca91a3388d920ef8404d699a88fd01aa1efe186febb7660"}},{"ruleId":"D2","level":"warning","message":{"text":"executor.buildIdxColsConcatHandleCols (cognitive 16): executor.buildIdxColsConcatHandleCols has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, loops 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":"pkg/executor/builder.go"},"region":{"startLine":591}}}],"partialFingerprints":{"codehealthFindingId/v1":"b8634f1d2f4564f4e2931b46822faa655a69b155c649451b38f362ca3b8e769b"}},{"ruleId":"D2","level":"warning","message":{"text":"executor.getDbFromResultNode (cognitive 16): executor.getDbFromResultNode has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, match/switch 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":"pkg/executor/compiler.go"},"region":{"startLine":560}}}],"partialFingerprints":{"codehealthFindingId/v1":"dd23ce45738cbeb2bb979a0e7a06571d1ff94e8d6923730b0caffa21876de363"}},{"ruleId":"D2","level":"warning","message":{"text":"CleanupIndexExec.Next (cognitive 16): CleanupIndexExec.Next has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, 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":"pkg/executor/admin.go"},"region":{"startLine":744}}}],"partialFingerprints":{"codehealthFindingId/v1":"dea0fdbe722a7c5489a7155f5de96691cecc22b0d0e44af01f535b045075ca72"}},{"ruleId":"D2","level":"warning","message":{"text":"jsonObjectAgg.UpdatePartialResult (cognitive 16): jsonObjectAgg.UpdatePartialResult has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, match/switch 2, 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":"pkg/executor/aggfuncs/func_json_objectagg.go"},"region":{"startLine":68}}}],"partialFingerprints":{"codehealthFindingId/v1":"cb9ba70b4ade3b606b9af17e97953d4596ba8840dc91bef26b3116aabf3f5ec7"}},{"ruleId":"D2","level":"warning","message":{"text":"sum4Decimal.Slide (cognitive 16): sum4Decimal.Slide has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, 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":"pkg/executor/aggfuncs/func_sum.go"},"region":{"startLine":253}}}],"partialFingerprints":{"codehealthFindingId/v1":"a35f228f062224ef846b5a96868570286b7f9b146a87693b98968a5e3deb5c72"}},{"ruleId":"D2","level":"warning","message":{"text":"AnalyzeExec.saveAnalyzeOptions (cognitive 16): AnalyzeExec.saveAnalyzeOptions has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, loops 4, boolean chains 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":"pkg/executor/analyze.go"},"region":{"startLine":581}}}],"partialFingerprints":{"codehealthFindingId/v1":"f09309682f1ad724aa92c0085e99053be364f1d1bed29d422089001d45c4dbe8"}},{"ruleId":"D2","level":"warning","message":{"text":"executorBuilder.buildCheckTable (cognitive 16): executorBuilder.buildCheckTable has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, loops 4, boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/builder.go"},"region":{"startLine":538}}}],"partialFingerprints":{"codehealthFindingId/v1":"24a11e7f35a8988943dc1ed5b0f5320d235607b48b9feccc0f560761c2fb211f"}},{"ruleId":"D2","level":"warning","message":{"text":"executorBuilder.buildSimple (cognitive 16): executorBuilder.buildSimple has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, loops 3, match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction \u2014 a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full \u2014 so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/builder.go"},"region":{"startLine":947}}}],"partialFingerprints":{"codehealthFindingId/v1":"61eb3ab9aa2f79dd5d74253e0617aedfe4ed273b28d73bfaa60b4cf236897a8f"}},{"ruleId":"D2","level":"warning","message":{"text":"executorBuilder.buildShuffle (cognitive 16): executorBuilder.buildShuffle has cognitive complexity 16 (threshold 15). Drivers by points: loops 11, if/else 4, match/switch 1 (nesting depth added 6). 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":"pkg/executor/builder.go"},"region":{"startLine":5582}}}],"partialFingerprints":{"codehealthFindingId/v1":"4974daa7ea1c51e2911b1305e32a06508451b1263f336e1bf4df018001685f03"}},{"ruleId":"D2","level":"warning","message":{"text":"dataReaderBuilder.prunePartitionForInnerExecutor (cognitive 16): dataReaderBuilder.prunePartitionForInnerExecutor has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, loops 4 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/builder.go"},"region":{"startLine":4250}}}],"partialFingerprints":{"codehealthFindingId/v1":"76e956861eef772ac056a0f94a06e570144ab07f31662cf1db68507489219982"}},{"ruleId":"D2","level":"warning","message":{"text":"dataReaderBuilder.buildIndexReaderForIndexJoin (cognitive 16): dataReaderBuilder.buildIndexReaderForIndexJoin has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/builder.go"},"region":{"startLine":5297}}}],"partialFingerprints":{"codehealthFindingId/v1":"514cc4a0ac98d9ab140c455fcdecca8872bf3dcef6d1e8b4bbd0dd5b633d3373"}},{"ruleId":"D2","level":"warning","message":{"text":"ImportIntoExec.importFromSelect (cognitive 16): ImportIntoExec.importFromSelect has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, match/switch 2, loops 1 (nesting depth added 4). Most of this is not in the body itself: 6 of the 16 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 296, 281). 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":"pkg/executor/import_into.go"},"region":{"startLine":254}}}],"partialFingerprints":{"codehealthFindingId/v1":"d619dd8a4551e0e9008fa3b6d2a4f552f78b86286e7a618bd6e70f4af7a51bf0"}},{"ruleId":"D2","level":"warning","message":{"text":"thresholdCheckInspection.inspectForLeaderDrop (cognitive 16): thresholdCheckInspection.inspectForLeaderDrop has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, loops 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":"pkg/executor/inspection_result.go"},"region":{"startLine":1203}}}],"partialFingerprints":{"codehealthFindingId/v1":"9da495c11c70025f9d6889c78436af7954624deac98734660298977301eef13d"}},{"ruleId":"D2","level":"warning","message":{"text":"ProbeWorkerV2.scanRowTableAfterProbeDone (cognitive 16): ProbeWorkerV2.scanRowTableAfterProbeDone has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, 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":"pkg/executor/join/hash_join_v2.go"},"region":{"startLine":889}}}],"partialFingerprints":{"codehealthFindingId/v1":"525d4c012ca86e49dd4e2d4cebfbf398cc2761ff1fe9d3ed716bf2519c624148"}},{"ruleId":"D2","level":"warning","message":{"text":"LockExec.Next (cognitive 16): LockExec.Next has cognitive complexity 16 (threshold 15). Drivers by points: if/else 16 (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/executor/lockstats/lock_stats_executor.go"},"region":{"startLine":43}}}],"partialFingerprints":{"codehealthFindingId/v1":"8f2c4ade91d7d23df24d4b0bfd9ecfb9a1702bca8ba717e4ad26d05303c7e85c"}},{"ruleId":"D2","level":"warning","message":{"text":"UnlockExec.Next (cognitive 16): UnlockExec.Next has cognitive complexity 16 (threshold 15). Drivers by points: if/else 16 (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/executor/lockstats/unlock_stats_executor.go"},"region":{"startLine":40}}}],"partialFingerprints":{"codehealthFindingId/v1":"5e76ece97368a03874581a9fe1ae72b5df9600b74df60d8faa15117a582edd6d"}},{"ruleId":"D2","level":"warning","message":{"text":"txnMemBufferIter.Valid (cognitive 16): txnMemBufferIter.Valid has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/mem_reader.go"},"region":{"startLine":344}}}],"partialFingerprints":{"codehealthFindingId/v1":"489434b3b45121463a8e49648328c1b8282ee7894647d09782f6ab7fa63c9c72"}},{"ruleId":"D2","level":"warning","message":{"text":"SelectionExec.Next (cognitive 16): SelectionExec.Next has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, loops 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/select.go"},"region":{"startLine":750}}}],"partialFingerprints":{"codehealthFindingId/v1":"23a65043819a8ba98c8d79ba49a4f88f79d3f94c25ab687423a90b392830378d"}},{"ruleId":"D2","level":"warning","message":{"text":"ShowExec.Next (cognitive 16): ShowExec.Next has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, loops 5 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/show.go"},"region":{"startLine":132}}}],"partialFingerprints":{"codehealthFindingId/v1":"f15fa6640863958441c02619f916db906d7541066f9dfca69d64b6c5471f7f76"}},{"ruleId":"D2","level":"warning","message":{"text":"ShowExec.fetchShowStatus (cognitive 16): ShowExec.fetchShowStatus has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, boolean chains 3, match/switch 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":"pkg/executor/show.go"},"region":{"startLine":1008}}}],"partialFingerprints":{"codehealthFindingId/v1":"9474ed45697b670ab6d4ff8b16fda33228094264ce5b27dfbc5eddbdef62727a"}},{"ruleId":"D2","level":"warning","message":{"text":"SimpleExec.executeDropStats (cognitive 16): SimpleExec.executeDropStats has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, loops 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/simple.go"},"region":{"startLine":3532}}}],"partialFingerprints":{"codehealthFindingId/v1":"bc83af7b5ffadbafd9c6f0db3bb2396aa983ae6c748ba96dae1d7920bde1eb2f"}},{"ruleId":"D2","level":"warning","message":{"text":"slowQueryRetriever.initialize (cognitive 16): slowQueryRetriever.initialize has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, 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":"pkg/executor/slow_query.go"},"region":{"startLine":103}}}],"partialFingerprints":{"codehealthFindingId/v1":"42da86e9d5d09dafea7c7e794834e21fcba93ae15a158fd3b4c9a7f20ee9dbad"}},{"ruleId":"D2","level":"warning","message":{"text":"SortExec.fetchChunksUnparallel (cognitive 16): SortExec.fetchChunksUnparallel has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, loops 2 (nesting depth added 5). Of this number, 10 points are the body\u0027s own statements and 6 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":"pkg/executor/sortexec/sort.go"},"region":{"startLine":601}}}],"partialFingerprints":{"codehealthFindingId/v1":"05b3e58c100a2b905a92b96c456692df278ae294fd6854ba619e297f08ebd2db"}},{"ruleId":"D2","level":"warning","message":{"text":"TrafficShowExec.Open (cognitive 16): TrafficShowExec.Open has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, boolean chains 3, loops 3 (nesting depth added 4). Of this number, 14 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, 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/executor/traffic.go"},"region":{"startLine":179}}}],"partialFingerprints":{"codehealthFindingId/v1":"1f156e33add14114cb3f879bb06db000f42b6f28fdd0d262d8068afddd344c7a"}},{"ruleId":"D2","level":"warning","message":{"text":"expression.getInstructions (cognitive 16): expression.getInstructions has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/builtin_regexp.go"},"region":{"startLine":1125}}}],"partialFingerprints":{"codehealthFindingId/v1":"3310566cd2189c96527c30101cf7208556a64be023ce4b62d16bd595cdac4937"}},{"ruleId":"D2","level":"warning","message":{"text":"expression.PBToExpr (cognitive 16): expression.PBToExpr has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, loops 1, match/switch 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":"pkg/expression/distsql_builtin.go"},"region":{"startLine":1218}}}],"partialFingerprints":{"codehealthFindingId/v1":"5b465ab34e5faf1ba93514ea21d79c400a514ce6253cc46b237f2b228f2a8f54"}},{"ruleId":"D2","level":"warning","message":{"text":"arithmeticPlusFunctionClass.getFunction (cognitive 16): arithmeticPlusFunctionClass.getFunction has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, boolean chains 4 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/builtin_arithmetic.go"},"region":{"startLine":170}}}],"partialFingerprints":{"codehealthFindingId/v1":"9cb0b6331acbc92124215548355bef5c3c1253aea5fa2d44fcf0c999876d1606"}},{"ruleId":"D2","level":"warning","message":{"text":"arithmeticMultiplyFunctionClass.getFunction (cognitive 16): arithmeticMultiplyFunctionClass.getFunction has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, boolean chains 4 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/builtin_arithmetic.go"},"region":{"startLine":545}}}],"partialFingerprints":{"codehealthFindingId/v1":"59d750f1fcd155888ebb9c74ac5c2431a5e24dd987fee266d968fa116eb1240b"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinCastDecimalAsIntSig.vecEvalInt (cognitive 16): builtinCastDecimalAsIntSig.vecEvalInt has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, boolean chains 1, 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":"pkg/expression/builtin_cast_vec.go"},"region":{"startLine":1817}}}],"partialFingerprints":{"codehealthFindingId/v1":"ec24b54def11fa19104750406e8f01341637f99c3db83d816d6c631d424bd497"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinCastStringAsDecimalSig.vecEvalDecimal (cognitive 16): builtinCastStringAsDecimalSig.vecEvalDecimal has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, 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":"pkg/expression/builtin_cast_vec.go"},"region":{"startLine":1723}}}],"partialFingerprints":{"codehealthFindingId/v1":"fc694412dfb61a6b04000b4114a8bd3fff82b2de4edcb8251ab4e39165d75a98"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinCastStringAsDurationSig.vecEvalDuration (cognitive 16): builtinCastStringAsDurationSig.vecEvalDuration has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/builtin_cast_vec.go"},"region":{"startLine":1007}}}],"partialFingerprints":{"codehealthFindingId/v1":"7c130178d91cf221622bd79f59b8af5161bf5cf22a9c58153e1c3e6c5c6d4681"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinGreatestTimeSig.vecEvalTime (cognitive 16): builtinGreatestTimeSig.vecEvalTime has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, loops 4, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/builtin_compare_vec.go"},"region":{"startLine":813}}}],"partialFingerprints":{"codehealthFindingId/v1":"93c4bbc3e7034626efe3e9440026fa274e314c4eec4be8596586232d38115ce1"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinLeastTimeSig.vecEvalTime (cognitive 16): builtinLeastTimeSig.vecEvalTime has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, loops 4, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/builtin_compare_vec.go"},"region":{"startLine":854}}}],"partialFingerprints":{"codehealthFindingId/v1":"2e64a75830dd084e4efacb3fc2fb16f84ddb9a1dfee10b3147ca109fda8e23af"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinIntervalIntSig.linearSearch (cognitive 16): builtinIntervalIntSig.linearSearch has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 6, if/else 6, match/switch 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":"pkg/expression/builtin_compare.go"},"region":{"startLine":1261}}}],"partialFingerprints":{"codehealthFindingId/v1":"04fc028244d942f15cdb2c183f385bbc8b9f6027902730ab13a4a83e3f33187a"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinIntervalIntSig.binSearch (cognitive 16): builtinIntervalIntSig.binSearch has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7, boolean chains 6, match/switch 2, 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":"pkg/expression/builtin_compare.go"},"region":{"startLine":1293}}}],"partialFingerprints":{"codehealthFindingId/v1":"bd63c795dd652428bf7808ed82d03d08ae1f23239670c5fb4806f726a46e3a4b"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinJSONArrayInsertSig.evalJSON (cognitive 16): builtinJSONArrayInsertSig.evalJSON has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, 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":"pkg/expression/builtin_json.go"},"region":{"startLine":1372}}}],"partialFingerprints":{"codehealthFindingId/v1":"4ddc4e261667a7671bf30a7d2581d27a1fabd841bec19c44b2824554d528d29a"}},{"ruleId":"D2","level":"warning","message":{"text":"jsonSchemaValidFunctionClass.verifyArgs (cognitive 16): jsonSchemaValidFunctionClass.verifyArgs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, 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":"pkg/expression/builtin_json.go"},"region":{"startLine":2014}}}],"partialFingerprints":{"codehealthFindingId/v1":"a3a354ca6c729028d8b9ad1bdaf484e72a01081298cfb282f76f2f4593ae46ac"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinLockSig.evalInt (cognitive 16): builtinLockSig.evalInt has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, match/switch 3, boolean chains 2 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth \u2014 many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/builtin_miscellaneous.go"},"region":{"startLine":220}}}],"partialFingerprints":{"codehealthFindingId/v1":"4f9b0854618b0e680ae355e52478b811a33ce2407336fb781763562675f16b64"}},{"ruleId":"D2","level":"warning","message":{"text":"inFunctionClass.verifyArgs (cognitive 16): inFunctionClass.verifyArgs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, match/switch 3, boolean chains 1, 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/expression/builtin_other.go"},"region":{"startLine":167}}}],"partialFingerprints":{"codehealthFindingId/v1":"525e33cfebefa0990197d77ace175800684521d883db74821813266fa0658018"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinRegexpLikeFuncSig.vecEvalInt (cognitive 16): builtinRegexpLikeFuncSig.vecEvalInt has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, 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":"pkg/expression/builtin_regexp.go"},"region":{"startLine":276}}}],"partialFingerprints":{"codehealthFindingId/v1":"32964b70f7e5bc871439da8cb21e2d145e4c7b136a5cb8529d177a1c23747ea4"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinLocate3ArgsUTF8Sig.vecEvalInt (cognitive 16): builtinLocate3ArgsUTF8Sig.vecEvalInt 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":"pkg/expression/builtin_string_vec.go"},"region":{"startLine":404}}}],"partialFingerprints":{"codehealthFindingId/v1":"5112c8ab13113168d840d696f75d523ecb896fdde4c3efde6bf8da86fb9363ca"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinMakeSetSig.vecEvalString (cognitive 16): builtinMakeSetSig.vecEvalString has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, loops 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":"pkg/expression/builtin_string_vec.go"},"region":{"startLine":2450}}}],"partialFingerprints":{"codehealthFindingId/v1":"6d20339004f2fcb4ce71ee3530c9bc9fab15640ce3578bef2383a559cdcd9ef9"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinDateSig.vecEvalTime (cognitive 16): builtinDateSig.vecEvalTime has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, boolean chains 2, 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":"pkg/expression/builtin_time_vec.go"},"region":{"startLine":88}}}],"partialFingerprints":{"codehealthFindingId/v1":"7e9bbe08d4a0e5e501576d911d6b0864deab323c4be31c17924f40da9b02e8d7"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinYearWeekWithModeSig.vecEvalInt (cognitive 16): builtinYearWeekWithModeSig.vecEvalInt has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, 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/expression/builtin_time_vec.go"},"region":{"startLine":2207}}}],"partialFingerprints":{"codehealthFindingId/v1":"62dab1660ade4333315b95387ec7413cc508f07b2a3f4e95387a9db1719c4578"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinNowWithArgSig.vecEvalTime (cognitive 16): builtinNowWithArgSig.vecEvalTime 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":"pkg/expression/builtin_time_vec.go"},"region":{"startLine":544}}}],"partialFingerprints":{"codehealthFindingId/v1":"7f64a297784241fc4efe9a3d24fe7e72a1039d80aa49444797b4d3d37c9c27f7"}},{"ruleId":"D2","level":"warning","message":{"text":"builtinAddSubDateDurationAnySig.vecEvalTime (cognitive 16): builtinAddSubDateDurationAnySig.vecEvalTime has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, 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":"pkg/expression/builtin_time_vec.go"},"region":{"startLine":2909}}}],"partialFingerprints":{"codehealthFindingId/v1":"00e5f52b724d371b6d1f90335d62b0eeb68d42aab6e9f2196bdcbb8c18274d2f"}},{"ruleId":"D2","level":"warning","message":{"text":"Column.VecEvalReal (cognitive 16): Column.VecEvalReal has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, loops 5 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/column.go"},"region":{"startLine":367}}}],"partialFingerprints":{"codehealthFindingId/v1":"3f8cb150a6e5fa6043a1fd6a1df1e77d784e46b7a80f4534ef2b2d1115fdd07c"}},{"ruleId":"D2","level":"warning","message":{"text":"Constant.Equals (cognitive 16): Constant.Equals has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 13, if/else 3. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/constant.go"},"region":{"startLine":577}}}],"partialFingerprints":{"codehealthFindingId/v1":"2c40bf0e86cfee668c080a91521bc08aa5355c8ca725851b566cf6647eaff2d1"}},{"ruleId":"D2","level":"warning","message":{"text":"propOuterJoinConstSolver.deriveConds (cognitive 16): propOuterJoinConstSolver.deriveConds has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, 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":"pkg/expression/constant_propagation.go"},"region":{"startLine":846}}}],"partialFingerprints":{"codehealthFindingId/v1":"6b9d4e3ee65d7e72dff55705bbf5f2597f595edaa44be4a0967eeefbabda9e04"}},{"ruleId":"D2","level":"warning","message":{"text":"Schema.IsUnique (cognitive 16): Schema.IsUnique has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, loops 6, jumps 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/schema.go"},"region":{"startLine":163}}}],"partialFingerprints":{"codehealthFindingId/v1":"80b7a8faebdff479551e8de0f2d3912f4fd8592c4f3a3f4c889b351d3b305d9d"}},{"ruleId":"D2","level":"warning","message":{"text":"infoschema.applyExchangeTablePartition (cognitive 16): infoschema.applyExchangeTablePartition has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/infoschema/builder.go"},"region":{"startLine":320}}}],"partialFingerprints":{"codehealthFindingId/v1":"ea3a957ac61798a2a146dbf17d3254babf3b66e1d2fb24281b47f5f17bb6f5f0"}},{"ruleId":"D2","level":"warning","message":{"text":"infoschema.GetStoreServerInfo (cognitive 16): infoschema.GetStoreServerInfo has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, loops 3 (nesting depth added 5). Of this number, 11 points are the body\u0027s own statements and 5 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":"pkg/infoschema/tables.go"},"region":{"startLine":2275}}}],"partialFingerprints":{"codehealthFindingId/v1":"fbe8842e4551a3f313efd496ff9920fec2f32a154ff3a4aa7ef50960844a39cc"}},{"ruleId":"D2","level":"warning","message":{"text":"infoschemaV2.SchemaTableInfos (cognitive 16): infoschemaV2.SchemaTableInfos has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, loops 3, match/switch 3, jumps 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":"pkg/infoschema/infoschema_v2.go"},"region":{"startLine":1089}}}],"partialFingerprints":{"codehealthFindingId/v1":"83f1036de276f46bf5217c295e87b11f3a4558603d80a36b6fa6f77c79a60111"}},{"ruleId":"D2","level":"warning","message":{"text":"infoschemaV2.SchemaSimpleTableInfos (cognitive 16): infoschemaV2.SchemaSimpleTableInfos has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, loops 4, boolean chains 1 (nesting depth added 6). Of this number, 14 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, 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/infoschema/infoschema_v2.go"},"region":{"startLine":1136}}}],"partialFingerprints":{"codehealthFindingId/v1":"6c31e78c899295cff19f60bfbec067fa9da21dc9c5224cfd14f0eab1aaeb2a48"}},{"ruleId":"D2","level":"warning","message":{"text":"Loader.fetchAllSchemasWithTables (cognitive 16): Loader.fetchAllSchemasWithTables has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, loops 1 (nesting depth added 5). Of this number, 14 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, 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/infoschema/issyncer/loader.go"},"region":{"startLine":420}}}],"partialFingerprints":{"codehealthFindingId/v1":"8b79fde251a753406f5ed8a7fdc2fe24481d6de8254d8c6df07f7d1465cd6a27"}},{"ruleId":"D2","level":"warning","message":{"text":"engineManager.resetEngine (cognitive 16): engineManager.resetEngine has cognitive complexity 16 (threshold 15). Drivers by points: if/else 16 (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":"pkg/ingestor/ingestctrl/engine_mgr.go"},"region":{"startLine":389}}}],"partialFingerprints":{"codehealthFindingId/v1":"758a20911293ba3f7495e7efb3462cfa1f0ba289fc84ef131ea9b9563dd44738"}},{"ruleId":"D2","level":"warning","message":{"text":"Backend.prepareAndSendJob (cognitive 16): Backend.prepareAndSendJob has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, match/switch 3, boolean chains 2, loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ingestor/ingestctrl/local.go"},"region":{"startLine":1120}}}],"partialFingerprints":{"codehealthFindingId/v1":"1dac9db3c2d0d23e276d5e210a107af56ca77c65ec5bb0d756eb59ba65582688"}},{"ruleId":"D2","level":"warning","message":{"text":"storeBalancer.runSendToWorker (cognitive 16): storeBalancer.runSendToWorker has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7, match/switch 5, loops 3, boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ingestor/ingestctrl/region_job.go"},"region":{"startLine":1226}}}],"partialFingerprints":{"codehealthFindingId/v1":"57a3982c5232c9002f491084808adf3e8367662dfd0f65678f5e1e4cf8b6adba"}},{"ruleId":"D2","level":"warning","message":{"text":"storeBalancer.pickJob (cognitive 16): storeBalancer.pickJob has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, boolean chains 2, loops 2, jumps 1 (nesting depth added 3). Of this number, 9 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/ingestor/ingestctrl/region_job.go"},"region":{"startLine":1259}}}],"partialFingerprints":{"codehealthFindingId/v1":"52879508a0b67be3e3293601dc2d85d9bc0154e9669c25c8b1ac4eddcf1ca14e"}},{"ruleId":"D2","level":"warning","message":{"text":"common.SkipReadRowCount (cognitive 16): common.SkipReadRowCount has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, loops 4, boolean chains 3 (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":"pkg/lightning/common/util.go"},"region":{"startLine":688}}}],"partialFingerprints":{"codehealthFindingId/v1":"a1582799c647c2aa79f091d45f4651f991a67827922f49fc18d91d1faaf05357"}},{"ruleId":"D2","level":"warning","message":{"text":"mydump.NewCSVParser (cognitive 16): mydump.NewCSVParser has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/lightning/mydump/csv_parser.go"},"region":{"startLine":103}}}],"partialFingerprints":{"codehealthFindingId/v1":"954e12e6ecd123fb77c3ca7584287b4d8044516c896b58ad62ce76f7f2b6269f"}},{"ruleId":"D2","level":"warning","message":{"text":"CSVParser.ReadRow (cognitive 16): CSVParser.ReadRow 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":"pkg/lightning/mydump/csv_parser.go"},"region":{"startLine":632}}}],"partialFingerprints":{"codehealthFindingId/v1":"d4e68e7ce3bcefb84de1fd9893825233acc2d47aa81c24dfb0cf1ecb9559abcd"}},{"ruleId":"D2","level":"warning","message":{"text":"mdLoaderSetup.pruneViewPlaceholders (cognitive 16): mdLoaderSetup.pruneViewPlaceholders has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, loops 6, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/lightning/mydump/loader.go"},"region":{"startLine":843}}}],"partialFingerprints":{"codehealthFindingId/v1":"f637b60715b22c17ae6a3b55c488ac73fb4d445848333ec5556c414fafd64ac8"}},{"ruleId":"D2","level":"warning","message":{"text":"Job.Encode (cognitive 16): Job.Encode has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, loops 3 (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/meta/model/job.go"},"region":{"startLine":600}}}],"partialFingerprints":{"codehealthFindingId/v1":"8934ad0ce28eaa9441c2eb72bfaf9583ca5532ca4c2ff7192633cb5ca2391c2c"}},{"ruleId":"D2","level":"warning","message":{"text":"TablePartitionArgs.decodeV1 (cognitive 16): TablePartitionArgs.decodeV1 has cognitive complexity 16 (threshold 15). Drivers by points: if/else 16 (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":"pkg/meta/model/job_args.go"},"region":{"startLine":450}}}],"partialFingerprints":{"codehealthFindingId/v1":"ee291b742d06bc9d3c774284e3b18303d15c62b507f09a47c08f3e709666dbb2"}},{"ruleId":"D2","level":"warning","message":{"text":"GCSStorage.WalkDir (cognitive 16): GCSStorage.WalkDir has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, boolean chains 2, 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":"pkg/objstore/gcs.go"},"region":{"startLine":321}}}],"partialFingerprints":{"codehealthFindingId/v1":"23c56987200a237187b8cef4e50611e52c18dc72394cf8b852ec25ba14996fd7"}},{"ruleId":"D2","level":"warning","message":{"text":"Storage.WalkDir (cognitive 16): Storage.WalkDir has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, loops 3, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/objstore/s3like/store.go"},"region":{"startLine":425}}}],"partialFingerprints":{"codehealthFindingId/v1":"bf937642175048906f24bc0bfc0df51bd715be04234baddef9150dbfae967843"}},{"ruleId":"D2","level":"warning","message":{"text":"ownerManager.watchOwner (cognitive 16): ownerManager.watchOwner has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, loops 4, match/switch 2 (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/owner/manager.go"},"region":{"startLine":614}}}],"partialFingerprints":{"codehealthFindingId/v1":"7859249ecb5431cf2a093c53657257a41ecaab07cbdd5dc1d31a379df3a9cc3e"}},{"ruleId":"D2","level":"warning","message":{"text":"cardinality.convertRangeFromExpectedCnt (cognitive 16): cardinality.convertRangeFromExpectedCnt has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, loops 4 (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/planner/cardinality/cross_estimation.go"},"region":{"startLine":233}}}],"partialFingerprints":{"codehealthFindingId/v1":"06e0491b5fd45dbd8306d9546ca6d7e39db6b5c2bc39ffd7532c243e4474f7b1"}},{"ruleId":"D2","level":"warning","message":{"text":"cardinality.GetRowCountByColumnRanges (cognitive 16): cardinality.GetRowCountByColumnRanges has cognitive complexity 16 (threshold 15). Drivers by points: if/else 16 (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":"pkg/planner/cardinality/row_count_column.go"},"region":{"startLine":37}}}],"partialFingerprints":{"codehealthFindingId/v1":"7c1cbce2bf2debfcc91e91bcbf10832b8fdf5cc0800305801ed597ac8fad7e86"}},{"ruleId":"D2","level":"warning","message":{"text":"cardinality.equalRowCountOnColumn (cognitive 16): cardinality.equalRowCountOnColumn has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, 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":"pkg/planner/cardinality/row_count_column.go"},"region":{"startLine":72}}}],"partialFingerprints":{"codehealthFindingId/v1":"7fca7ae090989dc403ce4f9274f059768d533e9899154f1e8a54bb750a8f7f77"}},{"ruleId":"D2","level":"warning","message":{"text":"cardinality.getEqualCondSelectivity (cognitive 16): cardinality.getEqualCondSelectivity has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, 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":"pkg/planner/cardinality/selectivity.go"},"region":{"startLine":1080}}}],"partialFingerprints":{"codehealthFindingId/v1":"31d9745d156d9b67a094715c1c34711984cab34931577df2bd147128bc620bfc"}},{"ruleId":"D2","level":"warning","message":{"text":"old.preparePossibleProperties (cognitive 16): old.preparePossibleProperties has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, loops 6, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/cascades/old/optimize.go"},"region":{"startLine":358}}}],"partialFingerprints":{"codehealthFindingId/v1":"166c96d2b6feea8b9d5eacdbd649e2a9285222afc64e6fc175ad8d800cf5c9e8"}},{"ruleId":"D2","level":"warning","message":{"text":"PushSelDownAggregation.OnTransform (cognitive 16): PushSelDownAggregation.OnTransform has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, loops 4, match/switch 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/cascades/old/transformation_rules.go"},"region":{"startLine":605}}}],"partialFingerprints":{"codehealthFindingId/v1":"1174a43f2ef9f16606ee1e79d88d1f59278bda74b3f32b09196fb7a8a960e0af"}},{"ruleId":"D2","level":"warning","message":{"text":"core.buildSimpleExpr (cognitive 16): core.buildSimpleExpr has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, boolean chains 3, loops 2 (nesting depth added 1). Of this number, 13 points are the body\u0027s own statements and 3 belong to one function literal inside it that branches. 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":"pkg/planner/core/expression_rewriter.go"},"region":{"startLine":108}}}],"partialFingerprints":{"codehealthFindingId/v1":"9d6d432b07d3254bbf602154cfdd0c2c64c6edbfc5f3181569cf65d6315044db"}},{"ruleId":"D2","level":"warning","message":{"text":"core.isCandidatesPseudo (cognitive 16): core.isCandidatesPseudo has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, boolean chains 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":"pkg/planner/core/find_best_task.go"},"region":{"startLine":965}}}],"partialFingerprints":{"codehealthFindingId/v1":"3f086e655f14c7354ac0bfd84029c08a3e5466877dc3d6224efd8a7d69714818"}},{"ruleId":"D2","level":"warning","message":{"text":"core.getPruningInfo (cognitive 16): core.getPruningInfo has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, loops 5, boolean chains 1 (nesting depth added 4). Of this number, 13 points are the body\u0027s own statements and 3 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":"pkg/planner/core/find_best_task.go"},"region":{"startLine":1945}}}],"partialFingerprints":{"codehealthFindingId/v1":"973538fce4afd594827ce4b38b1b4bbecf5c71d38c643f429d5d765d082bbbc2"}},{"ruleId":"D2","level":"warning","message":{"text":"core.mergeANDItemIntoUnfinishedIndexMergePath (cognitive 16): core.mergeANDItemIntoUnfinishedIndexMergePath has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, 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":"pkg/planner/core/indexmerge_unfinished_path.go"},"region":{"startLine":308}}}],"partialFingerprints":{"codehealthFindingId/v1":"63f09077e43ecf84939f34a6c4e85a7231c97aed1058ad1d8824adf97736f0ea"}},{"ruleId":"D2","level":"warning","message":{"text":"core.checkExprInGroupByOrIsSingleValue (cognitive 16): core.checkExprInGroupByOrIsSingleValue has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, 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":"pkg/planner/core/logical_plan_builder.go"},"region":{"startLine":3695}}}],"partialFingerprints":{"codehealthFindingId/v1":"784bdca5c77116e9df2ee4180bc8606e869bd66b68e85dd23c9e9ec9ee954341"}},{"ruleId":"D2","level":"warning","message":{"text":"core.hashInt64Uint64Map (cognitive 16): core.hashInt64Uint64Map has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, loops 6 (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":"pkg/planner/core/plan_cache_utils.go"},"region":{"startLine":255}}}],"partialFingerprints":{"codehealthFindingId/v1":"24f39f5db1524a41a2fdb94d10cb977e7ec8b4cd4613a291ec6729ffc2390aae"}},{"ruleId":"D2","level":"warning","message":{"text":"core.fetchRecordFromClusterStmtSummary (cognitive 16): core.fetchRecordFromClusterStmtSummary has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, 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":"pkg/planner/core/planbuilder.go"},"region":{"startLine":935}}}],"partialFingerprints":{"codehealthFindingId/v1":"2af3f4eb45f2d27a7df3c00498864378818c0bc2872e55e69ea90c22620fc7be"}},{"ruleId":"D2","level":"warning","message":{"text":"core.checkAlterDDLJobOptValue (cognitive 16): core.checkAlterDDLJobOptValue 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":"pkg/planner/core/planbuilder.go"},"region":{"startLine":6364}}}],"partialFingerprints":{"codehealthFindingId/v1":"cb220ccdced309b10e57dfe532ac9563c321a9bc78379ad66c1755d976ff5693"}},{"ruleId":"D2","level":"warning","message":{"text":"core.checkNextGenS3PathWithSem (cognitive 16): core.checkNextGenS3PathWithSem has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 5, if/else 5, loops 4, match/switch 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":"pkg/planner/core/planbuilder.go"},"region":{"startLine":6401}}}],"partialFingerprints":{"codehealthFindingId/v1":"3f097660b820882fc9701592d6dc13ae296b2ffd5ea2accde88c08b757015e04"}},{"ruleId":"D2","level":"warning","message":{"text":"core.sinkIntoIndexMerge (cognitive 16): core.sinkIntoIndexMerge has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, loops 2, boolean chains 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":"pkg/planner/core/task.go"},"region":{"startLine":789}}}],"partialFingerprints":{"codehealthFindingId/v1":"c38dfea93119e39063e94c9727c39e6f8d62c8400edf64b0dc78c73e98321830"}},{"ruleId":"D2","level":"warning","message":{"text":"Explain.prepareTaskDot (cognitive 16): Explain.prepareTaskDot has cognitive complexity 16 (threshold 15). Drivers by points: loops 8, if/else 6, match/switch 2 (nesting depth added 7). 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":"pkg/planner/core/common_plans.go"},"region":{"startLine":1360}}}],"partialFingerprints":{"codehealthFindingId/v1":"462c65680c849c9d82ddb61bd340fc8d0913e370f8041ea99e31707bffb9e232"}},{"ruleId":"D2","level":"warning","message":{"text":"FlatPlanTree.GetSelectPlan (cognitive 16): FlatPlanTree.GetSelectPlan has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 7, loops 5, if/else 4 (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/planner/core/flat_plan.go"},"region":{"startLine":68}}}],"partialFingerprints":{"codehealthFindingId/v1":"8f34e9bf40c381ec18555d20b132286f9bdb5cb6c9eb4f904e001f5fe9c9c8c1"}},{"ruleId":"D2","level":"warning","message":{"text":"ConflictDetector.buildRecursive (cognitive 16): ConflictDetector.buildRecursive has cognitive complexity 16 (threshold 15). Drivers by points: if/else 16 (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":"pkg/planner/core/joinorder/conflict_detector.go"},"region":{"startLine":292}}}],"partialFingerprints":{"codehealthFindingId/v1":"149f61336719936fdf00ea80033621324c9c1b0ea8885fe4ad3662c43ebc8ce5"}},{"ruleId":"D2","level":"warning","message":{"text":"joinorder.buildBushyTreeFromDP (cognitive 16): joinorder.buildBushyTreeFromDP has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, loops 3, boolean chains 1 (nesting depth added 4). Of this number, 14 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, 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/planner/core/joinorder/join_order.go"},"region":{"startLine":884}}}],"partialFingerprints":{"codehealthFindingId/v1":"0860b2d67c9176b2d988e8acab0c86607c8476e5262acf938e9fd347392954c0"}},{"ruleId":"D2","level":"warning","message":{"text":"physicalop.findBestTask4LogicalCTE (cognitive 16): physicalop.findBestTask4LogicalCTE has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/operator/physicalop/physical_cte.go"},"region":{"startLine":245}}}],"partialFingerprints":{"codehealthFindingId/v1":"d26a79151289a8ef1c5852fe3c13fb9c71002b871c6b85a93a1011ea50017998"}},{"ruleId":"D2","level":"warning","message":{"text":"PhysicalExpand.ResolveIndicesItself (cognitive 16): PhysicalExpand.ResolveIndicesItself has cognitive complexity 16 (threshold 15). Drivers by points: loops 9, if/else 7 (nesting depth added 9). 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":"pkg/planner/core/operator/physicalop/physical_expand.go"},"region":{"startLine":163}}}],"partialFingerprints":{"codehealthFindingId/v1":"eb854034a6d17dde714f44818b5e06ea22544ce37c2791a489e8b5fb4c8ac84a"}},{"ruleId":"D2","level":"warning","message":{"text":"PhysicalHashAgg.ToPB (cognitive 16): PhysicalHashAgg.ToPB has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/operator/physicalop/physical_hash_agg.go"},"region":{"startLine":337}}}],"partialFingerprints":{"codehealthFindingId/v1":"efae457a01e8565c306efd003bd0a5719914998d98250e5917a9be9c07a42d90"}},{"ruleId":"D2","level":"warning","message":{"text":"PlanBuilder.buildAdmin (cognitive 16): PlanBuilder.buildAdmin has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, loops 4, match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction \u2014 a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full \u2014 so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/planbuilder.go"},"region":{"startLine":1667}}}],"partialFingerprints":{"codehealthFindingId/v1":"6bc5e858e54d2b93bd239bf2888353f977fc37ce7c2ed14e79a9256d50e89296"}},{"ruleId":"D2","level":"warning","message":{"text":"preprocessor.checkBindGrammar (cognitive 16): preprocessor.checkBindGrammar has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, boolean chains 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/preprocess.go"},"region":{"startLine":579}}}],"partialFingerprints":{"codehealthFindingId/v1":"c2ea04f7b31e655f4b30b375fb379142c8810454dab480ee2e6a5b6118f2889b"}},{"ruleId":"D2","level":"warning","message":{"text":"rule.updateOrPredicate (cognitive 16): rule.updateOrPredicate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, boolean chains 7. 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":"pkg/planner/core/rule/rule_predicate_simplification.go"},"region":{"startLine":390}}}],"partialFingerprints":{"codehealthFindingId/v1":"b275b60bca5e6360a2f595e4b6ca265dab148eeb5491121a1d05d43acb444896"}},{"ruleId":"D2","level":"warning","message":{"text":"AggregationPushDownSolver.collectAggFuncs (cognitive 16): AggregationPushDownSolver.collectAggFuncs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, match/switch 5, boolean chains 2, 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":"pkg/planner/core/rule_aggregation_push_down.go"},"region":{"startLine":103}}}],"partialFingerprints":{"codehealthFindingId/v1":"aba2a3642f4f9c5e57d3b2ac5fcbe1292055635c7f3981ec1a99f6b8590039b8"}},{"ruleId":"D2","level":"warning","message":{"text":"AggregationPushDownSolver.tryToPushDownAgg (cognitive 16): AggregationPushDownSolver.tryToPushDownAgg has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, boolean chains 6, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/rule_aggregation_push_down.go"},"region":{"startLine":253}}}],"partialFingerprints":{"codehealthFindingId/v1":"27159174ef362e15eef8bfdac975bdaa227d9e7d3ea4f263531419ad8544aff1"}},{"ruleId":"D2","level":"warning","message":{"text":"OuterJoinEliminator.isInnerJoinKeysContainIndex (cognitive 16): OuterJoinEliminator.isInnerJoinKeysContainIndex has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, loops 3, boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/rule_join_elimination.go"},"region":{"startLine":275}}}],"partialFingerprints":{"codehealthFindingId/v1":"a9e18e6ca7fc1412f29fd9c2ad784cb2b80871f6608e16b8d5b26ca0616c8bae"}},{"ruleId":"D2","level":"warning","message":{"text":"FDSet.AddConstants (cognitive 16): FDSet.AddConstants has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, 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":"pkg/planner/funcdep/fd_graph.go"},"region":{"startLine":429}}}],"partialFingerprints":{"codehealthFindingId/v1":"3ebd0d2ed16f5cf0dd6143032eabf56fba8d4de3633c33b117adca9d13e80737"}},{"ruleId":"D2","level":"warning","message":{"text":"indexadvisor.FilterSQLAccessingSystemTables (cognitive 16): indexadvisor.FilterSQLAccessingSystemTables has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, loops 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":"pkg/planner/indexadvisor/utils.go"},"region":{"startLine":327}}}],"partialFingerprints":{"codehealthFindingId/v1":"6ee85983e8cb224fe44d440acdc52f77f7e28074b3ed340c71aed8b482544c99"}},{"ruleId":"D2","level":"warning","message":{"text":"util.indexInfo2ColsImpl (cognitive 16): util.indexInfo2ColsImpl has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, 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":"pkg/planner/util/column.go"},"region":{"startLine":46}}}],"partialFingerprints":{"codehealthFindingId/v1":"f66b7f44e4d2e323549932bc9312116605b6ed7f19b9aa0a18d1e473498be2da"}},{"ruleId":"D2","level":"warning","message":{"text":"privileges.findUserAndAllRoles (cognitive 16): privileges.findUserAndAllRoles has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, loops 8 (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/privilege/privileges/cache.go"},"region":{"startLine":518}}}],"partialFingerprints":{"codehealthFindingId/v1":"5a4e9232fd8b9be54b75ef6a9962bc3c2f2ff173ee729514aa125cb26c45cfe7"}},{"ruleId":"D2","level":"warning","message":{"text":"MySQLPrivilege.MatchColumns (cognitive 16): MySQLPrivilege.MatchColumns has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, loops 5 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/privilege/privileges/cache.go"},"region":{"startLine":1559}}}],"partialFingerprints":{"codehealthFindingId/v1":"a6f89ad3b3900f5cf694c7898c82c5732ead6cee84f7aaf507226df6fb8b2e7b"}},{"ruleId":"D2","level":"warning","message":{"text":"clientConn.handleStmtFetch (cognitive 16): clientConn.handleStmtFetch has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, boolean chains 1 (nesting depth added 3). Of this number, 13 points are the body\u0027s own statements and 3 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":"pkg/server/conn_stmt.go"},"region":{"startLine":526}}}],"partialFingerprints":{"codehealthFindingId/v1":"bc41f8f0af0218a48827568adcb286bdc667c10a4c51968d38105e89c02f95e7"}},{"ruleId":"D2","level":"warning","message":{"text":"TiDBContext.EncodeSessionStates (cognitive 16): TiDBContext.EncodeSessionStates has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, loops 5 (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":"pkg/server/driver_tidb.go"},"region":{"startLine":452}}}],"partialFingerprints":{"codehealthFindingId/v1":"b819ea26cec15169e68ab5670ff3c13c027fde8e95952303b30968176bf8a636"}},{"ruleId":"D2","level":"warning","message":{"text":"optimizor.loadSchemaMeta (cognitive 16): optimizor.loadSchemaMeta has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, loops 4 (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/server/handler/optimizor/plan_replayer.go"},"region":{"startLine":274}}}],"partialFingerprints":{"codehealthFindingId/v1":"b76fdf862d6db4c14e8e88cdf262c09079d8a0c3e5b0ef3bd97d0d313e1266d8"}},{"ruleId":"D2","level":"warning","message":{"text":"session.checkUpdateShardColumn (cognitive 16): session.checkUpdateShardColumn has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, boolean chains 5, loops 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/session/nontransactional.go"},"region":{"startLine":161}}}],"partialFingerprints":{"codehealthFindingId/v1":"97f0dd85ebf2c84d49eca1bcee1915932bc999a4e45814abcdd1026a26b62180"}},{"ruleId":"D2","level":"warning","message":{"text":"session.DecodeStates (cognitive 16): session.DecodeStates has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, loops 2, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/session/session.go"},"region":{"startLine":5712}}}],"partialFingerprints":{"codehealthFindingId/v1":"b68e09da5ec748f1aef8bbe28593fef44e99443a9683d2094d5b30d790467448"}},{"ruleId":"D2","level":"warning","message":{"text":"storage.HistogramFromStorageWithPriority (cognitive 16): storage.HistogramFromStorageWithPriority has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, boolean chains 1, loops 1, match/switch 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":"pkg/statistics/handle/storage/read.go"},"region":{"startLine":112}}}],"partialFingerprints":{"codehealthFindingId/v1":"32165edeafa0e9619cac0dd4d817982b561a1a56e7bb8b983449cdcfdb64ca50"}},{"ruleId":"D2","level":"warning","message":{"text":"util.UpdateSCtxVarsForStats (cognitive 16): util.UpdateSCtxVarsForStats has cognitive complexity 16 (threshold 15). Drivers by points: if/else 16. 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":"pkg/statistics/handle/util/util.go"},"region":{"startLine":103}}}],"partialFingerprints":{"codehealthFindingId/v1":"a570d53143834ea9a3422d2b53328400bd443a5a3c7391b0267648a1499a0afd"}},{"ruleId":"D2","level":"warning","message":{"text":"Histogram.OutOfRangeShape (cognitive 16): Histogram.OutOfRangeShape has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, boolean chains 3 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/statistics/histogram.go"},"region":{"startLine":1144}}}],"partialFingerprints":{"codehealthFindingId/v1":"7402459614a69e7a2e769834f665ffc1381ebd2b9cb21c303becd19e1fda8ec8"}},{"ruleId":"D2","level":"warning","message":{"text":"batchCopIterator.handleStreamedBatchCopResponse (cognitive 16): batchCopIterator.handleStreamedBatchCopResponse has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/store/copr/batch_coprocessor.go"},"region":{"startLine":1508}}}],"partialFingerprints":{"codehealthFindingId/v1":"137fd9e26b61da5e8f2172168e19fd6708389180c3c3bacdbacd20e1ae14020e"}},{"ruleId":"D2","level":"warning","message":{"text":"Helper.GetMvccByStartTs (cognitive 16): Helper.GetMvccByStartTs 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":"pkg/store/helper/helper.go"},"region":{"startLine":248}}}],"partialFingerprints":{"codehealthFindingId/v1":"5879cf3630d05e27a7e41ecd99b24dd9aeac9eb19de7319a0a231a5e9f1a6da6"}},{"ruleId":"D2","level":"warning","message":{"text":"MemStore.DeleteWithHint (cognitive 16): MemStore.DeleteWithHint has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, loops 3, boolean chains 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":"pkg/store/mockstore/unistore/lockstore/lockstore.go"},"region":{"startLine":438}}}],"partialFingerprints":{"codehealthFindingId/v1":"2efc4d6cc4ed06d04a470100ed6d5bc5087ef16458f16ee2741b3f98f2dba1ed"}},{"ruleId":"D2","level":"warning","message":{"text":"tables.getRangeLocateExprs (cognitive 16): tables.getRangeLocateExprs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, loops 4 (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":"pkg/table/tables/partition.go"},"region":{"startLine":787}}}],"partialFingerprints":{"codehealthFindingId/v1":"912dc64b64ca7b2ca1cd4f7466f43d5283834a5454279f37925c493ed6b23b6f"}},{"ruleId":"D2","level":"warning","message":{"text":"partitionedTable.RemoveRecord (cognitive 16): partitionedTable.RemoveRecord has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/table/tables/partition.go"},"region":{"startLine":1848}}}],"partialFingerprints":{"codehealthFindingId/v1":"9c990010c827b6378f5ce326aa938e31e16a3ec584dd9ef8ec3e8b8779c4ff06"}},{"ruleId":"D2","level":"warning","message":{"text":"ForListPruning.LocatePartitionByRange (cognitive 16): ForListPruning.LocatePartitionByRange has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, boolean chains 3 (nesting depth added 1). Of this number, 14 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, 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":"pkg/table/tables/partition.go"},"region":{"startLine":1057}}}],"partialFingerprints":{"codehealthFindingId/v1":"52f77ddb43f12510d496dcb48e7d5867fd34b575eea10ba2315764af0c535c50"}},{"ruleId":"D2","level":"warning","message":{"text":"ttlworker.validateTTLWork (cognitive 16): ttlworker.validateTTLWork has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, boolean chains 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":"pkg/ttl/ttlworker/session.go"},"region":{"startLine":286}}}],"partialFingerprints":{"codehealthFindingId/v1":"3e8d87ddfaa522fb016fc91a2afd708156a2ab9d5685467df8959141966eedf4"}},{"ruleId":"D2","level":"warning","message":{"text":"JobManager.checkFinishedJob (cognitive 16): JobManager.checkFinishedJob has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, loops 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":"pkg/ttl/ttlworker/job_manager.go"},"region":{"startLine":572}}}],"partialFingerprints":{"codehealthFindingId/v1":"7fc98a94fb5769aecd54c921f19bf8931bbc89114474e6ce0af6780bdde0395d"}},{"ruleId":"D2","level":"warning","message":{"text":"Chunk.swapColumn (cognitive 16): Chunk.swapColumn has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, loops 6, boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/util/chunk/chunk.go"},"region":{"startLine":257}}}],"partialFingerprints":{"codehealthFindingId/v1":"71bb9140a8a59d763b8bb22e6781f6ce5a19beb272dc7070b2759383840c7999"}},{"ruleId":"D2","level":"warning","message":{"text":"Column.reconstruct (cognitive 16): Column.reconstruct has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, loops 4 (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/util/chunk/column.go"},"region":{"startLine":802}}}],"partialFingerprints":{"codehealthFindingId/v1":"c14405dcc0988134590ebe0d0c8fb950bdcc2d646f8e1a9fbc79b285ecf2d7e8"}},{"ruleId":"D2","level":"warning","message":{"text":"DiskSorter.init (cognitive 16): DiskSorter.init has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, loops 2 (nesting depth added 5). 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, 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/util/extsort/disk_sorter.go"},"region":{"startLine":808}}}],"partialFingerprints":{"codehealthFindingId/v1":"b3d001b24dfce9a194ff57c96b1b72b574a392ce12873fa8167689531f413621"}},{"ruleId":"D2","level":"warning","message":{"text":"logutil.InitLogger (cognitive 16): logutil.InitLogger has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, boolean chains 3 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/util/logutil/log.go"},"region":{"startLine":131}}}],"partialFingerprints":{"codehealthFindingId/v1":"f8383560055439b0b8ebd8dfbb0a52ed61fc7e1f6ea712ce611e3384746534bb"}},{"ruleId":"D2","level":"warning","message":{"text":"memory.SetGlobalMemArbitratorWorkMode (cognitive 16): memory.SetGlobalMemArbitratorWorkMode has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, loops 3, match/switch 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":"pkg/util/memory/global_arbitrator.go"},"region":{"startLine":371}}}],"partialFingerprints":{"codehealthFindingId/v1":"bf21e68fc6eb0d425bdcfc2e27fa3d7e4df87564dd37f5d708a57542d47d0662"}},{"ruleId":"D2","level":"warning","message":{"text":"runtimeMemStateRecorder.Load (cognitive 16): runtimeMemStateRecorder.Load has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/util/memory/global_arbitrator.go"},"region":{"startLine":579}}}],"partialFingerprints":{"codehealthFindingId/v1":"b30eca9cd245d87a0a071ddc6aae4341c881bb0f9f2ba0aa497c4746122c219c"}},{"ruleId":"D2","level":"warning","message":{"text":"validator.ValidatePasswordMediumPolicy (cognitive 16): validator.ValidatePasswordMediumPolicy has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, 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":"pkg/util/password-validation/password_validation.go"},"region":{"startLine":95}}}],"partialFingerprints":{"codehealthFindingId/v1":"baa138d8e6c8ff26aa1f4e7e25cc16fe2b3f0f51b59553c0a6fa3cff81988acf"}},{"ruleId":"D2","level":"warning","message":{"text":"plancodec.calculateMaxFieldLens (cognitive 16): plancodec.calculateMaxFieldLens has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, loops 4 (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":"pkg/util/plancodec/binary_plan_decode.go"},"region":{"startLine":173}}}],"partialFingerprints":{"codehealthFindingId/v1":"9717d7f06c92f21f7c23ba3619943d3fce93cd2b238d546b88acffa2c249804d"}},{"ruleId":"D2","level":"warning","message":{"text":"planDecoder.buildPlanTree (cognitive 16): planDecoder.buildPlanTree has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, loops 5 (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/util/plancodec/codec.go"},"region":{"startLine":124}}}],"partialFingerprints":{"codehealthFindingId/v1":"a58c30f9b03f81364187c91972c65791cce1b36eff8a84a3bed827c1442d06ec"}},{"ruleId":"D2","level":"warning","message":{"text":"ranger.extractValueInfo (cognitive 16): ranger.extractValueInfo has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, boolean chains 2 (nesting depth added 8). 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, 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/util/ranger/detacher.go"},"region":{"startLine":696}}}],"partialFingerprints":{"codehealthFindingId/v1":"531a063d98f245767da8691351bf6f01ee58e5140c6f22396e8d6aa41667632c"}},{"ruleId":"D2","level":"warning","message":{"text":"ranger.compareLexicographically (cognitive 16): ranger.compareLexicographically has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, boolean chains 1, loops 1, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/util/ranger/types.go"},"region":{"startLine":430}}}],"partialFingerprints":{"codehealthFindingId/v1":"6c219c99a8f7ae76d5b13409e804451c9808c245656b55c8e54a77833a68d483"}},{"ruleId":"D2","level":"warning","message":{"text":"Range.isPoint (cognitive 16): Range.isPoint has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, boolean chains 3, 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/util/ranger/types.go"},"region":{"startLine":119}}}],"partialFingerprints":{"codehealthFindingId/v1":"83f6c902310ef88aaa30242cba9dc291765191ed54561c5dc5311be70d5d6acd"}},{"ruleId":"D2","level":"warning","message":{"text":"Range.IntersectRange (cognitive 16): Range.IntersectRange has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, boolean chains 4. 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":"pkg/util/ranger/types.go"},"region":{"startLine":572}}}],"partialFingerprints":{"codehealthFindingId/v1":"ecc00faa57d980a4c68223819628c02e85bf641663212b6d2e4a3d5d1e48914e"}},{"ruleId":"D2","level":"warning","message":{"text":"row.findColID (cognitive 16): row.findColID has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, loops 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/util/rowcodec/row.go"},"region":{"startLine":190}}}],"partialFingerprints":{"codehealthFindingId/v1":"b72aaeba006cbf4869bf135f00917a3428ecb95edb830654c7c50baf1ab4be6b"}},{"ruleId":"D2","level":"warning","message":{"text":"SQLKiller.HandleSignal (cognitive 16): SQLKiller.HandleSignal has cognitive complexity 16 (threshold 15). Drivers by points: if/else 16 (nesting depth added 7). Of this number, 10 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":"pkg/util/sqlkiller/sqlkiller.go"},"region":{"startLine":196}}}],"partialFingerprints":{"codehealthFindingId/v1":"038f60b2418370102d6d427c92c3f96c9492e6fe1c8936e2d1a30acf7d394943"}},{"ruleId":"D2","level":"warning","message":{"text":"MemReader.Rows (cognitive 16): MemReader.Rows has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, loops 5 (nesting depth added 6). Most of this is not in the body itself: 6 of the 16 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 129, 113). 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":"pkg/util/stmtsummary/v2/reader.go"},"region":{"startLine":93}}}],"partialFingerprints":{"codehealthFindingId/v1":"d0d9de497375030d32a29e5f7275b64dacbb378b5cfa7526546b6bae004edced"}},{"ruleId":"D2","level":"warning","message":{"text":"timeutil.InferSystemTZ (cognitive 16): timeutil.InferSystemTZ has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, boolean chains 1, match/switch 1 (nesting depth added 9). The drivers above price the dispatch low by construction \u2014 a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full \u2014 so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/util/timeutil/time_zone.go"},"region":{"startLine":76}}}],"partialFingerprints":{"codehealthFindingId/v1":"38de19e90edf166a68448c5313b3a748df38812f2ab5b83f9f0e17cb25375ca0"}},{"ruleId":"D2","level":"warning","message":{"text":"DefaultDataSinkRegisterer.Deregister (cognitive 16): DefaultDataSinkRegisterer.Deregister has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, boolean chains 1, match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction \u2014 a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full \u2014 so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/util/topsql/reporter/datasink.go"},"region":{"startLine":122}}}],"partialFingerprints":{"codehealthFindingId/v1":"7c75027bb637a3213063c1e1f8aa3e37ef32242cf8aa6616727722885580c5f8"}},{"ruleId":"D2","level":"warning","message":{"text":"workloadrepo.generatePartitionRanges (cognitive 16): workloadrepo.generatePartitionRanges 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":"pkg/util/workloadrepo/utils.go"},"region":{"startLine":50}}}],"partialFingerprints":{"codehealthFindingId/v1":"7305645fdb05ecb08fa5c8b12dde7fef2ba5077a43eafe353577967a1697b1d3"}},{"ruleId":"D2","level":"warning","message":{"text":"workloadlearning.extractPartialMetricsFromChildrenIndexMerge (cognitive 16): workloadlearning.extractPartialMetricsFromChildrenIndexMerge has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, loops 3, boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/workloadlearning/handle.go"},"region":{"startLine":609}}}],"partialFingerprints":{"codehealthFindingId/v1":"60e896970ed0d3330fe90e19c57bd76de32722014d0962ca4d725328351a85af"}},{"ruleId":"D2","level":"warning","message":{"text":"ShowStmt.Accept (cognitive 16): ShowStmt.Accept has cognitive complexity 16 (threshold 15). Drivers by points: if/else 16 (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":"pkg/parser/ast/dml.go"},"region":{"startLine":3672}}}],"partialFingerprints":{"codehealthFindingId/v1":"5b721e41bb23f9b8d1f6b5bcaa2afece3a8af97679e10e0dd9545c5e201e44cb"}},{"ruleId":"D2","level":"warning","message":{"text":"CreateBindingStmt.Restore (cognitive 16): CreateBindingStmt.Restore has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, 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":"pkg/parser/ast/misc.go"},"region":{"startLine":2298}}}],"partialFingerprints":{"codehealthFindingId/v1":"f106986657ad8bb4612bc11755d6c25fb3efb3150e590164795b6462ec50f0e1"}},{"ruleId":"D2","level":"warning","message":{"text":"charset.peek (cognitive 16): charset.peek has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, boolean chains 6, match/switch 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":"pkg/parser/charset/encoding_gb18030.go"},"region":{"startLine":55}}}],"partialFingerprints":{"codehealthFindingId/v1":"7e37cacc419a30666d9b71e4d10c4d9a466edfd6e8364a892edfbde074d0bce3"}},{"ruleId":"D2","level":"warning","message":{"text":"main.checkInconsistencyInYaccParser (cognitive 16): main.checkInconsistencyInYaccParser has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, match/switch 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/parser/goyacc/format_yacc.go"},"region":{"startLine":547}}}],"partialFingerprints":{"codehealthFindingId/v1":"d708b5f3eb0644117c1286fd01ea65d6874a1d8a1baf5b6de408f469e416b625"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: core/logical_plan_builder.go: FileTooLong \u2014 5121 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/planner/core/logical_plan_builder.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"61d9a0db74e43090064406b7f5fe36cd640b0112b2094dcf430f6ef666198048"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: ddl/executor.go: FileTooLong \u2014 5094 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/ddl/executor.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"d2514ea53f128ec2df75854e24d12c7c4bbb2b3429107b1b6cff9af245335e47"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: expression/builtin_time.go: FileTooLong \u2014 4504 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/expression/builtin_time.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"24653bb279f9a7fa231bbbd8ff2cce6615f09652adc360f8654da3e0d6966d5e"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: core/planbuilder.go: FileTooLong \u2014 4449 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/planner/core/planbuilder.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"f4fcf5619e27f587fbbb7e3f68fdc4ecf1dc75bc3e204b40ebd3da9bce97817b"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: executor/builder.go: FileTooLong \u2014 4421 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/executor/builder.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"64938cce0a7ff6c46b6260dce03a9482c841ba0dfcfefce7f4cc628a0c3bec8d"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: ast/ddl.go: FileTooLong \u2014 3699 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/parser/ast/ddl.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"0d363ebe99fad07a61e932710e72c971ead77a21951a99d92ff457f4327e88e1"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: session/session.go: FileTooLong \u2014 3643 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/session/session.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"aac5d7d2605ed4027e898a9b98f8c8e6394d0d6237d8b0b9430ec205af1edc6d"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: ddl/partition.go: FileTooLong \u2014 3302 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/ddl/partition.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"6a5ab46119f218889c032c8fcfe45afdb6c7147cc14c68088c6fa2751d188b95"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: variable/sysvar.go: FileTooLong \u2014 3129 significant lines (blank, comment-only and punctuation-only lines excluded), about 94% of them inside a single declaration: defaultSysVars (143-4117). Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body \u2014 the parts that share the same inputs and are named together \u2014 into its own unit in a sibling file, and have the original call them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/sessionctx/variable/sysvar.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"6df12f3968c1f4e8ccc6257a608097652464c633b01e386acb28442902b60fa2"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: executor/infoschema_reader.go: FileTooLong \u2014 3116 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/executor/infoschema_reader.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"87581a2591fee3f2fa9d86044140add37c8555ef54c5a49b726159aa99a1e5c0"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: ast/misc.go: FileTooLong \u2014 3049 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/parser/ast/misc.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"9861a4e570524152efbc4c2dce3fe2a206be1240f81310739154ec0424040376"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: PlanBuilder: TooManyMethods \u2014 180 methods, declared across 4 files: core/logical_plan_builder.go (89), core/planbuilder.go (86), core/expression_rewriter.go (4), core/subquery_plan_builder.go (1). That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/planbuilder.go"},"region":{"startLine":208}}}],"partialFingerprints":{"codehealthFindingId/v1":"27b4058ccbbb2086f9930e2c33550bf4862f89fab925c5d82eedff48aecf95d0"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: ast/dml.go: FileTooLong \u2014 2802 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/parser/ast/dml.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"381626824be6f8c8669729f0517dd166d01b8d60dc67ff70fa8e875e83187c4f"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: ddl/index.go: FileTooLong \u2014 2787 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/ddl/index.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"f66172148866ebb015830c0e4d11ae76edb5cbeaee4f2e5a25bba2385612d003"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: expression/builtin_string.go: FileTooLong \u2014 2745 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/expression/builtin_string.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"9b4ba305ed5ff79be2809ec394e5b8de1f9d891a4ab6864c86b046b29bcec9db"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: infoschema/metric_table_def.go: FileTooLong \u2014 2506 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: MetricTableMap (19-3180). Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body \u2014 the parts that share the same inputs and are named together \u2014 into its own unit in a sibling file, and have the original call them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/infoschema/metric_table_def.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"454d343dcd1eb5dbdb9c14df09431f00e0049f2c008119c980f858d8a6591dec"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: Domain: TooManyMethods \u2014 149 methods, declared across 7 files: domain/domain.go (125), domain/domain_sysvars.go (8), domain/sysvar_cache.go (6), domain/test_helper.go (5), \u002B3 more file(s). That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/domain/domain.go"},"region":{"startLine":149}}}],"partialFingerprints":{"codehealthFindingId/v1":"33f08d470c4b46292bdf7e1c67ad0c3ee560ec24d50f4aea276dbac57f219d8b"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: session: TooManyMethods \u2014 146 methods, declared across 2 files: session/session.go (143), session/txn.go (3). 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":"pkg/session/session.go"},"region":{"startLine":194}}}],"partialFingerprints":{"codehealthFindingId/v1":"41403df477e3a2122fd4379eb1b91f300192f6b4c9d88e10a96e1513a107cba5"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: executor/simple.go: FileTooLong \u2014 2377 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/executor/simple.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"69ea3e4a61c8d3b8c45ca774ad3584d85bd3860309cd292d40d99cf144718042"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: testserverclient/server_client.go: FileTooLong \u2014 2327 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/server/internal/testserverclient/server_client.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"8fee5b76e6e042f9dde104334c9072e9622a29e78334bebb4fcd0cf5822ca88f"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: infoschema/tables.go: FileTooLong \u2014 2227 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/infoschema/tables.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"5760421a4e75d9a7607cb55c9119f2da69f9d49084b590485026bee13ef5137c"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: expression/builtin_string_vec.go: FileTooLong \u2014 2195 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/expression/builtin_string_vec.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"44a9aaf4dd5923036b6a93bd74942e35f375203c8c49ac1addd0a3d4a6e68815"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: MemArbitrator: TooManyMethods \u2014 130 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":"pkg/util/memory/arbitrator.go"},"region":{"startLine":530}}}],"partialFingerprints":{"codehealthFindingId/v1":"7bde8a11b7af0764d0e48b9ab7d1b3c859fb4756af088647402de6a96bf51606"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: core/expression_rewriter.go: FileTooLong \u2014 2162 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/planner/core/expression_rewriter.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"c4a61a557344fabf5e65a95420308d8bc09ca07b7637dd117c81f1250b6cfd7d"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: types/time.go: FileTooLong \u2014 2119 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/types/time.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"743901f642ad0f3fc881dde661b3f09871df947980626c5c27b19c4062346ad5"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: expression/builtin_compare.go: FileTooLong \u2014 2095 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/expression/builtin_compare.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"cffc34d80db3db7f70fc21e699b4919c5fe1384faeb010b33f34d2400e685b46"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: expression/builtin_time_vec.go: FileTooLong \u2014 2052 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/expression/builtin_time_vec.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"74b50257591cffc5602b180f7e2f4cbbfc11a677dc08420da63b2ef7006ff368"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: SessionVars: TooManyMethods \u2014 123 methods, declared across 2 files: variable/session.go (122), variable/slow_log.go (1). That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/sessionctx/variable/session.go"},"region":{"startLine":809}}}],"partialFingerprints":{"codehealthFindingId/v1":"11697f7b7393e81071e12a81c5ae09f83653fc958c36c70b555428ede26e3492"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: executor/show.go: FileTooLong \u2014 2008 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/executor/show.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"6e1a9f9ed0caa2d5878f050d5993a730fecbe6ebd5db51ee8cdec1c5e4b50eef"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: copr/coprocessor.go: FileTooLong \u2014 1981 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/store/copr/coprocessor.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"8c3f88f56603764fa3878902dac8e7ebc7a357b95f60125a0c7ce31596d9239f"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: memory/arbitrator.go: FileTooLong \u2014 1970 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/util/memory/arbitrator.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"65c86801900c46894eca828a5e752b4ef949caeeb2710f47c69e61a2f2f44111"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: Mutator: TooManyMethods \u2014 117 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":"pkg/meta/meta.go"},"region":{"startLine":219}}}],"partialFingerprints":{"codehealthFindingId/v1":"5c797e2d2b762306da37beea04aa0558079fe7c85f9b34a1079e4da36ef93bb1"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: variable/session.go: FileTooLong \u2014 1948 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/sessionctx/variable/session.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"082db30534fce66bd8d9d525a44f0d3ddbb525cc5310e4580f737cdbe494ee2d"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: executor: TooManyMethods \u2014 116 methods, declared across 3 files: ddl/executor.go (113), ddl/sanity_check.go (2), ddl/engine_attribute.go (1). That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/executor.go"},"region":{"startLine":189}}}],"partialFingerprints":{"codehealthFindingId/v1":"79a60b6543ebc7074706616890d41bb6fcf758b90f6cd700eed616de92497a95"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: executorBuilder: TooManyMethods \u2014 116 methods, declared across 4 files: executor/builder.go (110), executor/foreign_key.go (3), executor/brie.go (2), executor/point_get.go (1). That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/builder.go"},"region":{"startLine":106}}}],"partialFingerprints":{"codehealthFindingId/v1":"7f14eff1e6c2749b7baea511395a63f37e2dd7ece061abda5f2570fef3adb791"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: domain/domain.go: FileTooLong \u2014 1932 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/domain/domain.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"7991bb3c153108d7bf108ca757b2f491a97f96051240fb33e00f6b62d3e1afcc"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: task/restore.go: FileTooLong \u2014 1904 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":"br/pkg/task/restore.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"8e8432fe438607f307817741be3b829cc0a4aeebd7819961996bbf46ee20fb56"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: core/find_best_task.go: FileTooLong \u2014 1903 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/planner/core/find_best_task.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"353bd2ee96990ff9a9c271be0c21337542a5dbe771fb9e13014ba5407b395012"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: server/conn.go: FileTooLong \u2014 1894 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/server/conn.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"c5193e4dd6d334472ce60e61a858ae361bb75ffa2d158fbb131be5e2621afdd3"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: expression/builtin_cast.go: FileTooLong \u2014 1886 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/expression/builtin_cast.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"0bd62f7803a38174b92dcc5d57bfe8b024be77fc1468870daa4e7df4fad42e53"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: log_client/client.go: FileTooLong \u2014 1776 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":"br/pkg/restore/log_client/client.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"523859d7fd84dc8deca88e24e507a3527e38748c78bf5a956aafec53f788dc3d"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: task/stream.go: FileTooLong \u2014 1767 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":"br/pkg/task/stream.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"26e47fae93622a45a3742c9c3bb17f8c8083fa6c917f5f85cc18a106e43010ea"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: StatementContext: TooManyMethods \u2014 102 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":"pkg/sessionctx/stmtctx/stmtctx.go"},"region":{"startLine":226}}}],"partialFingerprints":{"codehealthFindingId/v1":"529ebc3944abb587a524c062f080f1968856869dcd293368eb9533272debdcda"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: executor/adapter.go: FileTooLong \u2014 1696 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/executor/adapter.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"6487d16cc595c9e6436ee2bd059f1125c17b8975d2828bbb31fa7af90ad4c613"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: clientConn: TooManyMethods \u2014 97 methods, declared across 5 files: server/conn.go (71), server/conn_stmt.go (16), server/extension.go (4), server/user_connections.go (4), \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":"pkg/server/conn.go"},"region":{"startLine":171}}}],"partialFingerprints":{"codehealthFindingId/v1":"5c287bcd237b57cd1fea321236f8281e72608324a4cd559f78c50927dcff6530"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: tikvhandler/tikv_handler.go: FileTooLong \u2014 1607 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/server/handler/tikvhandler/tikv_handler.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"b3f69bcdc68148d221ca1ccd341382e57f8f56c0a62092143aed7929eedc9756"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: old/transformation_rules.go: FileTooLong \u2014 1605 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/planner/cascades/old/transformation_rules.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"cb3cec03e72889f61dfdbd51d792a67b23f66a8eb29697864b67b0ed721753e7"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: worker: TooManyMethods \u2014 96 methods, declared across 14 files: ddl/index.go (19), ddl/masking_policy.go (19), ddl/job_worker.go (17), ddl/table.go (10), \u002B10 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":"pkg/ddl/job_worker.go"},"region":{"startLine":180}}}],"partialFingerprints":{"codehealthFindingId/v1":"7141d42e76aa4ad7ae68660c11a3d552bf30be64a741d9410d5cd6e93f484d81"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: types/mydecimal.go: FileTooLong \u2014 1587 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/types/mydecimal.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"9236a98216f7e6b047649e16aefe39bf2ffabcb10f7662be83170e85eae6aeb0"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: ddl/modify_column.go: FileTooLong \u2014 1574 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/ddl/modify_column.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"8faea775abcfdabfc72bfb0363df0a8c65a6edeb3de3f0ed9f76df3a8a63f1d2"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: core/preprocess.go: FileTooLong \u2014 1515 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/planner/core/preprocess.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"8ee38db0549a7cd9543ff09a4f290171840f74a4bfa4f78a5cffc8ea53a98686"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: expression/util.go: FileTooLong \u2014 1492 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/expression/util.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"86c9c0669fb204374d92bdda7ec505e6a2823fc3860297484d4111917fdcbea1"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: executor/distsql.go: FileTooLong \u2014 1483 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/executor/distsql.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"bb29a108b72a502d10e0b8377204df14718ec3810e5ae45209f36624ba13bc8a"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: SnapClient: TooManyMethods \u2014 87 methods, declared across 4 files: snap_client/client.go (66), snap_client/pipeline_items.go (8), snap_client/systable_restore.go (7), snap_client/tikv_sender.go (6). 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":"br/pkg/restore/snap_client/client.go"},"region":{"startLine":86}}}],"partialFingerprints":{"codehealthFindingId/v1":"85b9963f6948d98a97c3353ab45c48de13ff1b8736454d5d5076c3b465e06f39"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: core/exhaust_physical_plans.go: FileTooLong \u2014 1439 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/planner/core/exhaust_physical_plans.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"6d1b7ca538be12887f536bb83ed4ea5ed0fd7c511f0394791422555b5c876098"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: tikv/mvcc.go: FileTooLong \u2014 1436 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/store/mockstore/unistore/tikv/mvcc.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"81a21ea2ce9b63a9a5d3150a53045207fd50e4fa6f9073ef43309209e0438c1d"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: expression/builtin_cast_vec.go: FileTooLong \u2014 1425 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/expression/builtin_cast_vec.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"99bb142605d5774b21d68c9b7f9414c60a7082eda05e2bdba2b3135ebeca7b37"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: privileges/cache.go: FileTooLong \u2014 1423 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/privilege/privileges/cache.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"89627b3102bff999ef3f66d88e744e5fb6bd80ebf4a92eb4305e7ec6da4677cc"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: ShowExec: TooManyMethods \u2014 85 methods, declared across 5 files: executor/show.go (49), executor/show_stats.go (19), executor/show_placement.go (15), executor/brie.go (1), \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":"pkg/executor/show.go"},"region":{"startLine":93}}}],"partialFingerprints":{"codehealthFindingId/v1":"e81ff841c8f9cacdb87b49dce189100145aadd2c1638b086d184b820d9af747f"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: Column: TooManyMethods \u2014 84 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":"pkg/util/chunk/column.go"},"region":{"startLine":74}}}],"partialFingerprints":{"codehealthFindingId/v1":"37742cc8d9930987e0c3078649d61a32116a3c6d7f7332beef0f84ebe0e0fa07"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: core/task.go: FileTooLong \u2014 1382 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/planner/core/task.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"f3f1c3a3b0188c1afc977afc78ebcb1958c2bca3d4119fe118944ed9e46c0b52"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: codec/codec.go: FileTooLong \u2014 1382 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/util/codec/codec.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"43d28977c836c9d1bc7f3c2078b8501c060b439bf2dd4b35038ea449b351573d"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: executor/index_merge_reader.go: FileTooLong \u2014 1377 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/executor/index_merge_reader.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"fbfa30c2d47796494357425a507305c7c6fa755d0d9f0236979896ce7452661e"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: export/dump.go: FileTooLong \u2014 1370 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":"dumpling/export/dump.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"c4f8f1b2bf9f55cb637ec2d4732be545fd866146236d84e46fd89ba6d3c14490"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: tables/partition.go: FileTooLong \u2014 1369 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/table/tables/partition.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"f7427a82ced82ee6f01479d26e415dbc86a7bd9683c3eb698b651a73b1f90fea"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: TaskManager: TooManyMethods \u2014 82 methods, declared across 5 files: storage/task_table.go (44), storage/task_state.go (15), storage/nodes.go (11), storage/subtask_state.go (8), \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":"pkg/dxf/framework/storage/task_table.go"},"region":{"startLine":131}}}],"partialFingerprints":{"codehealthFindingId/v1":"2d96252c2259bc1cc4cca14bc9584294afd1afa0dbcecae7a1a9e8a28894d34b"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: Context: TooManyMethods \u2014 82 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":"pkg/util/mock/context.go"},"region":{"startLine":68}}}],"partialFingerprints":{"codehealthFindingId/v1":"33666420f9d2fb3d3755637417ea001fd2e5dd70a7aeeab78c51e5c3ecbe46be"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: importer/import.go: FileTooLong \u2014 1338 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":"lightning/pkg/importer/import.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"26c207b1df9d798c4120efe02dd16bead9682dad0454f821d378e4b877eac8a0"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: expression/builtin_json.go: FileTooLong \u2014 1323 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/expression/builtin_json.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"e74abf77d85d755f241ab11021f6a98dbccce88b79e13f147e13f1892e854b37"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: logicalop/logical_join.go: FileTooLong \u2014 1307 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/planner/core/operator/logicalop/logical_join.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"6597d0b4a19874291c00c6266be98e92cfe9b5b4a5a01042637c10ce15b94a7e"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: rule/rule_partition_processor.go: FileTooLong \u2014 1307 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/planner/core/rule/rule_partition_processor.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"5948eb51998b1be1c1d1f8f0cf6e67a2c979cb7e8aeb36743e16c3781d229ca8"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: Server: TooManyMethods \u2014 78 methods, declared across 5 files: server/server.go (62), server/http_status.go (10), server/http_handler.go (3), server/stat.go (2), \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":"pkg/server/server.go"},"region":{"startLine":128}}}],"partialFingerprints":{"codehealthFindingId/v1":"11143d0c02058891ae5c6554bd92f4c920137be5d91b230d1ab87f6e55a7ad43"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: session/upgrade_def.go: FileTooLong \u2014 1299 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/session/upgrade_def.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"6fbc3135cce1f98bc59960de8ae2aaa84f03f6303e7a76f5a4776fb0c39811b0"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: expression/builtin_math.go: FileTooLong \u2014 1293 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/expression/builtin_math.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"e1da3ef771039adf873d265a592291fc3a44059e5c8476ee9b6d43fd28a6f22c"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: expression/distsql_builtin.go: FileTooLong \u2014 1288 significant lines (blank, comment-only and punctuation-only lines excluded), about 85% of them inside a single declaration: getSignatureByPB (38-1174). Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body \u2014 the parts that share the same inputs and are named together \u2014 into its own unit in a sibling file, and have the original call them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/expression/distsql_builtin.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"7de73ab012e3c546a5d357a43322debf23866cac9eb6c67c9060ae4eeaf8ec4b"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: aggfuncs/func_max_min_count.go: FileTooLong \u2014 1263 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/executor/aggfuncs/func_max_min_count.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"1804c15b9f8bde9f39d601a97b3d3adfb9d58e821be7fad89acdd6d46bb5c6c5"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: gcworker/gc_worker.go: FileTooLong \u2014 1258 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/store/gcworker/gc_worker.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"0af5f2b44358652b1580a66fa788bc5a574e54cc57be376f18bf8b9e049a7dae"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: aggfuncs/func_max_min.go: FileTooLong \u2014 1257 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/executor/aggfuncs/func_max_min.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"39250c3351c0020d327ee947fb70842f06b0dbc65cb381a11ac2c005cf0c6c59"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: meta/meta.go: FileTooLong \u2014 1247 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/meta/meta.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"d1acbf41c685d1f551e9978f367aaad6f350639441bf5db520fd4a14fcfaedfa"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: ingestctrl/local.go: FileTooLong \u2014 1246 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/ingestor/ingestctrl/local.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"1f304a74ec49c8537c7f6fe256ee8ed4547b9e5ea7028c5605d8cfa4e156ec9b"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: config/config.go: FileTooLong \u2014 1233 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/config/config.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"0c13847c93d26e7d463799cd64292af38838a5bd3e7b99cf78f38f8cc42c25fd"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: expression/builtin_other.go: FileTooLong \u2014 1232 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/expression/builtin_other.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"bfcd60a23bfdde657d81384e19bcd8bf765626ba1ae5fc3e2468ef432958ad52"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: tablecodec/tablecodec.go: FileTooLong \u2014 1230 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/tablecodec/tablecodec.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"bd32e25033941ea10d384bbf0b78286702da109a94048ceb2cb5b6ed7d250735"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: ddl/table.go: FileTooLong \u2014 1185 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/ddl/table.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"080ab89f26c3ed42063e9a27d29b6623633186f6c3a52de38b19c88e0dc4e621"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: expression/builtin_miscellaneous.go: FileTooLong \u2014 1185 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/expression/builtin_miscellaneous.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"8b51cd029032f4ff096bc9b3e4cfbf48ebe315c2e4181eb5b16e3bb8cb0b9d69"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: checkpoints/checkpoints.go: FileTooLong \u2014 1182 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":"lightning/pkg/checkpoints/checkpoints.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"96ca509976392c33c1fb1238a07a1cf6a09984c19ada52c52396cad8e33d1791"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: importer/table_import.go: FileTooLong \u2014 1179 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":"lightning/pkg/importer/table_import.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"c6e0bee51848181069f272324956fe64f008b4d021d25b59607ba5db84335d89"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: vardef/tidb_vars.go: FileTooLong \u2014 1178 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/sessionctx/vardef/tidb_vars.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"b17817a8b5b1f56eec2f54e819def953a99a9e77892a3883124a6bc53bfa47d0"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: errno/errname.go: FileTooLong \u2014 1168 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: MySQLErrName (23-1213). Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body \u2014 the parts that share the same inputs and are named together \u2014 into its own unit in a sibling file, and have the original call them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/errno/errname.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"b9a82a1a01bfbec5865e42bfb617b8f376f343b188d108ae490fd0bda90baa8d"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: deserializeHelper: TooManyMethods \u2014 70 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":"pkg/executor/aggfuncs/spill_deserialize_helper.go"},"region":{"startLine":25}}}],"partialFingerprints":{"codehealthFindingId/v1":"757fe3042700f4e5c8d7db6c2696d8f016ce66df5498f225adbc0de37bfc87b7"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: SerializeHelper: TooManyMethods \u2014 70 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":"pkg/executor/aggfuncs/spill_serialize_helper.go"},"region":{"startLine":22}}}],"partialFingerprints":{"codehealthFindingId/v1":"18c3b1cadcf36c48f0557be3b9ff10648954611df12a3b8424fc7918c62a35c0"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: Server: TooManyMethods \u2014 70 methods, declared across 2 files: tikv/server.go (68), tikv/server_batch.go (2). That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/store/mockstore/unistore/tikv/server.go"},"region":{"startLine":48}}}],"partialFingerprints":{"codehealthFindingId/v1":"d8b742e8bf6f3798e8b7962e5dbe0bbe4e1d8db50baa183e327517a5063b31ed"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: tables/tables.go: FileTooLong \u2014 1157 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/table/tables/tables.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"ce7ca294b5e428ff0bbec8bbd3d9fc472f152bb896c969750426c0f0259f512c"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: copr/batch_coprocessor.go: FileTooLong \u2014 1146 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/store/copr/batch_coprocessor.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"324a6c471395dc7a683b1e6e27707ffed6807e064e1c92433253b682b9282f9f"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: statistics/histogram.go: FileTooLong \u2014 1124 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/statistics/histogram.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"ac3a1d0cf5d826473c2a769f05988ce2c5728df0c6bd9b7381e665671e1f8b16"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: executor/slow_query.go: FileTooLong \u2014 1120 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/executor/slow_query.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"43e8774288f894628bca3705d0af551ee7ab706427c03556aa9b367427854ce1"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: ddl/create_table.go: FileTooLong \u2014 1118 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/ddl/create_table.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"9711b94614e7c8eecc886083dc7fa556668e991bc5c7f4fd3096b32b03fc5602"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: expression/builtin_info.go: FileTooLong \u2014 1105 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/expression/builtin_info.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"4b4bbc85a1e70b953623a64275586cf3413762a65b06b67e2e900370c7c93951"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: core/memtable_predicate_extractor.go: FileTooLong \u2014 1104 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/planner/core/memtable_predicate_extractor.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"7839460e23f8bbb65854f3ca0df12e670b07dbfe29d91d48d76cc1ba2a1fc735"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: infoschema/infoschema_v2.go: FileTooLong \u2014 1101 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/infoschema/infoschema_v2.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"6f8e037edba31de7ef49d107b00105a1f1de9fe431376b44d6ea845fdfcebe44"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: ingestctrl/engine.go: FileTooLong \u2014 1100 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/ingestor/ingestctrl/engine.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"2f28750c9aa8649ed120865fa9028235df058c1fa239676d90f54ddaeaf68a26"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: export/sql.go: FileTooLong \u2014 1090 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":"dumpling/export/sql.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"08842ea89503154ad46b54808e1d33b10367bbbbe778e0abab0670da281baf72"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: LogClient: TooManyMethods \u2014 65 methods, declared across 3 files: log_client/client.go (54), log_client/id_map.go (10), log_client/flow_control.go (1). That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"br/pkg/restore/log_client/client.go"},"region":{"startLine":166}}}],"partialFingerprints":{"codehealthFindingId/v1":"5a2a4f2dafdb72f20da50ecd42eb3d54c14a607374919c29b9d50499147a4f90"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: tidb-server/main.go: FileTooLong \u2014 1067 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":"cmd/tidb-server/main.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"e88827606905a386dd13388c541ef19fc673eab195ba1390596c83360a535699"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: ast/expressions.go: FileTooLong \u2014 1048 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/parser/ast/expressions.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"0c8720429cb777ca2ff3527b96d300f2e3c1fbc6f9d030da7b8b278354e77c40"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: executor/insert_common.go: FileTooLong \u2014 1037 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/executor/insert_common.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"ce59c1ad6f25d542d179b39956151f529c05f33974490b2049fa22ca338e3fb0"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: stream/stream_metas.go: FileTooLong \u2014 1030 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":"br/pkg/stream/stream_metas.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"43deccd902c30276a31d268316c09adaadef8f662755e1362f95663aa9e0a84e"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: model/job_args.go: FileTooLong \u2014 1023 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/meta/model/job_args.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"0218efd3f2fc3303af2fb8891607b417591351bd3a2e4d17bcae47089686dad8"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: ddl/ddl.go: FileTooLong \u2014 1017 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/ddl/ddl.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"e50f1b3e310827f34b10d5bbd70af2209d003b2843f8910cdaadc06293490e55"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: config/config.go: FileTooLong \u2014 1015 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/lightning/config/config.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"63f19ff9f796aea2dc4cbce389a45b56fd552d6ef17bd9d273fa381b0ceb55ea"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: TestServerClient: TooManyMethods \u2014 60 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":"pkg/server/internal/testserverclient/server_client.go"},"region":{"startLine":72}}}],"partialFingerprints":{"codehealthFindingId/v1":"1fa3ff929c50bdc5bec2b9c3cd43055366b5fd25aab0b796f707a57fcd76e5bd"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: cophandler/mpp_exec.go: FileTooLong \u2014 998 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/store/mockstore/unistore/cophandler/mpp_exec.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"c6b6bcca26b084b9b05f377b07dd1f57127d473c5892def0a7f59b262e8c3005"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: snap_client/client.go: FileTooLong \u2014 997 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":"br/pkg/restore/snap_client/client.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"786246517c9be8c9877974ba7ea118584aaa5083332da5733e0718084c81af1f"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: importer/precheck_impl.go: FileTooLong \u2014 986 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":"lightning/pkg/importer/precheck_impl.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"70a9421a10fc94b838bbe2035d36df2697b5dc63d40bfcf81c1938a0f7d6f120"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: core/point_get_plan.go: FileTooLong \u2014 985 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/point_get_plan.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"9cf447029d6d3aa7436b5434cbd3f6fb06a73f78666fa9351cb393c27d201c43"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: expressionRewriter: TooManyMethods \u2014 58 methods, declared across 2 files: core/expression_rewriter.go (57), core/fulltext_to_like.go (1). That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/expression_rewriter.go"},"region":{"startLine":352}}}],"partialFingerprints":{"codehealthFindingId/v1":"02ad34b2887f053dd4855e6fd61b739a7fbad74448ec864924f1e0a2ed74ca28"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: Chunk: TooManyMethods \u2014 58 methods, declared across 2 files: chunk/chunk.go (56), chunk/compare.go (2). That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/util/chunk/chunk.go"},"region":{"startLine":35}}}],"partialFingerprints":{"codehealthFindingId/v1":"1029b19d0b68a906badca3fe956c3630ede7ede2fe7b512f2328df13eeb29234"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: expression/builtin_json_vec.go: FileTooLong \u2014 962 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/expression/builtin_json_vec.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"5451ffe75ac6ca8cacf1a3120b9f68b1e231bd344dbacfc7934bcb928898116d"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: mysql/errname.go: FileTooLong \u2014 959 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: MySQLErrName (28-985). Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body \u2014 the parts that share the same inputs and are named together \u2014 into its own unit in a sibling file, and have the original call them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/parser/mysql/errname.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"0b5df2f2dc9f300246431b2aad65f7ade827918ddd44d60eeb0f6a0e2f289c97"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: join/hash_join_v2.go: FileTooLong \u2014 957 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/executor/join/hash_join_v2.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"9f1d281c9c8fa89a659ca817f58527571dc12ab6bd3fb95b07bd7ff935721c8a"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: ddl/backfilling_operators.go: FileTooLong \u2014 952 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/ddl/backfilling_operators.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"173cd52e5913c2de8e02e9b53939306fca87c45437e63ed34473412849f691a9"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: memtableRetriever: TooManyMethods \u2014 57 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":"pkg/executor/infoschema_reader.go"},"region":{"startLine":97}}}],"partialFingerprints":{"codehealthFindingId/v1":"75d97101de2ac76fdaa62691f529ad8952720023f2f7e00c15ec26c293942172"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: LogicalJoin: TooManyMethods \u2014 57 methods, declared across 3 files: logicalop/logical_join.go (49), logicalop/shallow_ref_generated.go (6), logicalop/hash64_equals_generated.go (2). That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/operator/logicalop/logical_join.go"},"region":{"startLine":46}}}],"partialFingerprints":{"codehealthFindingId/v1":"5bdd40cc33aa1b4ec4e45779d070f8390180a9d73f52ca51c9d4aa292da7fac6"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: join/hash_join_v1.go: FileTooLong \u2014 949 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/executor/join/hash_join_v1.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"5e012f9a5a7fd8ebd34f8f18ee525f5ac94a6f7973f697649fce5770b6032256"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: ranger/detacher.go: FileTooLong \u2014 932 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/util/ranger/detacher.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"fe552fe6865ff932c10adaff7629f7a6342a05ec5aa3dc6993b5d416931f52d7"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: core/common_plans.go: FileTooLong \u2014 928 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/planner/core/common_plans.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"394b60c5c5b9c0415efc9ecd541c447bfabcd6cabeb96b7e2b5b530f377d0541"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: ScalarFunction: TooManyMethods \u2014 55 methods, declared across 2 files: expression/scalar_function.go (51), expression/explain.go (4). 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":"pkg/expression/scalar_function.go"},"region":{"startLine":40}}}],"partialFingerprints":{"codehealthFindingId/v1":"32afcd7bc39840b48cfdb355b43374bd40916a983f51c40ef1c616ec6f057c43"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: snap_client/import.go: FileTooLong \u2014 908 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":"br/pkg/restore/snap_client/import.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"3a1abe4d2fb26cf9ada4d71963fdf1b7ddd7abe72dd011073bf80a314a8f5065"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: Checker: TooManyMethods \u2014 54 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":"pkg/ddl/schematracker/checker.go"},"region":{"startLine":61}}}],"partialFingerprints":{"codehealthFindingId/v1":"8e34fa1e9bab8fbf2cf747fd6f4dc7a5bfbad023c9aa00657933d64409e10bb8"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: Column: TooManyMethods \u2014 54 methods, declared across 2 files: expression/column.go (49), expression/explain.go (5). 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":"pkg/expression/column.go"},"region":{"startLine":281}}}],"partialFingerprints":{"codehealthFindingId/v1":"a05e976e017bc42ec67d5e4ee264716fb43ab3fc0164f2fe9a70a8b72c2ce841"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: MVCCStore: TooManyMethods \u2014 54 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":"pkg/store/mockstore/unistore/tikv/mvcc.go"},"region":{"startLine":51}}}],"partialFingerprints":{"codehealthFindingId/v1":"98b55857fef8e3673a061ee633718b5defc3b6c339d8a059d0236b6a9caaf5a1"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: stmtctx/stmtctx.go: FileTooLong \u2014 888 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/sessionctx/stmtctx/stmtctx.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"c9b2478b61e0f7886c2f825d906bf128918ae26d92335f878f70f661facbc368"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: core/optimizer.go: FileTooLong \u2014 885 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/planner/core/optimizer.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"9b1e6eaa8a6d6b7e26574fb2745ecaebd9bf8022f1bf82ca6dceb0119704bf8e"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: ttlworker/job_manager.go: FileTooLong \u2014 877 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/ttl/ttlworker/job_manager.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"55d7b93c384f9394b4c33978e19a064453e0e864027e4a8144bd367d65d99e27"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: executor/inspection_result.go: FileTooLong \u2014 875 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/executor/inspection_result.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"f73ce426592e1bb4bfafa6195aaac81cefdd883f741b87dcf0865405f3f631a3"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: ast/functions.go: FileTooLong \u2014 875 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/parser/ast/functions.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"55ae965d51a7e3470405e30c95aa58315eccecaa1a728074efb0fbb6fefc9817"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: executor/select.go: FileTooLong \u2014 871 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/executor/select.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"aa75801538735ee835e97b4c7fd3befbd37379a7d50b357645c5e28b0d990abf"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: server/server.go: FileTooLong \u2014 868 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/server/server.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"55d36052604fd4af9565db23079e452666df4edecf61ac1c81fc9cb1329a4445"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: ddl/column.go: FileTooLong \u2014 867 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/ddl/column.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"19e7f1f52d6a22695709b77a9c798b0022b915a96254bb87de5238df30136c59"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: SchemaTracker: TooManyMethods \u2014 52 methods. Most of these members implement ddl.Executor (36 of 52 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/ddl/schematracker/dm_tracker.go"},"region":{"startLine":51}}}],"partialFingerprints":{"codehealthFindingId/v1":"10887dd7e1ea03649320f1aa1328375f161958d6ce848db03b041248bf9fda53"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: types/field_type.go: FileTooLong \u2014 864 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/types/field_type.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"bbf60a4b3e46fb83b9baada63a141488ec5b7748e624989584748c71c7f49456"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: extsort/disk_sorter.go: FileTooLong \u2014 862 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/util/extsort/disk_sorter.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"c455e4efe2cddbecd0a35337551a57147dacf28debc4f716b350ca5d0e9efbf7"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: core/plan_cost_ver2.go: FileTooLong \u2014 861 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/planner/core/plan_cost_ver2.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"12a9ab5235bf6ad3d0c3f5bc9376697daece23a2891ed1958f2e6933ae1a7d36"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: expression/builtin_arithmetic.go: FileTooLong \u2014 860 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/expression/builtin_arithmetic.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"92b77d8637b3c002d669522c85de7d2997c3ed217807f2c3288269cf2e3e0734"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: expression/builtin_regexp.go: FileTooLong \u2014 852 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/expression/builtin_regexp.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"ae4f3aa1b566609698da45dde582464265964c3d40214ebc8de4445466ec7bf8"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: model/job.go: FileTooLong \u2014 851 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/meta/model/job.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"7f554dd6249b33a919c7e0aacb0ff10be6752d11445fa872ec18334fbc327f23"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: ingestctrl/duplicate.go: FileTooLong \u2014 847 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/ingestor/ingestctrl/duplicate.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"4c74d66cf5807e06509859ee4ab724e183b6a1f901844a40ac7da4ca3d9cffcd"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: cophandler/closure_exec.go: FileTooLong \u2014 847 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/store/mockstore/unistore/cophandler/closure_exec.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"af9018e8fadac2a07f91671f9a98d92f7df5cebf4ce674c85eaa6a7c2a9cf700"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: ddl/add_column.go: FileTooLong \u2014 843 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/ddl/add_column.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"d2ab931c65cdc0bf819dfd1c546b62d16f4dc1c110654aa712b6cc37c5ce73d4"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: infoschema/infoschema.go: FileTooLong \u2014 843 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/infoschema/infoschema.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"cb794bf1022bb8e299abb2008815577e81467f8c812b7872e73e64daeebc5ee1"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: ddl/backfilling.go: FileTooLong \u2014 841 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/ddl/backfilling.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"4d138f4015e85aeac610f3e67ac8407742ac24839541530212a9a00c630c5b72"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: hint/hint.go: FileTooLong \u2014 839 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/util/hint/hint.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"de009681d69232fd2b4e3cdf70ede6ad5aeace3717e55893af71b616f4600ae3"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: FieldType: TooManyMethods \u2014 50 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":"pkg/parser/types/field_type.go"},"region":{"startLine":44}}}],"partialFingerprints":{"codehealthFindingId/v1":"d704bf04851f9ff7356f8a93afeb963a49fa9d0fb13f2200653fabfdf52051d5"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: infosync/info.go: FileTooLong \u2014 833 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/domain/infosync/info.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"5a95a107c569b170a1afa1b7fcc4f31a278085bf58c1f5bb04206b5cd5e3121a"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: ingestctrl/region_job.go: FileTooLong \u2014 833 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/ingestor/ingestctrl/region_job.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"660b6ffe347e429932175df498cdf7a8b488e78c2a78cf2612202cbcb18c0a7c"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: ExecStmt: TooManyMethods \u2014 49 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":"pkg/executor/adapter.go"},"region":{"startLine":356}}}],"partialFingerprints":{"codehealthFindingId/v1":"6efc0c4af1e201314630e2bb0ed60acb857a3900a500624d52579484b153365b"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: Job: TooManyMethods \u2014 49 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":"pkg/meta/model/job.go"},"region":{"startLine":353}}}],"partialFingerprints":{"codehealthFindingId/v1":"4446bb0c3de74ab9ebcb4178e105ea280426343db21f0cfa6ef28b91e50b1241"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: expression/builtin_op.go: FileTooLong \u2014 815 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/expression/builtin_op.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"b5e7b6bdb60e135f78a0e1d236d8a5fd482abade6f1c75ffea71cb5baefda19f"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: tikv/server.go: FileTooLong \u2014 815 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/store/mockstore/unistore/tikv/server.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"02ceb25198136b45447b2ab7f1548c8005fdd6fd6b61a84028a89deb299579ed"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: executor/mem_reader.go: FileTooLong \u2014 810 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/executor/mem_reader.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"ec247bbc67ae7519a820ea7ba17fc5c0cec034e1811a07d0d6dfc21122b2e667"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: core/plan_cost_ver1.go: FileTooLong \u2014 807 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/planner/core/plan_cost_ver1.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"83aa0aca0738cb00f83ae03cd764abfd93fbb7b43f5adcbdee66744da3bbcecd"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: core/indexmerge_path.go: FileTooLong \u2014 806 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/planner/core/indexmerge_path.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"278d0b461fe797b00e931bfad274168cbf1babe26b9c13ac8cbfc33c996f5d46"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: backup/client.go: FileTooLong \u2014 801 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":"br/pkg/backup/client.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"24bc83ffded75c9fdda44ec4b8b2b52d51b5c5c42e2c79b36adff132b9b74025"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: autoid/autoid.go: FileTooLong \u2014 801 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/meta/autoid/autoid.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"8a2330e5ac5e4f5ef09fbcc22fe3e5cc238e79b9993e14bcaf7dad102dbfdfdf"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: SimpleExec: TooManyMethods \u2014 48 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":"pkg/executor/simple.go"},"region":{"startLine":91}}}],"partialFingerprints":{"codehealthFindingId/v1":"f2f064e02a278df9c7cd15b205e8e8f7b18a0cf2250427d5c3dffeb6d138d6eb"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: preprocessor: TooManyMethods \u2014 48 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":"pkg/planner/core/preprocess.go"},"region":{"startLine":230}}}],"partialFingerprints":{"codehealthFindingId/v1":"05c671c997568209c470dc6cd29af3eebedaf99b0011d795311227132e3d4c08"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: infoschema/builder.go: FileTooLong \u2014 800 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/infoschema/builder.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"515655208777fb05ea1461abf713776f2f3d1960e1aced3d8d2d37038a7c828c"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: server/lightning.go: FileTooLong \u2014 793 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":"lightning/pkg/server/lightning.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"efb5b304e1b40c37b65d32f1a072080310df0fcdb0762437cd8ec49541145d7d"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: expression/expression.go: FileTooLong \u2014 790 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/expression/expression.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"56e2cb324d45c50b229f467d648fe8a55aee51c64be1d7c18752098ee85d7154"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: memory/tracker.go: FileTooLong \u2014 789 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/util/memory/tracker.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"9d447cdaa331df96c5f112e0272052c27f8f9818a22128ddd88ea41f53321780"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: distsql/select_result.go: FileTooLong \u2014 786 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/distsql/select_result.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"6dfc66d6b422898104d1e8a9c1d59f934d8c0d9287fabf4402e43923aef6eb25"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: CheckpointAdvancer: TooManyMethods \u2014 47 methods, declared across 2 files: streamhelper/advancer.go (42), streamhelper/advancer_daemon.go (5). 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":"br/pkg/streamhelper/advancer.go"},"region":{"startLine":69}}}],"partialFingerprints":{"codehealthFindingId/v1":"e1b3004b07afafb15b2d4c26e27591d04cb44d4baaac611c9313f6610afdb770"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: Tracker: TooManyMethods \u2014 47 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":"pkg/util/memory/tracker.go"},"region":{"startLine":78}}}],"partialFingerprints":{"codehealthFindingId/v1":"616d2858fc2ef3a296a724a88c736fb94d2ed27adef9bf2c3f15e3fb90f1fff7"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: expression/builtin_math_vec.go: FileTooLong \u2014 782 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/expression/builtin_math_vec.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"8e94a8e4cb3b7232155f387936b078528bfc8136ece3fb344ea843b39652bf49"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: stmtsummary/statement_summary.go: FileTooLong \u2014 779 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/util/stmtsummary/statement_summary.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"2902c099d4042ed0f52068fa6da2544aede521f2f241f9243deb147198bcc785"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: importer/meta_manager.go: FileTooLong \u2014 773 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":"lightning/pkg/importer/meta_manager.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"01ba311f682c3973ea53491da408ab8b9bfcee7899cc46fcfb3395c119d9eaf0"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: ddl/job_worker.go: FileTooLong \u2014 769 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/ddl/job_worker.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"c55c55f540ee9dd73b7888f55b712b62ed1620db7ebedda48bf425be2fea04fe"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: charset/encoding_gb18030_data.go: FileTooLong \u2014 769 significant lines (blank, comment-only and punctuation-only lines excluded), about 92% of them inside a single declaration: init (18-726). Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body \u2014 the parts that share the same inputs and are named together \u2014 into its own unit in a sibling file, and have the original call them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/parser/charset/encoding_gb18030_data.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"b849bdbd9eb0cc7079c544be5225509818d6067508ee0d782d8e8d3e96adabab"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: privileges/privileges.go: FileTooLong \u2014 767 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/privilege/privileges/privileges.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"5403461f6342b6b53a97e224522abcefd158abf55859a18f3c05cbf5aba86fdb"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: TestKit: TooManyMethods \u2014 46 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":"pkg/testkit/testkit.go"},"region":{"startLine":68}}}],"partialFingerprints":{"codehealthFindingId/v1":"1f4e8950622f3085810dbadb299daac2b10ac42084b92419903ca6f9d2a41063"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: model/table.go: FileTooLong \u2014 764 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/meta/model/table.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"cc19833b88eb2ec00cf79a8663cf400da19e3741854a86f0c20934977f65ed0c"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: tikv/mock_region.go: FileTooLong \u2014 761 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/store/mockstore/unistore/tikv/mock_region.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"82baf61966ef97dd404bae7a3b4da132023aa263d2de5650d0f4a694ff57a570"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: expression/builtin.go: FileTooLong \u2014 760 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/expression/builtin.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"fb9164ccb494f8c91f87601b6f4abe6afab76c425d60b324062110683d8c6e70"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: export/config.go: FileTooLong \u2014 752 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":"dumpling/export/config.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"dc8b0789abb82628ff8c82fcdc3647e6f705828c94bba062925f24ee50e53907"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: variable/slow_log.go: FileTooLong \u2014 751 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/sessionctx/variable/slow_log.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"6fa1ec97a64d9645c8202d350aed51f4cccee2f39b0f2829f903de78422b0984"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: Constant: TooManyMethods \u2014 45 methods, declared across 2 files: expression/constant.go (41), expression/explain.go (4). 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":"pkg/expression/constant.go"},"region":{"startLine":144}}}],"partialFingerprints":{"codehealthFindingId/v1":"433fdc4d84f0400c706921d4e736ec85fc31f2c5789ecbea05696d6a717369cd"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: BaseLogicalPlan: TooManyMethods \u2014 45 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":"pkg/planner/core/operator/logicalop/base_logical_plan.go"},"region":{"startLine":42}}}],"partialFingerprints":{"codehealthFindingId/v1":"ae14c3dc36320d8a33693b8e01da11bcfe787d2c330ad1c8750e47b6b64ce995"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: TxStructure: TooManyMethods \u2014 45 methods, declared across 4 files: structure/hash.go (18), structure/list.go (12), structure/type.go (9), structure/string.go (6). 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":"pkg/structure/structure.go"},"region":{"startLine":45}}}],"partialFingerprints":{"codehealthFindingId/v1":"db952f96bc212e16b1ce887ca29b4b1b48cc928c1605ad6b392111b5695ddf8a"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: RUV2Metrics: TooManyMethods \u2014 45 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":"pkg/util/execdetails/ruv2_metrics.go"},"region":{"startLine":166}}}],"partialFingerprints":{"codehealthFindingId/v1":"6242b35cbad8b0d5f56101ba945efbe14f0d97d6fcc07b4e70419ac7ea586fc5"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: schematracker/dm_tracker.go: FileTooLong \u2014 745 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/ddl/schematracker/dm_tracker.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"b2a0c6c9ee090f3fe04022850b8b46246203b6ff6e05ebf8f0fc3ec0d90fd32e"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: check/ut.go: FileTooLong \u2014 742 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":"tools/check/ut.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"3573f74c877cdfe2465ce8d26fff762e700d74e69275b0099d057680fb54cbed"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: metautil/metafile.go: FileTooLong \u2014 736 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":"br/pkg/metautil/metafile.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"f2127d98b271e1451407400d34041d9827d295dff53122afc61ec89e958e9eb3"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: execdetails/tiflash_stats.go: FileTooLong \u2014 735 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/util/execdetails/tiflash_stats.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"0460f59d1b046c938b4ffad8074b39180f913eff7e819899558e612847ea835f"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: expression/builtin_control.go: FileTooLong \u2014 734 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/expression/builtin_control.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"a86e1f0b43972b36ca4e42748d8a69c08285882d527546000965a8bceeb9fb48"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: Histogram: TooManyMethods \u2014 44 methods, declared across 2 files: statistics/histogram.go (42), statistics/scalar.go (2). That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/statistics/histogram.go"},"region":{"startLine":63}}}],"partialFingerprints":{"codehealthFindingId/v1":"9cbc4889611018332c744e04dd26973654cab19f0f949cf0163c44a0c837d840"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: GCWorker: TooManyMethods \u2014 44 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":"pkg/store/gcworker/gc_worker.go"},"region":{"startLine":72}}}],"partialFingerprints":{"codehealthFindingId/v1":"48044ed96b781945b9f21685ed2f4f5cb7061de4f5c44c32ed9aa1a26dcaa5d0"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: ddl/reorg.go: FileTooLong \u2014 733 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/ddl/reorg.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"2fedb1987ec2e2b94a6f0e1f7e0b39d4a51d3f712b2f15fdbf9128ae14baaaaf"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: parser/lexer.go: FileTooLong \u2014 732 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/parser/lexer.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"51cbaa67565ece76d02c7383fa97a0dd1d043a45766d31af3136d3506828e186"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: storage/task_table.go: FileTooLong \u2014 728 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/dxf/framework/storage/task_table.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"718649bc96ee7cabc362ad8f556973e20b0915cae917488aa939f7e5d5a63ecc"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: cardinality/selectivity.go: FileTooLong \u2014 728 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/planner/cardinality/selectivity.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"f714b8131d524916a2df60dd706f51386c83fc24b03c57b5f56408c30136733a"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: split/client.go: FileTooLong \u2014 722 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":"br/pkg/restore/split/client.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"f6cd4af4b5d10d1cffa2421cff4390e187fd1606bcba72918dacf272b74a02e4"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: stmtsummary/reader.go: FileTooLong \u2014 718 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/util/stmtsummary/reader.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"50c7e2bde0aeea0723a5d2dc5a3f50aef5cf6c2eb4cad57d2f566bbf54b4693e"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: Cluster: TooManyMethods \u2014 43 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":"br/pkg/utiltest/fakecluster/core.go"},"region":{"startLine":392}}}],"partialFingerprints":{"codehealthFindingId/v1":"247965ba4a434a43868923413b73da445adb3b9f97eceb156e51d5f0f75eb106"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: Backend: TooManyMethods \u2014 43 methods, declared across 3 files: ingestctrl/local.go (34), ingestctrl/region_job.go (6), ingestctrl/localhelper.go (3). 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":"pkg/ingestor/ingestctrl/local.go"},"region":{"startLine":546}}}],"partialFingerprints":{"codehealthFindingId/v1":"4ebed59806bcf6ac842402ff024b0ba7017dd8153bfe92dab682f344dececfe1"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: expression/builtin_encryption.go: FileTooLong \u2014 716 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/expression/builtin_encryption.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"2363bf53f75da3fc10d44d09801ff8eadea6c1211592fface10eedf967636a06"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: execdetails/ruv2_metrics.go: FileTooLong \u2014 710 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/util/execdetails/ruv2_metrics.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"d339c7bd508b9fbf733199a6f663067b169eee91da3bd93a2e22de831ab5e09f"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: streamhelper/advancer.go: FileTooLong \u2014 708 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":"br/pkg/streamhelper/advancer.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"b1a8ddb9f0faa50c0186f20c69817d698737215a7f5f2579f726b3aecbaa7ed7"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: executor/memtable_reader.go: FileTooLong \u2014 706 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/executor/memtable_reader.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"f448f0d6a4141dadecad0d8c9e27b3ffeacf7c49ff1e3d785d10fa7d6d9b21a0"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: ast/procedure.go: FileTooLong \u2014 706 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/parser/ast/procedure.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"201e87bc9b02b4c316f077f0c6557c9efa9caca1b3235842848709cc98e6a78e"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: ranger/points.go: FileTooLong \u2014 702 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/util/ranger/points.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"728fb11f7ea37ea43cec7f462a4d0bc7d12155946b38f8e8e33e91df7b9fbd4a"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: importer/table_import.go: FileTooLong \u2014 701 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/executor/importer/table_import.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"ff127149e2038a0eb9ae6a95ec0befb0df601692fbdb86d255695ef33a2e114d"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: ast/sem.go: FileTooLong \u2014 701 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/parser/ast/sem.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"c7a687f72d73040ba45adcd58029d46690c4e9058729681244a56c8afcdae1a9"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: ddl/backfilling_dist_scheduler.go: FileTooLong \u2014 694 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/ddl/backfilling_dist_scheduler.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"7bbbd6d0309cae534d81da164f38f27b43a48809fc84471ddcdd5bbd2dc4dd67"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: task/common.go: FileTooLong \u2014 692 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":"br/pkg/task/common.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"8ab02bb05479bd75fd1e02a6c523cb1065f31492fd31724c659386889590a00c"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: execdetails/runtime_stats.go: FileTooLong \u2014 691 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/util/execdetails/runtime_stats.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"ba2d2b6f123fb8ffc0476468248923a4b230d616422b0f53b3b3a33db41e25cb"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: aggfuncs/func_count_distinct.go: FileTooLong \u2014 690 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/executor/aggfuncs/func_count_distinct.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"4234537faa6a04c73c03b9c4d348d70a98b3cf638153b993b3f9709f1089724f"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: bindinfo/binding_plan_generation.go: FileTooLong \u2014 686 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/bindinfo/binding_plan_generation.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"3612ab55d373484e8ffa0b149e8f2938ed8d254bcdcf46933adb7a5ce40752eb"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: errormanager/errormanager.go: FileTooLong \u2014 682 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":"lightning/pkg/errormanager/errormanager.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"f620e2af6f386ae89ba2394474f093fdcd6853cd9e029cf39bb5f56e7172055d"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: executor/analyze_col_sampling.go: FileTooLong \u2014 680 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/executor/analyze_col_sampling.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"2a8c9f2a9370c7b164657a9597184b493188b00223cfc2838ea447e9111c078a"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: expression/builtin_arithmetic_vec.go: FileTooLong \u2014 675 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/expression/builtin_arithmetic_vec.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"f7f6f58781e183ae1dbd4315958cc18648a8864d185e3e76ff1a567a5e2ef3ae"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: tidb/tidb.go: FileTooLong \u2014 670 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/lightning/backend/tidb/tidb.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"a0de76ad5ed25e27b8726d5711f671fe53dec4dfdad65b851df8ecae7817062f"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: aggfuncs/builder.go: FileTooLong \u2014 669 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/executor/aggfuncs/builder.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"0a58078dd06f5dc6b0b59c4fbf7358fec3f572205b138d1eeecfed3d348c6c1a"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: Controller: TooManyMethods \u2014 40 methods, declared across 2 files: importer/import.go (24), importer/check_info.go (16). 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":"lightning/pkg/importer/import.go"},"region":{"startLine":199}}}],"partialFingerprints":{"codehealthFindingId/v1":"87da5cd0c3720fd7bececc2e7c91898240d68ceb36fecbc59c077dec6032e7c6"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: RequestBuilder: TooManyMethods \u2014 40 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":"pkg/distsql/request_builder.go"},"region":{"startLine":50}}}],"partialFingerprints":{"codehealthFindingId/v1":"daa51a7513e920460cc53b830b07c2e39e3d3370d1aaeb086c0967b5c9c9ae2e"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: LogicalAggregation: TooManyMethods \u2014 40 methods, declared across 3 files: logicalop/logical_aggregation.go (34), logicalop/shallow_ref_generated.go (4), logicalop/hash64_equals_generated.go (2). That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/operator/logicalop/logical_aggregation.go"},"region":{"startLine":38}}}],"partialFingerprints":{"codehealthFindingId/v1":"5297c863abf76f18091343a5d2aa6a12ada91195aad8a0415d0c8e1e47c58fa9"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: MySQLPrivilege: TooManyMethods \u2014 40 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":"pkg/privilege/privileges/cache.go"},"region":{"startLine":355}}}],"partialFingerprints":{"codehealthFindingId/v1":"a3c6407bf4960be6cd95ffa4b8e4b3fa8d1a4fecb8265281373bdde8df5f16c5"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: BinaryJSON: TooManyMethods \u2014 40 methods, declared across 2 files: types/json_binary.go (27), types/json_binary_functions.go (13). 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":"pkg/types/json_binary.go"},"region":{"startLine":133}}}],"partialFingerprints":{"codehealthFindingId/v1":"2e58e4173cceef2ebbd05375674cc9c73639063be3c8e9867210a0b0b3b17ecd"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: helper/helper.go: FileTooLong \u2014 664 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/store/helper/helper.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"039da36bcfb2e1ab137b55b33ee7b9f77c0d7620a64960d7f8e21f2c1ae49c30"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: executor/foreign_key.go: FileTooLong \u2014 661 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/executor/foreign_key.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"799aa6ef00ad9f6cb56a6c1a5dc391c0951f384a6dd04f7e95c5c11fecf9f796"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: physicalop/physical_table_scan.go: FileTooLong \u2014 659 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/planner/core/operator/physicalop/physical_table_scan.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"891e175259fe2a178321b05ee026b0d7a9153370c13945183eed719c3de7da48"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: planner/optimize.go: FileTooLong \u2014 657 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/planner/optimize.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"7b80d1b0b051c4bf19421ebb9c5c2c8ee81c11ef7ccdf7a4ef6d3bcadd3e2bb6"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: copr/region_cache.go: FileTooLong \u2014 651 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/store/copr/region_cache.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"520fdaf735f1e33bbfde5453f05b5e3ba03d57cfd1ffe814ad1e834959fcd86b"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: mpp/local_mpp_coordinator.go: FileTooLong \u2014 650 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/executor/internal/mpp/local_mpp_coordinator.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"7b2b2d440a5bc9685a4168c369aa9d3e44bab3a196d83c95efecf30a69b0d9ba"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: operator/test_storage.go: FileTooLong \u2014 649 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":"br/pkg/task/operator/test_storage.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"37a25f0ad2e1eef9ae34344127f890855eff733d2913cca864f42980dc4d5b90"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: importinto/task_executor.go: FileTooLong \u2014 649 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/dxf/importinto/task_executor.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"72e8cb835a9c2df5bd887bfa0eee284c8d40c817cbc96b4150ac907e4f5b24fb"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: domain/plan_replayer_dump.go: FileTooLong \u2014 641 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/domain/plan_replayer_dump.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"ff50b6e1f2ea3519607e4564839d6ecfb415d6a1be4aa9b7573d10827c5b3780"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: join/joiner.go: FileTooLong \u2014 641 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/executor/join/joiner.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"fa2588f2105b4bda41472d33facc6516784477f02e48d8e21973594883685ba1"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: registry/registration.go: FileTooLong \u2014 640 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":"br/pkg/registry/registration.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"784712bc01e4eaa205ebc671954a4cec58b1feb62c5471997873a99610a28717"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: core/memtable_infoschema_extractor.go: FileTooLong \u2014 636 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/planner/core/memtable_infoschema_extractor.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"177e83208ad64c950241cf806c7ba758e1c456ab7766a5cac3576557bb467394"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: tables/index.go: FileTooLong \u2014 634 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/table/tables/index.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"0c1c7e787d0611b4fb9f75d715e8f546c2076ab68d21788b3be8c3a012f587c1"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: PdController: TooManyMethods \u2014 38 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":"br/pkg/pdutil/pd.go"},"region":{"startLine":140}}}],"partialFingerprints":{"codehealthFindingId/v1":"f63e16ca597521f340c036536634b4c74afb7e814f6c9ed82bef1d3c8f49b059"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: DDLExec: TooManyMethods \u2014 38 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":"pkg/executor/ddl.go"},"region":{"startLine":52}}}],"partialFingerprints":{"codehealthFindingId/v1":"ca62635cda60878c6851a52861e9fd4b2682225276199562353edc60e8b44ef1"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: Engine: TooManyMethods \u2014 38 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":"pkg/ingestor/ingestctrl/engine.go"},"region":{"startLine":95}}}],"partialFingerprints":{"codehealthFindingId/v1":"b87fcebc7499e90c9baf32a0d25a09fe7baf870b77e155216afa0125d62e9c3a"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: LazyTxn: TooManyMethods \u2014 38 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":"pkg/session/txn.go"},"region":{"startLine":49}}}],"partialFingerprints":{"codehealthFindingId/v1":"4242866e430a4516ac10255ba022d0d5ac221ba129bc743a91b06960b58b278e"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: TableCommon: TooManyMethods \u2014 38 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":"pkg/table/tables/tables.go"},"region":{"startLine":59}}}],"partialFingerprints":{"codehealthFindingId/v1":"5ad7a5960727bb43f7629f12d28a2372ea944841cc5445f93299b41798e1e8cf"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: fakecluster/core.go: FileTooLong \u2014 631 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":"br/pkg/utiltest/fakecluster/core.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"703b0c73f7d56edd0a1bbf998b49f8132aeca9737a7b100589e004a316b38998"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: expression/constant_propagation.go: FileTooLong \u2014 631 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/expression/constant_propagation.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"b8f3b6d31a3f42beaa2f6db4a759b863d8f5c07a4a0c30a35b7ad1b372651412"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: types/json_binary.go: FileTooLong \u2014 630 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/types/json_binary.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"55aec1bf4e9ccccfdadb4a886ac40dac7d3768236507be1c4067377c11147aa9"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: join/index_lookup_hash_join.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":"pkg/executor/join/index_lookup_hash_join.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"9019e2c1deda0ba1606480d07b9b981b8488981bfb1067d9305d34eb7274f68b"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: expression/builtin_compare_vec.go: FileTooLong \u2014 628 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/expression/builtin_compare_vec.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"6b923b8f37c2f09a44eae3e9f84ef8fdc921a3cfb5a6f02df2716fdd368cbf04"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: join/base_join_probe.go: FileTooLong \u2014 626 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/executor/join/base_join_probe.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"f5b836db070e29919db8c473e40ccd1853070150777f21e102eebad2dcb8bdf2"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: importinto/scheduler.go: FileTooLong \u2014 625 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/dxf/importinto/scheduler.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"7304f5c7d8f9877a22c321ab3252f6176a410d724c57789f39e720be2595a964"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: join/index_lookup_join.go: FileTooLong \u2014 625 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/executor/join/index_lookup_join.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"486246c91704d3a8f639ff2bd0ef0402d0a914482729fea1305e92519de9cf6c"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: executor/admin.go: FileTooLong \u2014 623 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/executor/admin.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"8930d6574bc38c35ef13f32f9c741f7610f121eb643873f865ede7f25b73503e"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: executor/check_table_index.go: FileTooLong \u2014 623 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/executor/check_table_index.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"e4c4d4d39117a729c499297e127e3267d603d6d498d0f10a631c159b7e644fa8"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: physicalop/physical_batch_point_get.go: FileTooLong \u2014 620 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/planner/core/operator/physicalop/physical_batch_point_get.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"003719b04390b05a8d368e4f32642e10f63d7a5350eb30c8fc27632f5f146d70"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: ranger/ranger.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":"pkg/util/ranger/ranger.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"570556d0a132c6590a0476ed024773d74bf77621ee72f4694440ac0df1af0966"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: core/plan_cache_utils.go: FileTooLong \u2014 617 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/planner/core/plan_cache_utils.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"485cfed471b3d056eb25fbbf031ece576481ad3b1a585a38115d404e624994dd"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: hashJoinSpillHelper: TooManyMethods \u2014 37 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":"pkg/executor/join/hash_join_spill_helper.go"},"region":{"startLine":40}}}],"partialFingerprints":{"codehealthFindingId/v1":"b70a1b4841fdd18107a91fde75c9a18f8e4b2dcd29e15aac139880e8c15d9ddb"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: Builder: TooManyMethods \u2014 37 methods, declared across 3 files: infoschema/builder.go (29), infoschema/infoschema_v2.go (6), infoschema/builder_misc.go (2). That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/infoschema/builder.go"},"region":{"startLine":44}}}],"partialFingerprints":{"codehealthFindingId/v1":"5bec8c3d42fea0a589e325c53ff1bdced8fd7bb97c99d639cbc089db2cb443cc"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: handle/bootstrap.go: FileTooLong \u2014 616 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/statistics/handle/bootstrap.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"ef416f0ec80360776a5bd29c47b1a5f2e1ac1b41b1d0a5fe56ba49cb7c05e0ba"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: expression/builtin_encryption_vec.go: FileTooLong \u2014 611 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/expression/builtin_encryption_vec.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"a7e47836b8d088dae6422a0cbfa5d198dc9967dd17a4696ef551906d989dac58"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: executor/analyze.go: FileTooLong \u2014 610 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/executor/analyze.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"51195898c37ec5bf409a1f2ecd1b2af4b044ed6274883ae9bfaba2cdc9ac82a9"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: BatchPointGetPlan: TooManyMethods \u2014 36 methods, declared across 2 files: physicalop/physical_batch_point_get.go (35), physicalop/plan_clone_generated.go (1). That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/operator/physicalop/physical_batch_point_get.go"},"region":{"startLine":489}}}],"partialFingerprints":{"codehealthFindingId/v1":"52fad95b92462fd91c353f9d13c4dc76b6b5be613cc5293309c1e61b9b812024"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: objstore/azblob.go: FileTooLong \u2014 599 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/objstore/azblob.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"c3e38c118adf3a74f7121b781bb939ef5b4922a083522ee6b686a68599ed68d2"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: physicalop/base_physical_agg.go: FileTooLong \u2014 598 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/planner/core/operator/physicalop/base_physical_agg.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"32d621007543bc742aa70506281cfbf62f4ebb65134c803ccb7799d9848a5b70"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: importinto/planner.go: FileTooLong \u2014 593 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/dxf/importinto/planner.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"d87e71b087358a326303a1bf95dcc378967f9909842efad7c5935b2b10908fa8"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: storage/read.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":"pkg/statistics/handle/storage/read.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"5f09e0b163aee5fcf68bf6b3c4d2055abff0b7e72cfc6f5a260d708f71bda11c"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: expression/builtin_miscellaneous_vec.go: FileTooLong \u2014 588 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/expression/builtin_miscellaneous_vec.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"9669967e1e0749454eab6838bb0e392d103a1e3cac2b5e4cbad1ee255fd96ae9"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: expression/scalar_function.go: FileTooLong \u2014 584 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/expression/scalar_function.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"a962274eb8291b427399b1ded0f22b1e955a71976405f4d8d35faa674773abff"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: mydump/loader.go: FileTooLong \u2014 584 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/lightning/mydump/loader.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"b2efc444015564932de564c0a78c35edebd2a98732c35787d189fbdce796b264"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: SortExec: 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":"pkg/executor/sortexec/sort.go"},"region":{"startLine":43}}}],"partialFingerprints":{"codehealthFindingId/v1":"9daaf725ede2650cfd629ed315ef5be5ddf121aee93849cd3c7c05f1550b7c55"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: PointGetPlan: TooManyMethods \u2014 35 methods, declared across 2 files: physicalop/physical_batch_point_get.go (34), physicalop/plan_clone_generated.go (1). That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/operator/physicalop/physical_batch_point_get.go"},"region":{"startLine":56}}}],"partialFingerprints":{"codehealthFindingId/v1":"d41864003554e8f2187a4b8c2ac8268743e381969a08430d621bde4640b3da9d"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: ScalarSubQueryExpr: 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":"pkg/planner/core/scalar_subq_expression.go"},"region":{"startLine":77}}}],"partialFingerprints":{"codehealthFindingId/v1":"90c1d9165f2f6e48ce7cf744aa6d9617fa72c7b10f5163a8fe1a966b9ba72d89"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: AnalysisPriorityQueue: TooManyMethods \u2014 35 methods, declared across 2 files: priorityqueue/queue.go (21), priorityqueue/queue_ddl_handler.go (14). 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":"pkg/statistics/handle/autoanalyze/priorityqueue/queue.go"},"region":{"startLine":389}}}],"partialFingerprints":{"codehealthFindingId/v1":"6c583587578f1bb2902a68fdae0059f42336ef3c405407906d8113801883c0a9"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: ResourcePool: TooManyMethods \u2014 35 methods, declared across 2 files: memory/pool.go (34), memory/arbitrator.go (1). That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/util/memory/pool.go"},"region":{"startLine":32}}}],"partialFingerprints":{"codehealthFindingId/v1":"9e02ee4d9729f9c809e1a67266bc4ee89db39c19618b0b8dbca208caee9e6776"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: parquetfile/parser.go: FileTooLong \u2014 582 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/dumpformat/parquetfile/parser.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"d82b7533db753335893fb87c7ad7bb0ca51d206ac8fc2715f6054459eaf1c1e3"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: infosync/tiflash_manager.go: FileTooLong \u2014 578 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/domain/infosync/tiflash_manager.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"8ad807a9bb2dae1599f49e523e4195565ab5475774f019e12538eba0422c6cb5"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: aggfuncs/spill_deserialize_helper.go: FileTooLong \u2014 577 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/executor/aggfuncs/spill_deserialize_helper.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"a115fd6ed8afdfa6953042767d595201cc4234e28190c738d3af0466586d49a9"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: session/nontransactional.go: FileTooLong \u2014 575 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/session/nontransactional.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"f1e34e31e3b6114d3fe40d19aa4e75a2eb2a68d5a112b8c02d0c70222b3c554a"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: task/backup.go: FileTooLong \u2014 572 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":"br/pkg/task/backup.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"438da583a55cd6330ccf5002c6380d7f70a0ac02968c56de6fcd41055cd70f4b"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: v2/record.go: FileTooLong \u2014 570 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/util/stmtsummary/v2/record.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"4b8a015711b24ab3c9cd4982b1f5c601a1c9c58eb66ce3072ab3839a1417a88e"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: simplesst/writer.go: FileTooLong \u2014 567 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/ingestor/simplesst/writer.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"0f8a11b48d1c8fa3e037bc7611a360da8d0e0f4a3e843cb39f6dca887eb9ad04"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: joinorder/join_order.go: FileTooLong \u2014 567 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/planner/core/joinorder/join_order.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"75501e589939e8ff35dda8b8493ce67a2282243dac7a056492e083c38498c354"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: baseBuiltinFunc: TooManyMethods \u2014 34 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":"pkg/expression/builtin.go"},"region":{"startLine":51}}}],"partialFingerprints":{"codehealthFindingId/v1":"208f65c09a0056c8045f4a35c7bbd0415452fec4c8da74e03b2228f9ed079726"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: infoSchema: TooManyMethods \u2014 34 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":"pkg/infoschema/infoschema.go"},"region":{"startLine":71}}}],"partialFingerprints":{"codehealthFindingId/v1":"33acf20d7d04cf44763eef82dcfcd7d5bf739ac446919491d566c425bb920340"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: executor/point_get.go: FileTooLong \u2014 565 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/executor/point_get.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"e0f9c62064cb11dfc8ae9a349cd6155b2547fa650656b786eb40d857c98b2765"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: statistics/table.go: FileTooLong \u2014 565 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/statistics/table.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"0b6417743561fc3c027d69a562245954b6cc7841aaf31b29f3383d61d37eb079"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: server/http_status.go: FileTooLong \u2014 564 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/server/http_status.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"5cc828b0258fbc46dd3167cc8364a994a7ad08cb298e745a2ab1eeb2604a7446"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: ddl/cluster.go: FileTooLong \u2014 563 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/ddl/cluster.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"f242e2f38115215d371f970ac5f728f499a23859c13d975890ad0b534cd7bdb6"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: executor/brie.go: FileTooLong \u2014 563 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/executor/brie.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"381ff7ea18c21546a28866ce09ddd3b724a30675bc9b8b9943ed4a16d9cba297"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: ddl/job_scheduler.go: FileTooLong \u2014 562 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/ddl/job_scheduler.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"8d5de2aa245c9760eb5d3589e803efc578f0a66816d67da852952bc45f11ae8c"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: globalsort/engine.go: FileTooLong \u2014 562 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/ingestor/globalsort/engine.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"52ea2b8b86d310d8112c729a7489fd88265c2134f3e608baca10e0892acf915a"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: mockcopr/cop_handler_dag.go: FileTooLong \u2014 560 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/store/mockstore/mockcopr/cop_handler_dag.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"ede2774a7eb77d9141b51033189ac299a01c6f7928b28a2d59da594a2658dfbb"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: core/rule_join_reorder.go: FileTooLong \u2014 558 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/planner/core/rule_join_reorder.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"528903f3eefc2f86421ea17b3c8354e88cf9c4bfc03cabd214e4cfff472b32db"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: ddl/masking_policy.go: FileTooLong \u2014 556 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/ddl/masking_policy.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"03b480d43cf803711742d1619bdf736ed63e72a86a73d7baa7eee0eed6c1dce9"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: distsql/request_builder.go: FileTooLong \u2014 552 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/distsql/request_builder.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"3982982e0d7b5494fd7b1ad84555682089edb793a837e321e3747234c96e1eae"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: InsertValues: TooManyMethods \u2014 33 methods, declared across 2 files: executor/insert_common.go (32), executor/insert.go (1). That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/insert_common.go"},"region":{"startLine":55}}}],"partialFingerprints":{"codehealthFindingId/v1":"94c3e9d193fb45a5df227ff1bf908bdbc0967a8fca0d903e6d2c8816186090a1"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: CorrelatedColumn: TooManyMethods \u2014 33 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":"pkg/expression/column.go"},"region":{"startLine":44}}}],"partialFingerprints":{"codehealthFindingId/v1":"f17ac96fa387a29bda49af394d30a1190cf7d828cf3500aa582127aa41732f93"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: client: TooManyMethods \u2014 33 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":"pkg/store/mockstore/unistore/pd/client.go"},"region":{"startLine":64}}}],"partialFingerprints":{"codehealthFindingId/v1":"22ef1833d110893899f485e3016a9ef858657362e84dcad0b9cf0b90f980fc94"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: importer/get_pre_info.go: FileTooLong \u2014 549 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":"lightning/pkg/importer/get_pre_info.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"9a49988d29fa285e99423a5f8c52d6ede997910d8aa30401ceff02d16e7555ab"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: autoanalyze/autoanalyze.go: FileTooLong \u2014 549 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/statistics/handle/autoanalyze/autoanalyze.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"c5f911f1c85415f5e1931dcb1f3f80447cf0d5e0ed9bdf0783e5ebd2b23bdada"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: export/writer_util.go: FileTooLong \u2014 547 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":"dumpling/export/writer_util.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"81f57ebaf137d37b18a989272df90ff7c30ef78d8e2b62db09e55fa2772e84ba"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: tikv/region.go: FileTooLong \u2014 546 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/store/mockstore/unistore/tikv/region.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"764a2780e3693c300674ee8d67b3b52616d758d52c0facbc831552c99c08585f"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: variable/noop.go: FileTooLong \u2014 545 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: noopSysVars (29-649). Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body \u2014 the parts that share the same inputs and are named together \u2014 into its own unit in a sibling file, and have the original call them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/sessionctx/variable/noop.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"e1c35e018b7c868aa58876035b1cbdc1b12efed46c6c3b3cdf5977e683f074cc"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: core/index_join_path.go: FileTooLong \u2014 543 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/planner/core/index_join_path.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"e40407d6347b0c59b7eb43e514c64e4ba9a95f332b521b0097d78f116ffc0f30"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: cophandler/mpp.go: FileTooLong \u2014 542 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/store/mockstore/unistore/cophandler/mpp.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"df6bfcb48bb88c4f47b9bec60073b6fbf488028b42ca529568cee5606f00b3a3"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: expression/builtin_op_vec.go: FileTooLong \u2014 541 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/expression/builtin_op_vec.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"ec4ea733ab7415a939c4ff099acc09b48f60b4e06596ecd2e6489a63d9efa069"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: priorityqueue/queue.go: FileTooLong \u2014 540 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/statistics/handle/autoanalyze/priorityqueue/queue.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"0d9a9aba15fcef6b6ecb57c10a5cdbd80c5cd92ad573c658b3a4e85e966dd78e"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: physicalop/fragment.go: FileTooLong \u2014 539 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/planner/core/operator/physicalop/fragment.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"bd6b980e982ae0ba728e0c156d5444807be4102ef1a9eda9d0f64c4d4f4c84f2"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: funcdep/fd_graph.go: FileTooLong \u2014 539 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/planner/funcdep/fd_graph.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"4ef62cadff020f96ea62b3c9e3be0ffee997b12e858c6db9ff84b25217c9e735"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: importer/chunk_process.go: FileTooLong \u2014 538 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":"lightning/pkg/importer/chunk_process.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"a37935c703284aade5a5004864d592d043da8c3d34074b400f50c662f84ecf8a"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: v2/reader.go: FileTooLong \u2014 535 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/util/stmtsummary/v2/reader.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"b91a1740e254ebf83f0e2b1dd5655f9c3c885a2696d6f0f95cae9cc6fee07096"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: cophandler/cop_handler.go: FileTooLong \u2014 534 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/store/mockstore/unistore/cophandler/cop_handler.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"9c192bd5a13174f126ebbc5919d57e05683711e92b39dbe2fe61465bb12dc4e8"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: TableInfo: TooManyMethods \u2014 32 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":"pkg/meta/model/table.go"},"region":{"startLine":113}}}],"partialFingerprints":{"codehealthFindingId/v1":"611d9c752616b51b4949a612be94faa23f4ded5b0af5f4d2403e771a2cb60c92"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: Scanner: TooManyMethods \u2014 32 methods, declared across 2 files: parser/lexer.go (31), parser/misc.go (1). That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/parser/lexer.go"},"region":{"startLine":43}}}],"partialFingerprints":{"codehealthFindingId/v1":"b8974e047d1276667ce71b451cc8bed586b250e394636be8bad19e8709dc851a"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: MockRegionManager: TooManyMethods \u2014 32 methods, declared across 2 files: tikv/mock_region.go (31), tikv/server.go (1). That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/store/mockstore/unistore/tikv/mock_region.go"},"region":{"startLine":60}}}],"partialFingerprints":{"codehealthFindingId/v1":"a36843d11e658bcdd85431743100ec06ed8270b940c6de710402c74717a306ee"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: MyDecimal: TooManyMethods \u2014 32 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":"pkg/types/mydecimal.go"},"region":{"startLine":236}}}],"partialFingerprints":{"codehealthFindingId/v1":"0f543db268b7b045ff842cdccfa7acf76ab39f00d7a67a15561e49eef8255cb4"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: stream/table_mapping.go: FileTooLong \u2014 532 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":"br/pkg/stream/table_mapping.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"19832ac40164c4195b04ac29d2abf17273aec86baf6cfb4b5b32c85a1ea55a95"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: executor/grant.go: FileTooLong \u2014 532 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/executor/grant.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"8c1e1c124f212207f96e5cf805e8478f194e2fc952e1cf3c842b47ebd63c7760"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: executor/inspection_profile.go: FileTooLong \u2014 532 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/executor/inspection_profile.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"89f5918c103ef1d33c6c2f60e42bb0897026a1e96b204d92a2d4312ac170bbd7"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: aggfuncs/func_first_row.go: FileTooLong \u2014 531 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/executor/aggfuncs/func_first_row.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"f28c2063097032c5f6e9266bcd556ac216e39f658917a45ad22446fe13674702"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: pdutil/pd.go: FileTooLong \u2014 529 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"br/pkg/pdutil/pd.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"b9a1f16e215138e6d8a16b9e60054a59e6f98547da0e744e5e9762bf6c2fa21a"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: aggregate/agg_hash_executor.go: FileTooLong \u2014 529 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/executor/aggregate/agg_hash_executor.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"1b8c912798877e8f4874600816fad6d04298221aa74bbd7237819e0804ca47d7"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: s3store/ks3.go: FileTooLong \u2014 526 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/objstore/s3store/ks3.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"f86d91f4eb46d2a7f5b47f5ed0f4a73dfbab203392eff2d8f5197b16ddd45656"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: types/convert.go: FileTooLong \u2014 526 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/types/convert.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"790d3fd0c5026a5f558758c39cb41e4a1b8d05dc27842539946a55af809c55b0"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: chunk/column.go: FileTooLong \u2014 525 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/util/chunk/column.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"dc79edef66419938e4e870e2a3c0c8057d8f3c3ccd81ef290745b62eb5a774f9"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: checkpoint/checkpoint.go: FileTooLong \u2014 523 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":"br/pkg/checkpoint/checkpoint.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"f5c73a7e2016f882740b90f169b3ef47ec27e8ba52bf728e101bd18f9ecb182b"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: executor/ddl.go: FileTooLong \u2014 521 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/executor/ddl.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"4cb9105123560436614dd2c9fca97fa6fab2be27413f98fe2ab770022c615419"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: joinorder/conflict_detector.go: FileTooLong \u2014 521 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/planner/core/joinorder/conflict_detector.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"7146caf059819a50b279af41e3b3b6e4083d90a4ad1c12ec2c5cc48bd58b4b67"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: logicalop/logical_datasource.go: FileTooLong \u2014 520 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/planner/core/operator/logicalop/logical_datasource.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"4e2d8efb6cdbfc49de042efc98fe21800a5e2175a0d559c786880f8b519c94b1"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: snap_client/systable_restore.go: FileTooLong \u2014 519 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":"br/pkg/restore/snap_client/systable_restore.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"639cb56f23570724c299e817465fd69f62d3d44a18bd6f281918bc755457bc9e"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: scheduler/scheduler.go: FileTooLong \u2014 519 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/dxf/framework/scheduler/scheduler.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"c2f0030dfd13b1fffb8e87b14eea97837844c59b84df21cd40671bae1f100381"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: charset/charset.go: FileTooLong \u2014 518 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/parser/charset/charset.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"334c97a412b0cab27005a0a9f1c04e66537ccb8a7238f44a15564a46692109f9"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: Handle: TooManyMethods \u2014 31 methods, declared across 2 files: handle/bootstrap.go (21), handle/handle.go (10). 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":"pkg/statistics/handle/handle.go"},"region":{"startLine":70}}}],"partialFingerprints":{"codehealthFindingId/v1":"741781c0096c8189ceaa903963044fe9d93465c703389b13dbcae6f9e5cb4be6"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: simplesst/iter.go: FileTooLong \u2014 514 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/ingestor/simplesst/iter.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"66da71f33632dc7ccb5b43e49098d93b695bbe8e70f5753bf815a38e48c325a4"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: testkit/testkit.go: FileTooLong \u2014 514 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/testkit/testkit.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"917b45cc56562948521c1a979d3978133c67850d5b6c6d30e806bbb5d80989dd"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: cophandler/analyze.go: FileTooLong \u2014 510 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/store/mockstore/unistore/cophandler/analyze.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"8d7b07223fcbd9d584c4475e694b0f14110951663ce1bf22d05337f5ba8ac059"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: executor/load_data.go: FileTooLong \u2014 506 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/executor/load_data.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"f5bcb89f4dba5f18aee265d9c56a18ecbbea6f2d5d0b09b9ac7e52a338cfac2b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (20 lines \u00D7 2): pkg/ddl/executor.go:654-673 | pkg/ddl/executor.go:6339-6358 \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/ddl/executor.go:654\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/ddl/executor.go"},"region":{"startLine":654}}}],"partialFingerprints":{"codehealthFindingId/v1":"bbbe445510007b6d1fec726c4afc6771c3d208a9396a38ac2b9cc6cfb7f9f0c9"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (18 lines \u00D7 3): pkg/ddl/executor.go:6604-6621 | pkg/ddl/executor.go:6695-6712 | pkg/ddl/executor.go:6738-6755 \u2014 all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites \u2014 resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/ddl/executor.go:6604\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":"pkg/ddl/executor.go"},"region":{"startLine":6604}}}],"partialFingerprints":{"codehealthFindingId/v1":"c75b567f573afbb8839076b756284ba99e20b6156ffc835fee1f5174bba8a1cf"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (18 lines \u00D7 2): lightning/pkg/errormanager/errormanager.go:392-409 | lightning/pkg/errormanager/errormanager.go:454-471 \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 \u0060lightning/pkg/errormanager/errormanager.go:392\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":"lightning/pkg/errormanager/errormanager.go"},"region":{"startLine":392}}}],"partialFingerprints":{"codehealthFindingId/v1":"7ebf59342f301d09a7f70b922d16caf8136621e7f14fc8dd851760a0afa59077"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (16 lines \u00D7 2): lightning/pkg/checkpoints/checkpoints.go:2016-2031 | lightning/pkg/checkpoints/checkpoints.go:2039-2054 \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 \u0060lightning/pkg/checkpoints/checkpoints.go:2016\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":"lightning/pkg/checkpoints/checkpoints.go"},"region":{"startLine":2016}}}],"partialFingerprints":{"codehealthFindingId/v1":"1b3e591e2690735e26d749bd3c727c81f471b1914fd47231c2df31f378c037b0"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (16 lines \u00D7 2): lightning/pkg/errormanager/errormanager.go:717-732 | lightning/pkg/errormanager/errormanager.go:895-910 \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 \u0060lightning/pkg/errormanager/errormanager.go:717\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":"lightning/pkg/errormanager/errormanager.go"},"region":{"startLine":717}}}],"partialFingerprints":{"codehealthFindingId/v1":"d75d4cda88692e3bcf89193434ba9971a7db18f74b1961c780752f225e97bcaf"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (16 lines \u00D7 2): pkg/ddl/backfilling_operators.go:1271-1286 | pkg/ddl/index_merge_tmp.go:207-222 \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 \u0060pkg/ddl/backfilling_operators.go:1271\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/ddl/backfilling_operators.go"},"region":{"startLine":1271}}}],"partialFingerprints":{"codehealthFindingId/v1":"ea6019b7e758b36d8fc064c703eaa43845e4c1db547e500a63054225e23e26ba"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15 lines \u00D7 2): br/pkg/task/backup_raw.go:189-203 | br/pkg/task/backup_txn.go:176-190 \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 \u0060br/pkg/task/backup_raw.go:189\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":"br/pkg/task/backup_raw.go"},"region":{"startLine":189}}}],"partialFingerprints":{"codehealthFindingId/v1":"243be59317896875b9a43e62331ddb28b71798dfecc16369cb4f296d8b347d5d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15 lines \u00D7 2): pkg/autoid_service/autoid.go:90-104 | pkg/autoid_service/autoid.go:165-180 \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. 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":"pkg/autoid_service/autoid.go"},"region":{"startLine":90}}}],"partialFingerprints":{"codehealthFindingId/v1":"5fc95a05d226b65678e6efd1d2b616415ca201e43e7b6ffa4bfe69b66d566966"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): br/pkg/task/backup_raw.go:175-188 | br/pkg/task/backup_txn.go:162-175 \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 \u0060br/pkg/task/backup_raw.go:175\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":"br/pkg/task/backup_raw.go"},"region":{"startLine":175}}}],"partialFingerprints":{"codehealthFindingId/v1":"d2ed10b9a97ed98772fa53b76dc9be4e11a24066f0d1108955fc8c3cb7598143"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): br/pkg/task/backup_raw.go:246-260 | br/pkg/task/backup_txn.go:231-244 \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 \u0060br/pkg/task/backup_raw.go:246\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":"br/pkg/task/backup_raw.go"},"region":{"startLine":246}}}],"partialFingerprints":{"codehealthFindingId/v1":"d6dd812a779b58db7b61c3c28936f2f7afa6a8d72342d22cc05b2fbfef7164dd"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): lightning/pkg/errormanager/errormanager.go:532-547 | lightning/pkg/errormanager/errormanager.go:733-746 \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 \u0060lightning/pkg/errormanager/errormanager.go:532\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":"lightning/pkg/errormanager/errormanager.go"},"region":{"startLine":532}}}],"partialFingerprints":{"codehealthFindingId/v1":"69a2c504e4e825bfd8a26ff3d840e18693fa461436410510dd1c22ad759c693c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): pkg/ddl/backfilling_dist_scheduler.go:365-378 | pkg/ddl/backfilling_dist_scheduler.go:914-927 \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/ddl/backfilling_dist_scheduler.go:365\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":"pkg/ddl/backfilling_dist_scheduler.go"},"region":{"startLine":365}}}],"partialFingerprints":{"codehealthFindingId/v1":"8f883b354683f5ce68ddcef98f3806277cd7a98c200519a2733ab30eb067d529"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): pkg/ddl/backfilling_dist_scheduler.go:417-430 | pkg/ddl/backfilling_dist_scheduler.go:962-975 \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/ddl/backfilling_dist_scheduler.go:417\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":"pkg/ddl/backfilling_dist_scheduler.go"},"region":{"startLine":417}}}],"partialFingerprints":{"codehealthFindingId/v1":"a53e7820260d51a9a050f1bf925fe6d96f684777792c9f0acdc853ed05f511d4"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): pkg/ddl/cluster.go:468-481 | pkg/ddl/cluster.go:562-575 \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/ddl/cluster.go:468\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":"pkg/ddl/cluster.go"},"region":{"startLine":468}}}],"partialFingerprints":{"codehealthFindingId/v1":"ba6e05e44640c0ca4635482d1d58bf51b219c66769eb35ac53e0d07aa7b2a1be"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): pkg/ddl/column.go:725-738 | pkg/ddl/partition.go:4065-4078 \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 \u0060pkg/ddl/column.go:725\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":"pkg/ddl/column.go"},"region":{"startLine":725}}}],"partialFingerprints":{"codehealthFindingId/v1":"e763622879a502d775fee8722cf6309d1daeebca8786b0ec0e48b79a6f2e8757"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): pkg/ddl/ddl_running_jobs.go:208-221 | pkg/ddl/ddl_running_jobs.go:259-272 \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/ddl/ddl_running_jobs.go:208\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/ddl/ddl_running_jobs.go"},"region":{"startLine":208}}}],"partialFingerprints":{"codehealthFindingId/v1":"af287fea33692d9363064c6cfe812d0acc466088ca351869e269ed66a14cbc6f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): pkg/ddl/partition.go:1573-1586 | pkg/ddl/partition.go:1668-1682 \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/ddl/partition.go:1573\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/ddl/partition.go"},"region":{"startLine":1573}}}],"partialFingerprints":{"codehealthFindingId/v1":"068c7d7131dd5eccfb9c16c95cbe8e1851107f7642e99c8ea92e9b3afff91bbd"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): br/pkg/task/backup_raw.go:104-116 | br/pkg/task/backup_txn.go:76-88 \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 \u0060br/pkg/task/backup_raw.go:104\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"br/pkg/task/backup_raw.go"},"region":{"startLine":104}}}],"partialFingerprints":{"codehealthFindingId/v1":"41f93ea411ca32eeefff786f62965c5f0a10104c44b65218092b9714dbb00202"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): dumpling/export/dump.go:1087-1099 | dumpling/export/dump.go:1129-1141 \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 \u0060dumpling/export/dump.go:1087\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":"dumpling/export/dump.go"},"region":{"startLine":1087}}}],"partialFingerprints":{"codehealthFindingId/v1":"cfc3aa6251f1b36ca1caa5028d06719435aeb50da0f66c33dbac918405519a07"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): dumpling/export/writer_util.go:427-439 | dumpling/export/writer_util.go:706-718 \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 \u0060dumpling/export/writer_util.go:427\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":"dumpling/export/writer_util.go"},"region":{"startLine":427}}}],"partialFingerprints":{"codehealthFindingId/v1":"d26ef387964281d05f69a4acd66c78c59e683385972ae1dadb702d01510651d8"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): pkg/ddl/executor.go:2597-2609 | pkg/ddl/executor.go:2671-2683 \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/ddl/executor.go:2597\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":"pkg/ddl/executor.go"},"region":{"startLine":2597}}}],"partialFingerprints":{"codehealthFindingId/v1":"549dbe0e7a013957b40aa3bc4f07fc084fca0f7645160d6bb728d7f44b531f97"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): pkg/ddl/index.go:896-908 | pkg/ddl/index.go:1165-1177 \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/ddl/index.go:896\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":"pkg/ddl/index.go"},"region":{"startLine":896}}}],"partialFingerprints":{"codehealthFindingId/v1":"bada7d73d6a62c00057f2f292624b1866992f90b8a055de5497e3cf571f49f4c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): pkg/ddl/table.go:1588-1600 | pkg/ddl/table.go:1636-1648 \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/ddl/table.go:1588\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":"pkg/ddl/table.go"},"region":{"startLine":1588}}}],"partialFingerprints":{"codehealthFindingId/v1":"93d659685c5891dd0cd6536e42cd52b57c152f5e77b14714fa4188ccf2c7d0ae"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 3): br/pkg/task/stream.go:804-815 | br/pkg/task/stream.go:863-874 | br/pkg/task/stream.go:937-948 \u2014 all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites \u2014 resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060br/pkg/task/stream.go:804\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a \u0060defer\u0060-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead \u2014 before the caller uses what it releases \u2014 so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"br/pkg/task/stream.go"},"region":{"startLine":804}}}],"partialFingerprints":{"codehealthFindingId/v1":"6c5773d899f2c7268f548816f5702669e35e9c2b0da8f078656beb66e564bebe"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): br/pkg/metautil/debug.go:105-116 | br/pkg/metautil/metafile.go:313-324 \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 \u0060br/pkg/metautil/debug.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":"br/pkg/metautil/debug.go"},"region":{"startLine":105}}}],"partialFingerprints":{"codehealthFindingId/v1":"86689f5d84c2979df10cc858b54a34b3717d2e9214b907e148e4867ad612db9a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): br/pkg/restore/internal/prealloc_db/db.go:282-293 | br/pkg/restore/internal/prealloc_db/db.go:320-332 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060br/pkg/restore/internal/prealloc_db/db.go:282\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":"br/pkg/restore/internal/prealloc_db/db.go"},"region":{"startLine":282}}}],"partialFingerprints":{"codehealthFindingId/v1":"e777d932ba4130d7c712cd7a8de0189b1e820261ce3e919f6f4bb416e172e1de"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): br/pkg/restore/log_client/client.go:1829-1840 | br/pkg/restore/log_client/log_split_strategy.go:83-95 \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 \u0060br/pkg/restore/log_client/client.go:1829\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":"br/pkg/restore/log_client/client.go"},"region":{"startLine":1829}}}],"partialFingerprints":{"codehealthFindingId/v1":"738456babfb2db2235b2767d4fe4d4c7b4aac84c55bd8a2d733403d046c42efc"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): br/pkg/stream/crr/internal/checkpoint/storage.go:188-199 | br/pkg/utiltest/crr/harness.go:145-156 \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. 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":"br/pkg/stream/crr/internal/checkpoint/storage.go"},"region":{"startLine":188}}}],"partialFingerprints":{"codehealthFindingId/v1":"eaa98eede49dddeafd3269c407f516eef2e4dfd8935c9665c6052862f945efb5"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): br/pkg/stream/rewrite_meta_rawkv.go:213-224 | br/pkg/stream/rewrite_meta_rawkv.go:395-409 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060br/pkg/stream/rewrite_meta_rawkv.go:213\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":"br/pkg/stream/rewrite_meta_rawkv.go"},"region":{"startLine":213}}}],"partialFingerprints":{"codehealthFindingId/v1":"197928208244aa5297c48608d8bdba19099e286f4f99bdbf005ecde8b0b490a7"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): br/pkg/stream/rewrite_meta_rawkv.go:257-268 | br/pkg/stream/rewrite_meta_rawkv.go:304-315 \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. 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":"br/pkg/stream/rewrite_meta_rawkv.go"},"region":{"startLine":257}}}],"partialFingerprints":{"codehealthFindingId/v1":"3bc3a7cdba5080a0728b46f5d6fefe031f6bf8f6db7b13be7d7c59422baddc28"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): br/pkg/task/backup.go:519-530 | br/pkg/task/restore.go:1717-1731 \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 \u0060br/pkg/task/backup.go:519\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":"br/pkg/task/backup.go"},"region":{"startLine":519}}}],"partialFingerprints":{"codehealthFindingId/v1":"55c1a5342d75ec96863a92cba8ff56e9497feae0d60f9296dc683578c9bb9620"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): br/pkg/task/backup_raw.go:148-159 | br/pkg/task/backup_txn.go:128-139 \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 \u0060br/pkg/task/backup_raw.go:148\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also 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":"br/pkg/task/backup_raw.go"},"region":{"startLine":148}}}],"partialFingerprints":{"codehealthFindingId/v1":"f71cc511b28cce9a0d3f1aeee2d23108584c9af49b42fcafff9eae0776a132a1"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): lightning/pkg/importer/precheck_impl.go:669-680 | lightning/pkg/importer/precheck_impl.go:943-954 \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 \u0060lightning/pkg/importer/precheck_impl.go:669\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":"lightning/pkg/importer/precheck_impl.go"},"region":{"startLine":669}}}],"partialFingerprints":{"codehealthFindingId/v1":"294c688e9128571b8a2890a65c6ede506c2ecb1a7a30f7e05b85805783d45dd0"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): pkg/bindinfo/binding_operator.go:165-178 | pkg/bindinfo/binding_operator.go:222-233 \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/bindinfo/binding_operator.go:165\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":"pkg/bindinfo/binding_operator.go"},"region":{"startLine":165}}}],"partialFingerprints":{"codehealthFindingId/v1":"280b35d405b64b9af13e729348e4cde0c580c1def8ae245d95b90cb7ebefca4a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): pkg/ddl/backfilling_dist_scheduler.go:531-542 | pkg/ddl/backfilling_dist_scheduler.go:741-752 \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/ddl/backfilling_dist_scheduler.go:531\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":"pkg/ddl/backfilling_dist_scheduler.go"},"region":{"startLine":531}}}],"partialFingerprints":{"codehealthFindingId/v1":"fe117a7da7aa3cce6f5e1b8c903448df37c3ed81972402e757208f4f6e28c727"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): pkg/ddl/executor.go:7127-7138 | pkg/ddl/executor.go:7163-7174 \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/ddl/executor.go:7127\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/ddl/executor.go"},"region":{"startLine":7127}}}],"partialFingerprints":{"codehealthFindingId/v1":"5519c2148d00bf6364c9c05e2f5d4040d148dfdccec3706d0b09efc31ead01ab"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): pkg/ddl/modify_column.go:1045-1056 | pkg/ddl/modify_column.go:1256-1267 \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/ddl/modify_column.go:1045\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":"pkg/ddl/modify_column.go"},"region":{"startLine":1045}}}],"partialFingerprints":{"codehealthFindingId/v1":"639f83f238946e06e53d84194e56c365e57dfc6b46ac345b22abbc324575da7d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): pkg/ddl/schematracker/dm_tracker.go:767-778 | pkg/ddl/schematracker/dm_tracker.go:793-804 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. The matched lines also register a scope-exit action (a \u0060defer\u0060-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead \u2014 before the caller uses what it releases \u2014 so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/schematracker/dm_tracker.go"},"region":{"startLine":767}}}],"partialFingerprints":{"codehealthFindingId/v1":"c84d77fed19b60ab6d50fe18268f12a53a4768028813abf3ff55513f52bc9bb8"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): pkg/dxf/importinto/planner.go:766-777 | pkg/dxf/importinto/planner.go:796-807 \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/dxf/importinto/planner.go:766\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":"pkg/dxf/importinto/planner.go"},"region":{"startLine":766}}}],"partialFingerprints":{"codehealthFindingId/v1":"f680e26ff5c1a0150fc79ec5b8f811f4127925f14ebcdd2e91cdaa357020354d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 3): br/pkg/backup/store.go:132-142 | br/pkg/task/backup.go:692-703 | br/pkg/utils/store_manager.go:140-150 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at \u0060br/pkg/backup/store.go:132\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":"br/pkg/backup/store.go"},"region":{"startLine":132}}}],"partialFingerprints":{"codehealthFindingId/v1":"79042282d74945b5ac796d2a10291e247e79708f742c2139ee495776ad1445b9"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 3): lightning/pkg/errormanager/errormanager.go:623-633 | lightning/pkg/errormanager/errormanager.go:803-813 | lightning/pkg/errormanager/errormanager.go:832-842 \u2014 all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites \u2014 resolving only two of them leaves the rest to drift apart the first time one is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lightning/pkg/errormanager/errormanager.go"},"region":{"startLine":623}}}],"partialFingerprints":{"codehealthFindingId/v1":"418251715eaa23438d13bfc4e0f6467603cbb5404dc3cfaca6ab8b784b8b52a2"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 3): pkg/ddl/executor.go:2336-2347 | pkg/ddl/executor.go:2582-2592 | pkg/ddl/executor.go:2655-2666 \u2014 all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites \u2014 resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/ddl/executor.go:2336\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":"pkg/ddl/executor.go"},"region":{"startLine":2336}}}],"partialFingerprints":{"codehealthFindingId/v1":"7a68ed2b75d4791ce9f9ee7ccdbb674365c6ffe4ec7e97710d007621d17943e3"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 3): pkg/dxf/importinto/planner.go:825-835 | pkg/dxf/importinto/planner.go:846-856 | pkg/dxf/importinto/planner.go:862-872 \u2014 all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites \u2014 resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/dxf/importinto/planner.go:825\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":"pkg/dxf/importinto/planner.go"},"region":{"startLine":825}}}],"partialFingerprints":{"codehealthFindingId/v1":"8bcc48f1bb08cf21432299501ef0fa395194c4131f1301d98ec9425d8aac3f3e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): br/pkg/restore/snap_client/client.go:1221-1231 | br/pkg/restore/snap_client/client.go:1431-1441 \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 \u0060br/pkg/restore/snap_client/client.go:1221\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":"br/pkg/restore/snap_client/client.go"},"region":{"startLine":1221}}}],"partialFingerprints":{"codehealthFindingId/v1":"e9fec864a4490056198ded1c7ae4d177a53bcb3bd84d0924389d9ab681cd07d3"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): br/pkg/restore/snap_client/import.go:842-852 | br/pkg/restore/snap_client/import.go:966-976 \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 \u0060br/pkg/restore/snap_client/import.go:842\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":"br/pkg/restore/snap_client/import.go"},"region":{"startLine":842}}}],"partialFingerprints":{"codehealthFindingId/v1":"8045d0b819f515047387da85e8adbc76ead05a429267fd0256d512203927dff4"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): br/pkg/restore/utils/rewrite_rule.go:202-212 | br/pkg/restore/utils/rewrite_rule.go:242-252 \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 \u0060br/pkg/restore/utils/rewrite_rule.go:202\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":"br/pkg/restore/utils/rewrite_rule.go"},"region":{"startLine":202}}}],"partialFingerprints":{"codehealthFindingId/v1":"00416bd526e0c09794f6bdf4e83ee16705c88721df761fdb27c758c9e7ede4c4"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): br/pkg/task/operator/checksum_table.go:336-346 | br/pkg/task/operator/checksum_table.go:415-425 \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 \u0060br/pkg/task/operator/checksum_table.go:336\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":"br/pkg/task/operator/checksum_table.go"},"region":{"startLine":336}}}],"partialFingerprints":{"codehealthFindingId/v1":"b83117a44984ea4d436aa1d3a815185acadec05bd34487a4febddd0654998ba4"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): br/pkg/task/stream.go:875-885 | br/pkg/task/stream.go:949-959 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. The matched lines also 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":"br/pkg/task/stream.go"},"region":{"startLine":875}}}],"partialFingerprints":{"codehealthFindingId/v1":"488e4d5a2c6ea19769850bcf1f5c82956b90846d2bd1bfb1c2f86b06d8732f37"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): lightning/pkg/checkpoints/checkpoints.go:637-647 | lightning/pkg/checkpoints/checkpoints.go:675-685 \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 \u0060lightning/pkg/checkpoints/checkpoints.go:637\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":"lightning/pkg/checkpoints/checkpoints.go"},"region":{"startLine":637}}}],"partialFingerprints":{"codehealthFindingId/v1":"8c37b103c5f209a4ab5bf2983828dff7cd4d0faed3d1bb87c22f42c37daaa748"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): lightning/pkg/errormanager/errormanager.go:669-679 | lightning/pkg/errormanager/errormanager.go:875-885 \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 \u0060lightning/pkg/errormanager/errormanager.go:669\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":"lightning/pkg/errormanager/errormanager.go"},"region":{"startLine":669}}}],"partialFingerprints":{"codehealthFindingId/v1":"f326c00857922da04dad01d2e2d2324fc98593cc67d4f48161f523a598f4fecc"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): lightning/pkg/server/checkpoint_control.go:154-164 | lightning/pkg/server/checkpoint_control.go:275-286 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060lightning/pkg/server/checkpoint_control.go:154\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a \u0060defer\u0060-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead \u2014 before the caller uses what it releases \u2014 so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lightning/pkg/server/checkpoint_control.go"},"region":{"startLine":154}}}],"partialFingerprints":{"codehealthFindingId/v1":"14421f8da23d4dd6faf9aff972d485a677ddd4b6b06d19be7e15160af7d17a83"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): pkg/ddl/backfilling_operators.go:115-125 | pkg/ddl/backfilling_operators.go:173-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 \u0060pkg/ddl/backfilling_operators.go:115\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":"pkg/ddl/backfilling_operators.go"},"region":{"startLine":115}}}],"partialFingerprints":{"codehealthFindingId/v1":"20582a5a2bb237124e4dbcbfffc9ded906c5e39806ba6efe12198f658926d14a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): pkg/ddl/backfilling_operators.go:374-384 | pkg/ddl/backfilling_operators.go:1111-1121 \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/ddl/backfilling_operators.go:374\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":"pkg/ddl/backfilling_operators.go"},"region":{"startLine":374}}}],"partialFingerprints":{"codehealthFindingId/v1":"650a0922c91bda1f10f63bc2a02da336e3118427dc949ae966939e21c1b5e963"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): pkg/ddl/executor.go:3206-3216 | pkg/ddl/executor.go:7655-7665 \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/ddl/executor.go:3206\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/ddl/executor.go"},"region":{"startLine":3206}}}],"partialFingerprints":{"codehealthFindingId/v1":"ed65dea6e030dcac1bc0a5ecde1eae3e2c86fc8202d5f48fce6c5764d6ac78ef"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): pkg/ddl/executor.go:3508-3518 | pkg/ddl/schematracker/dm_tracker.go:592-602 \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 \u0060pkg/ddl/executor.go:3508\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/executor.go"},"region":{"startLine":3508}}}],"partialFingerprints":{"codehealthFindingId/v1":"a654807c6d784280ffd99c48b03085eee2476cbabfd45c5e9df93c5bbaa49445"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): pkg/ddl/executor.go:3756-3766 | pkg/ddl/executor.go:6180-6190 \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/ddl/executor.go:3756\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/ddl/executor.go"},"region":{"startLine":3756}}}],"partialFingerprints":{"codehealthFindingId/v1":"dc766870b862bc67f5bf329811bfb84e4ed45c65f1918f17e23e1614f40cd58e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): pkg/ddl/executor.go:6242-6252 | pkg/ddl/executor.go:6315-6325 \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":"pkg/ddl/executor.go"},"region":{"startLine":6242}}}],"partialFingerprints":{"codehealthFindingId/v1":"9f28498142df2029c66faa460c28bf7e1558398866498aa8750782e848fd368a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): pkg/ddl/modify_column.go:593-604 | pkg/ddl/modify_column.go:660-670 \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/ddl/modify_column.go:593\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":"pkg/ddl/modify_column.go"},"region":{"startLine":593}}}],"partialFingerprints":{"codehealthFindingId/v1":"aa03eccc9372755ae5e2cf971f90da5d105bbca8aa8db2027785b43e011701fc"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): pkg/ddl/partition.go:4142-4152 | pkg/ddl/partition.go:4216-4226 \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/ddl/partition.go:4142\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":"pkg/ddl/partition.go"},"region":{"startLine":4142}}}],"partialFingerprints":{"codehealthFindingId/v1":"a6c97eaef467aaa30e0b5bc9fef683ddb1ba0a5ea469b21c379a946404db110a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 3): pkg/ddl/column.go:879-888 | pkg/ddl/index.go:2865-2874 | pkg/ddl/index.go:3791-3800 \u2014 there are 3 copies across 2 file(s) \u2014 more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/ddl/column.go:879\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":"pkg/ddl/column.go"},"region":{"startLine":879}}}],"partialFingerprints":{"codehealthFindingId/v1":"5baa13d34598981c6702a8468f062ea8c93e3e48e3384718e49288cbe30cc7ed"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 3): pkg/domain/plan_replayer_dump.go:695-704 | pkg/domain/plan_replayer_dump.go:719-728 | pkg/domain/plan_replayer_dump.go:745-754 \u2014 all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites \u2014 resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/domain/plan_replayer_dump.go:695\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":"pkg/domain/plan_replayer_dump.go"},"region":{"startLine":695}}}],"partialFingerprints":{"codehealthFindingId/v1":"2412bb44c771c116b74ed14693dfd42294f89a163429b6e2514522004274552c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): br/pkg/restore/snap_client/import.go:803-812 | br/pkg/restore/snap_client/import.go:926-935 \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 \u0060br/pkg/restore/snap_client/import.go:803\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":"br/pkg/restore/snap_client/import.go"},"region":{"startLine":803}}}],"partialFingerprints":{"codehealthFindingId/v1":"ce6beac08789ba1a932bd90eaa4179b3a08353db132b65f9840ecc09f5e7c31e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): br/pkg/restore/split/split.go:392-401 | br/pkg/streamhelper/regioniter.go:123-132 \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 \u0060br/pkg/restore/split/split.go:392\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":"br/pkg/restore/split/split.go"},"region":{"startLine":392}}}],"partialFingerprints":{"codehealthFindingId/v1":"e2336e0be8446f9324607e1323d746186474811b2575579d73b851d98e7029a7"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): br/pkg/restore/tiflashrec/tiflash_recorder.go:120-129 | br/pkg/restore/tiflashrec/tiflash_recorder.go:147-156 \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 \u0060br/pkg/restore/tiflashrec/tiflash_recorder.go:120\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":"br/pkg/restore/tiflashrec/tiflash_recorder.go"},"region":{"startLine":120}}}],"partialFingerprints":{"codehealthFindingId/v1":"5f2f68e5d257444b2fd4d205450e2e0f5ac76849b56c64fa83be71f875cfd10f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): br/pkg/restore/utils/rewrite_rule.go:443-452 | br/pkg/restore/utils/rewrite_rule.go:472-481 \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 \u0060br/pkg/restore/utils/rewrite_rule.go:443\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":"br/pkg/restore/utils/rewrite_rule.go"},"region":{"startLine":443}}}],"partialFingerprints":{"codehealthFindingId/v1":"59f5b748e8ab9d9315c25b89f6c6245528b6caf0d3d7b8c0bcf0eb9c1ac5dcb1"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): br/pkg/stream/rewrite_meta_rawkv.go:141-150 | br/pkg/stream/rewrite_meta_rawkv.go:253-262 \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 \u0060br/pkg/stream/rewrite_meta_rawkv.go:141\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":"br/pkg/stream/rewrite_meta_rawkv.go"},"region":{"startLine":141}}}],"partialFingerprints":{"codehealthFindingId/v1":"080e49120fa76dfd6305962644aaf95a71e2cb292607b6fbe5a14cdea02c7ede"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): br/pkg/task/backup.go:247-256 | br/pkg/task/restore.go:600-609 \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 \u0060br/pkg/task/backup.go:247\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":"br/pkg/task/backup.go"},"region":{"startLine":247}}}],"partialFingerprints":{"codehealthFindingId/v1":"cbd9bd0034ccb6c54bb7a6acb22385517a02214587522ac24cd47db1711d0cbd"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): dumpling/export/dump.go:566-575 | dumpling/export/dump.go:620-629 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"dumpling/export/dump.go"},"region":{"startLine":566}}}],"partialFingerprints":{"codehealthFindingId/v1":"cd3ee8ea9be0c73c3c7389a01f383c096f8335f3f1a3c885850cbe0a746120bc"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): lightning/pkg/checkpoints/checkpoints.go:1799-1808 | lightning/pkg/importinto/checkpoint.go:548-559 \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 \u0060lightning/pkg/checkpoints/checkpoints.go:1799\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":"lightning/pkg/checkpoints/checkpoints.go"},"region":{"startLine":1799}}}],"partialFingerprints":{"codehealthFindingId/v1":"964d3125bd44a4d0a85311b3c1c5fe980c2890a5598a604ddc624b40e88f69df"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): pkg/ddl/add_column.go:730-739 | pkg/ddl/add_column.go:757-766 \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/ddl/add_column.go:730\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":"pkg/ddl/add_column.go"},"region":{"startLine":730}}}],"partialFingerprints":{"codehealthFindingId/v1":"394f73b29c4ebaecdabc54687aa559f9c320d4a424ec7bd38c4312994172c230"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): pkg/ddl/backfilling_import_cloud.go:140-149 | pkg/dxf/importinto/task_executor.go:756-765 \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 \u0060pkg/ddl/backfilling_import_cloud.go:140\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/ddl/backfilling_import_cloud.go"},"region":{"startLine":140}}}],"partialFingerprints":{"codehealthFindingId/v1":"b1f79f92b74901c216ef82450ad9bf8912f2d585dd9155a2ebbd8b4e5c8a147e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): pkg/ddl/create_table.go:243-253 | pkg/ddl/create_table.go:288-297 \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":"pkg/ddl/create_table.go"},"region":{"startLine":243}}}],"partialFingerprints":{"codehealthFindingId/v1":"8a12a8c947315b98ec190d8f49f56c96986b6e0e0428806c387031ef4d7b77b2"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): pkg/ddl/executor.go:727-736 | pkg/ddl/schematracker/dm_tracker.go:143-152 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 and call it from each site; until then, every change has to be made twice."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/executor.go"},"region":{"startLine":727}}}],"partialFingerprints":{"codehealthFindingId/v1":"7b8bc0b53becc73b982ec742f7d47fa7ff155b8beaf08b31c71a4a6a23e98277"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): pkg/ddl/executor.go:1514-1523 | pkg/ddl/schematracker/dm_tracker.go:270-279 \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. 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":"pkg/ddl/executor.go"},"region":{"startLine":1514}}}],"partialFingerprints":{"codehealthFindingId/v1":"04594a06e4365b4306d4193679dc503adbe16687a0a52212f507d147733a5d14"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): pkg/ddl/executor.go:3441-3450 | pkg/ddl/executor.go:3581-3590 \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/ddl/executor.go:3441\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":"pkg/ddl/executor.go"},"region":{"startLine":3441}}}],"partialFingerprints":{"codehealthFindingId/v1":"486d07f96c2acba019297cbaeb3f9c7a66d777548e8b6d59bca71d747ac426dd"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): pkg/ddl/executor.go:3634-3643 | pkg/ddl/executor.go:3836-3845 \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/ddl/executor.go:3634\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":"pkg/ddl/executor.go"},"region":{"startLine":3634}}}],"partialFingerprints":{"codehealthFindingId/v1":"554908237ffa070a68a7805618c3ebdb5d778952833310dc42dad8222664586d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): pkg/ddl/executor.go:3671-3680 | pkg/ddl/executor.go:4196-4205 \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/ddl/executor.go:3671\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":"pkg/ddl/executor.go"},"region":{"startLine":3671}}}],"partialFingerprints":{"codehealthFindingId/v1":"83ea1ad59a7348b61a61e56e8c0ce7125618412826400140d3ac0a35a5d9261c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): pkg/ddl/foreign_key.go:410-419 | pkg/ddl/foreign_key.go:423-432 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/ddl/foreign_key.go:410\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":"pkg/ddl/foreign_key.go"},"region":{"startLine":410}}}],"partialFingerprints":{"codehealthFindingId/v1":"e1c7f2ac1f615c979676d04635c4831fc59f4d2774dd7f764be3e1b32dcb6a38"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): pkg/ddl/masking_policy.go:41-50 | pkg/ddl/masking_policy.go:123-133 \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. 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":"pkg/ddl/masking_policy.go"},"region":{"startLine":41}}}],"partialFingerprints":{"codehealthFindingId/v1":"b3f8e97d3da27755f25c798bd9e0c5422b85828ce10e6d9d8f14cfdcac5f55a1"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): pkg/ddl/masking_policy.go:88-97 | pkg/ddl/masking_policy.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. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/ddl/masking_policy.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":"pkg/ddl/masking_policy.go"},"region":{"startLine":88}}}],"partialFingerprints":{"codehealthFindingId/v1":"0e6a24794dbc9bf40df67f6b7c5f51fe84c6071b1a92b4e75088415a68c36b44"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): pkg/ddl/modify_column.go:1014-1023 | pkg/ddl/modify_column.go:1234-1243 \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/ddl/modify_column.go:1014\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/modify_column.go"},"region":{"startLine":1014}}}],"partialFingerprints":{"codehealthFindingId/v1":"acf29d7ef78919d7bb5eb1ce5001aadd654b8f98338240008b2d728c1d858789"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): pkg/ddl/serverstate/syncer.go:152-162 | pkg/domain/serverinfo/syncer.go:451-460 \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 \u0060pkg/ddl/serverstate/syncer.go:152\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/ddl/serverstate/syncer.go"},"region":{"startLine":152}}}],"partialFingerprints":{"codehealthFindingId/v1":"f75bba45177f1631d25e841dee503a5244f6ad8b4795216d1d05622472a78fd3"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): pkg/domain/infosync/resource_manager_client.go:93-103 | pkg/domain/infosync/resource_manager_client.go:111-120 \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/domain/infosync/resource_manager_client.go:93\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":"pkg/domain/infosync/resource_manager_client.go"},"region":{"startLine":93}}}],"partialFingerprints":{"codehealthFindingId/v1":"10baa225deeefdda519430a4a6716e9151f159a3d57bb86410a29106f38889b8"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): pkg/domain/infosync/tiflash_manager.go:523-532 | pkg/domain/infosync/tiflash_manager.go:560-569 \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/domain/infosync/tiflash_manager.go:523\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":"pkg/domain/infosync/tiflash_manager.go"},"region":{"startLine":523}}}],"partialFingerprints":{"codehealthFindingId/v1":"bede1fef2f8749d20098cedeb4ae66f7db0239d7b0d45b17c851d343454d0518"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): pkg/dxf/framework/storage/task_table.go:664-673 | pkg/dxf/framework/storage/task_table.go:1087-1096 \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/dxf/framework/storage/task_table.go:664\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":"pkg/dxf/framework/storage/task_table.go"},"region":{"startLine":664}}}],"partialFingerprints":{"codehealthFindingId/v1":"dea1c12823e4a3e9439aee3a319fb36783e9bba3694245c967980e198715373e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 5): pkg/ddl/executor.go:329-337 | pkg/ddl/executor.go:380-388 | pkg/ddl/executor.go:419-427 | pkg/ddl/executor.go:595-603 | pkg/ddl/executor.go:786-794 \u2014 all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites \u2014 resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/ddl/executor.go:329\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":"pkg/ddl/executor.go"},"region":{"startLine":329}}}],"partialFingerprints":{"codehealthFindingId/v1":"4537167d20202c99d7a56b26cbe2470f0f8119b1c9c40901a19b352d7118f4a0"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 4): br/pkg/metautil/debug.go:50-58 | br/pkg/metautil/debug.go:93-103 | br/pkg/metautil/metafile.go:301-311 | br/pkg/metautil/statsfile.go:200-210 \u2014 there are 4 copies across 3 file(s) \u2014 more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"br/pkg/metautil/debug.go"},"region":{"startLine":50}}}],"partialFingerprints":{"codehealthFindingId/v1":"b0dd9c5bfeb8a41005b1cf39c75273adad8c22682d7a49b10c34f298718185d6"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 4): br/pkg/task/stream.go:630-638 | br/pkg/task/stream.go:816-824 | br/pkg/task/stream.go:875-883 | br/pkg/task/stream.go:949-957 \u2014 all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites \u2014 resolving only two of them leaves the rest to drift apart the first time one is edited. 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":"br/pkg/task/stream.go"},"region":{"startLine":630}}}],"partialFingerprints":{"codehealthFindingId/v1":"4022eb7cd731ebfd95530479383ebb7ab69265399f3b8fa61679f9fbde6214d9"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 4): pkg/ddl/executor.go:6581-6589 | pkg/ddl/executor.go:6627-6635 | pkg/ddl/executor.go:6666-6675 | pkg/ddl/executor.go:6719-6727 \u2014 all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites \u2014 resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/ddl/executor.go:6581\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":"pkg/ddl/executor.go"},"region":{"startLine":6581}}}],"partialFingerprints":{"codehealthFindingId/v1":"a6dfccb9786b6ed1d075174beab4a090388fedd0f32edfa8e33320a639c992a9"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 3): br/pkg/task/operator/checksum_table.go:65-75 | br/pkg/task/operator/checksum_table.go:92-100 | br/pkg/task/operator/checksum_table.go:527-535 \u2014 all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites \u2014 resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060br/pkg/task/operator/checksum_table.go:65\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"br/pkg/task/operator/checksum_table.go"},"region":{"startLine":65}}}],"partialFingerprints":{"codehealthFindingId/v1":"1bd91f7684e7153eb7fc697420fb2da17beb81f6808e5d9f78201eba6f65b185"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 3): dumpling/export/writer_util.go:199-207 | dumpling/export/writer_util.go:370-378 | dumpling/export/writer_util.go:666-674 \u2014 all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites \u2014 resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060dumpling/export/writer_util.go:199\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a \u0060defer\u0060-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead \u2014 before the caller uses what it releases \u2014 so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"dumpling/export/writer_util.go"},"region":{"startLine":199}}}],"partialFingerprints":{"codehealthFindingId/v1":"e52a15bcf55d5c097db2b470611ed4d6013e2d0e5824f828c086779316507e76"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): br/pkg/aws/ebs.go:300-308 | br/pkg/aws/ebs.go:689-697 \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":"br/pkg/aws/ebs.go"},"region":{"startLine":300}}}],"partialFingerprints":{"codehealthFindingId/v1":"54046b01b796edb3df125ec8d5067770cc089735d1a410aae32a826a151e5664"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): br/pkg/checkpoint/manager.go:97-105 | br/pkg/checkpoint/manager.go:121-129 \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 \u0060br/pkg/checkpoint/manager.go:97\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"br/pkg/checkpoint/manager.go"},"region":{"startLine":97}}}],"partialFingerprints":{"codehealthFindingId/v1":"90c884211adf87f274f797d69a040b541dabfa82f18e69c6175b22c40881bc92"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): br/pkg/restore/ingestrec/ingest_recorder.go:103-113 | br/pkg/restore/ingestrec/ingest_recorder.go:121-129 \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 \u0060br/pkg/restore/ingestrec/ingest_recorder.go:103\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"br/pkg/restore/ingestrec/ingest_recorder.go"},"region":{"startLine":103}}}],"partialFingerprints":{"codehealthFindingId/v1":"83efdcdb828fde42d8897d465dbb25bf8b96b6256f54f05b631606026ad2d21c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): br/pkg/restore/internal/rawkv/rawkv_client.go:99-107 | br/pkg/restore/internal/rawkv/rawkv_client.go:121-129 \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 \u0060br/pkg/restore/internal/rawkv/rawkv_client.go:99\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":"br/pkg/restore/internal/rawkv/rawkv_client.go"},"region":{"startLine":99}}}],"partialFingerprints":{"codehealthFindingId/v1":"7a8107ddd1d76dd91b451179b9559f7fcd65a955f620396e0cfcae0e1ce29eb7"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): br/pkg/restore/misc.go:548-556 | br/pkg/restore/snap_client/import.go:458-466 \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 \u0060br/pkg/restore/misc.go:548\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":"br/pkg/restore/misc.go"},"region":{"startLine":548}}}],"partialFingerprints":{"codehealthFindingId/v1":"d9ae44ea9999bbec69615148dedabba2fdba0cf8b13b494919fbdfe4a2cfaaba"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): br/pkg/restore/snap_client/import.go:869-877 | br/pkg/restore/snap_client/import.go:988-996 \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 \u0060br/pkg/restore/snap_client/import.go:869\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":"br/pkg/restore/snap_client/import.go"},"region":{"startLine":869}}}],"partialFingerprints":{"codehealthFindingId/v1":"e2aa352e673629b9c256961d622c10f5f2f99daaddd8ef58f496eb4ef1a6fbc4"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): br/pkg/restore/snap_client/systable_restore.go:625-633 | br/pkg/restore/snap_client/systable_restore.go:677-685 \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 \u0060br/pkg/restore/snap_client/systable_restore.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":"br/pkg/restore/snap_client/systable_restore.go"},"region":{"startLine":625}}}],"partialFingerprints":{"codehealthFindingId/v1":"78125b9a5aa15811d10c6035a1f5fca70cfc3279fe4a339c0b0615cfa5f9b20d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): br/pkg/utils/json.go:88-96 | br/pkg/utils/json.go:116-124 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. 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":"br/pkg/utils/json.go"},"region":{"startLine":88}}}],"partialFingerprints":{"codehealthFindingId/v1":"4190786fa6297825df08c387cc81d7114163d0a1bf1cb3f6a7b27d98b8ea7b9d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): dumpling/export/dump.go:82-90 | lightning/pkg/server/lightning.go:322-330 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 and call it from each site; until then, every change has to be made twice."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"dumpling/export/dump.go"},"region":{"startLine":82}}}],"partialFingerprints":{"codehealthFindingId/v1":"3361a43e2d58511a428be211d4481e8c1795090bb44fbafb115c87b127b80059"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): pkg/autoid_service/autoid.go:121-130 | pkg/autoid_service/autoid.go:197-205 \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/autoid_service/autoid.go:121\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":"pkg/autoid_service/autoid.go"},"region":{"startLine":121}}}],"partialFingerprints":{"codehealthFindingId/v1":"99a36f918b3876ccb1b2a95acdd565a48a24e0ce82ab7622d434e65107ce5676"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): pkg/ddl/add_column.go:676-684 | pkg/ddl/add_column.go:786-795 \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/ddl/add_column.go:676\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":"pkg/ddl/add_column.go"},"region":{"startLine":676}}}],"partialFingerprints":{"codehealthFindingId/v1":"750273245b7726c3a51b58e476c848a123b417cf4f1b263703cab9a84f6d34d0"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): pkg/ddl/add_column.go:698-706 | pkg/ddl/add_column.go:755-763 \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/ddl/add_column.go:698\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":"pkg/ddl/add_column.go"},"region":{"startLine":698}}}],"partialFingerprints":{"codehealthFindingId/v1":"02b850a04d30023a2d3a623cf85d6d7dcb40fd369f3c361997681b064d34201f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): pkg/ddl/cluster.go:396-404 | pkg/ddl/cluster.go:407-415 \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/ddl/cluster.go:396\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/ddl/cluster.go"},"region":{"startLine":396}}}],"partialFingerprints":{"codehealthFindingId/v1":"2473a5ddd45b0f51f1111fd4c6dc45da78a54ca3c199bde56550e6e8dfe8ecb9"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): pkg/ddl/create_table.go:65-73 | pkg/ddl/table.go:184-192 \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":"pkg/ddl/create_table.go"},"region":{"startLine":65}}}],"partialFingerprints":{"codehealthFindingId/v1":"1962a89b7834b895d8d195500c2bbdade67564a4a00e2954cf9393eb98fe8929"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): pkg/ddl/create_table.go:136-145 | pkg/ddl/table.go:574-582 \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 \u0060pkg/ddl/create_table.go:136\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/ddl/create_table.go"},"region":{"startLine":136}}}],"partialFingerprints":{"codehealthFindingId/v1":"82fc4ee698d9138e82a03a29546eef62d8b002c212792bb95c954c1cc55e5d7d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): pkg/ddl/executor.go:5875-5884 | pkg/ddl/executor.go:5981-5989 \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/ddl/executor.go:5875\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":"pkg/ddl/executor.go"},"region":{"startLine":5875}}}],"partialFingerprints":{"codehealthFindingId/v1":"8348d2590453ab25eb8f028935531b09c9aa00e579816de1dc5957a0008def5e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): pkg/ddl/executor.go:6404-6412 | pkg/ddl/executor.go:6492-6500 \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/ddl/executor.go:6404\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":"pkg/ddl/executor.go"},"region":{"startLine":6404}}}],"partialFingerprints":{"codehealthFindingId/v1":"e49955c4f7c8e4cb96037f5a2e6f4cfd9370e19c1448c32895ad95323eb13dd1"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): pkg/ddl/index.go:2027-2035 | pkg/ddl/modify_column.go:1352-1360 \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 \u0060pkg/ddl/index.go:2027\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a \u0060defer\u0060-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead \u2014 before the caller uses what it releases \u2014 so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register. 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":"pkg/ddl/index.go"},"region":{"startLine":2027}}}],"partialFingerprints":{"codehealthFindingId/v1":"28b8d6da210fd32666b814501380c95aad8bb6852daca125cd0854e6d5906ffe"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): pkg/ddl/modify_column.go:1110-1118 | pkg/ddl/modify_column.go:1175-1183 \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":"pkg/ddl/modify_column.go"},"region":{"startLine":1110}}}],"partialFingerprints":{"codehealthFindingId/v1":"862f79d27a0d5b159a18721d81e9de572294bd976a48cbf2143d65ac591b7254"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): pkg/ddl/modify_column.go:1421-1429 | pkg/ddl/schematracker/dm_tracker.go:611-619 \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 \u0060pkg/ddl/modify_column.go:1421\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":"pkg/ddl/modify_column.go"},"region":{"startLine":1421}}}],"partialFingerprints":{"codehealthFindingId/v1":"4babaf4f8d96086fbfe3639339d7e40030d8b2ca9f2c08482d2eb2ff0da7f30f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): pkg/ddl/partition.go:1776-1784 | pkg/ddl/partition.go:1799-1807 \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/ddl/partition.go:1776\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":"pkg/ddl/partition.go"},"region":{"startLine":1776}}}],"partialFingerprints":{"codehealthFindingId/v1":"d2cb24259d23a817c06b57dd8f3b186c03bea99ecd44a3c2d193cf5abe964033"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): pkg/ddl/partition.go:2055-2063 | pkg/ddl/partition.go:2068-2079 \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/ddl/partition.go:2055\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":"pkg/ddl/partition.go"},"region":{"startLine":2055}}}],"partialFingerprints":{"codehealthFindingId/v1":"001273bdb198d0f5e267ad4528a8fe4f2dcff0083991e957061768420d922b3e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): pkg/ddl/table.go:1493-1501 | pkg/ddl/table.go:1531-1539 \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":"pkg/ddl/table.go"},"region":{"startLine":1493}}}],"partialFingerprints":{"codehealthFindingId/v1":"ba03ea89e60dff3d5b1ba3239ca38d226dfda789ab4592bb3fff2a3cb392e387"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): pkg/domain/infosync/info.go:246-254 | pkg/domain/infosync/info.go:259-267 \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/domain/infosync/info.go:246\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":"pkg/domain/infosync/info.go"},"region":{"startLine":246}}}],"partialFingerprints":{"codehealthFindingId/v1":"dd2d235e7ff5222ddf5b0679525ca88b5215ecace5ba0c793dbf8aa7cc2c5638"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): pkg/dxf/framework/storage/task_table.go:594-602 | pkg/dxf/framework/storage/task_table.go:617-625 \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/dxf/framework/storage/task_table.go:594\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":"pkg/dxf/framework/storage/task_table.go"},"region":{"startLine":594}}}],"partialFingerprints":{"codehealthFindingId/v1":"83f715a85c0fa55f8ce34d5528d88f108c094d75f790e7866ec3270118c9d8a6"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): pkg/dxf/importinto/collect_conflicts.go:108-116 | pkg/dxf/importinto/conflict_resolution.go:79-87 \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 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":"pkg/dxf/importinto/collect_conflicts.go"},"region":{"startLine":108}}}],"partialFingerprints":{"codehealthFindingId/v1":"27928fbe7e83028813516e37a92ba89bd51985f5948b48850c4f4ea1b0b46cac"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): pkg/dxf/importinto/planner.go:657-665 | pkg/dxf/importinto/planner.go:687-695 \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. 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":"pkg/dxf/importinto/planner.go"},"region":{"startLine":657}}}],"partialFingerprints":{"codehealthFindingId/v1":"f94101d4be6998dc8978d0251ce38cb87386cad77b33f204720632a1f99e0d00"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): pkg/dxf/importinto/scheduler.go:251-259 | pkg/dxf/importinto/scheduler.go:656-664 \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":"pkg/dxf/importinto/scheduler.go"},"region":{"startLine":251}}}],"partialFingerprints":{"codehealthFindingId/v1":"0eecfdf027db6ee24e327ce15df740e182d62eb3c41e92c5d842b24af5b58c8b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): pkg/dxf/importinto/scheduler.go:917-925 | pkg/dxf/importinto/scheduler.go:937-945 \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/dxf/importinto/scheduler.go:917\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/dxf/importinto/scheduler.go"},"region":{"startLine":917}}}],"partialFingerprints":{"codehealthFindingId/v1":"ad67d79853d807fc7794af35345abf14b7e68111c4b0d3892e3fea3adbbafca4"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 6): pkg/ddl/executor.go:629-636 | pkg/ddl/executor.go:3659-3666 | pkg/ddl/executor.go:3864-3871 | pkg/ddl/executor.go:3918-3926 | pkg/ddl/executor.go:3954-3961 | pkg/ddl/executor.go:4178-4185 \u2014 all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites \u2014 resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/ddl/executor.go:629\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/ddl/executor.go"},"region":{"startLine":629}}}],"partialFingerprints":{"codehealthFindingId/v1":"0142e5b7ac54e0a1902ef9acbdccb5fafa58d5f776556c11cb0adcf80d4f5a3a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 3): pkg/ddl/executor.go:5375-5382 | pkg/ddl/executor.go:5456-5463 | pkg/ddl/executor.go:6115-6123 \u2014 all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites \u2014 resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/ddl/executor.go:5375\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/ddl/executor.go"},"region":{"startLine":5375}}}],"partialFingerprints":{"codehealthFindingId/v1":"8423d78d3bff784be8a705e78930b84fc9d8ac0aab356195d86a5675d7ecf2d6"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 3): pkg/ddl/index.go:3786-3793 | pkg/ddl/index_merge_tmp.go:188-195 | pkg/ddl/partition.go:3901-3908 \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":"pkg/ddl/index.go"},"region":{"startLine":3786}}}],"partialFingerprints":{"codehealthFindingId/v1":"e26d4c74142be09c88347d445dbd333004f84e6659352235b01ff0ea7239b9b3"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): br/pkg/aws/ebs.go:337-344 | br/pkg/aws/ebs.go:506-513 \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 \u0060br/pkg/aws/ebs.go:337\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":"br/pkg/aws/ebs.go"},"region":{"startLine":337}}}],"partialFingerprints":{"codehealthFindingId/v1":"4701e1e0423a0244a9896f2e68b4bc47d1516864245b16699b9edb2cd621ec86"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): br/pkg/restore/internal/prealloc_db/db.go:201-208 | br/pkg/restore/internal/prealloc_db/db.go:256-263 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060br/pkg/restore/internal/prealloc_db/db.go:201\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":"br/pkg/restore/internal/prealloc_db/db.go"},"region":{"startLine":201}}}],"partialFingerprints":{"codehealthFindingId/v1":"db2f9a4f27edcdb4f6946ad386a2417a59d3296d7f9149eb1447a9e40dbf497d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): br/pkg/restore/snap_client/import.go:1087-1094 | br/pkg/restore/snap_client/import.go:1180-1187 \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 \u0060br/pkg/restore/snap_client/import.go:1087\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":"br/pkg/restore/snap_client/import.go"},"region":{"startLine":1087}}}],"partialFingerprints":{"codehealthFindingId/v1":"dfa91cd7efabaa7fbaf1d73396c5875e9d5ac2058e85c03d90531ce824aa7357"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): br/pkg/restore/split/split.go:379-387 | br/pkg/streamhelper/regioniter.go:106-113 \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 \u0060br/pkg/restore/split/split.go:379\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":"br/pkg/restore/split/split.go"},"region":{"startLine":379}}}],"partialFingerprints":{"codehealthFindingId/v1":"5b6174fd220fdc77b3db72ece812b32481137fb3ff4e3764316abfa36e23b872"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): br/pkg/task/operator/checksum_table.go:84-91 | br/pkg/task/operator/checksum_table.go:508-515 \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. 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":"br/pkg/task/operator/checksum_table.go"},"region":{"startLine":84}}}],"partialFingerprints":{"codehealthFindingId/v1":"517f310132332a529310de7c720a640cfd95aaa9f7ded9957e1fc99db4832c87"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): pkg/ddl/executor.go:3262-3269 | pkg/ddl/executor.go:5478-5485 \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/ddl/executor.go:3262\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/ddl/executor.go"},"region":{"startLine":3262}}}],"partialFingerprints":{"codehealthFindingId/v1":"775d87b0bba30e789afb81c788cf7e7721385f8deb58752fa193614f0cd8100b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): pkg/ddl/executor.go:3533-3540 | pkg/ddl/modify_column.go:2014-2021 \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 \u0060pkg/ddl/executor.go:3533\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/ddl/executor.go"},"region":{"startLine":3533}}}],"partialFingerprints":{"codehealthFindingId/v1":"3a13ce8cd0238c507c808e6f1ed82499a47c3a452954b5a5a8dfd8d6c3e45467"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): pkg/ddl/executor.go:3732-3740 | pkg/ddl/executor.go:4181-4188 \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/ddl/executor.go:3732\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":"pkg/ddl/executor.go"},"region":{"startLine":3732}}}],"partialFingerprints":{"codehealthFindingId/v1":"4de7368fc178d9a32370e21bf2d96643d50aa2fea78d3df0f262192134911cf4"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): pkg/ddl/executor.go:4353-4360 | pkg/ddl/executor.go:5571-5578 \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/ddl/executor.go:4353\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/ddl/executor.go"},"region":{"startLine":4353}}}],"partialFingerprints":{"codehealthFindingId/v1":"8154078d44bf10cb635fa092589202c3b17b87293ba903a57dc9f0bd0a9f9dec"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): pkg/ddl/executor.go:4827-4834 | pkg/ddl/executor.go:5135-5142 \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/ddl/executor.go:4827\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":"pkg/ddl/executor.go"},"region":{"startLine":4827}}}],"partialFingerprints":{"codehealthFindingId/v1":"5214f29be1db48b1510ac7be615c23bb6649f218042d8ea1ffda0e54ff8d14b8"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): pkg/ddl/executor.go:5791-5798 | pkg/ddl/executor.go:5942-5949 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/executor.go"},"region":{"startLine":5791}}}],"partialFingerprints":{"codehealthFindingId/v1":"20e043de152b276cacc7203d39e5e6a37474a01ce2e29387c51a3439968de9fe"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): pkg/ddl/index.go:3239-3246 | pkg/ddl/index.go:3293-3300 \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/ddl/index.go:3239\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":"pkg/ddl/index.go"},"region":{"startLine":3239}}}],"partialFingerprints":{"codehealthFindingId/v1":"8c697b0d35216cbbc2d0669b61f3dd5cb5dec4f024a9773bd25421466ec2cf62"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): pkg/ddl/partition.go:2894-2901 | pkg/ddl/partition.go:2938-2947 \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/ddl/partition.go:2894\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":"pkg/ddl/partition.go"},"region":{"startLine":2894}}}],"partialFingerprints":{"codehealthFindingId/v1":"192993721bee28b48fbab119cdd9bc6fd4f2cec9857d3319275f38def2c4a37a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): pkg/distsql/request_builder.go:663-670 | pkg/distsql/request_builder.go:704-711 \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/distsql/request_builder.go:663\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":"pkg/distsql/request_builder.go"},"region":{"startLine":663}}}],"partialFingerprints":{"codehealthFindingId/v1":"1a1dfc0ae279cccc138c2b8200bc7f484ac0f0abdc9da81dffbbc04784100510"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): pkg/domain/crossks/cross_ks.go:231-238 | pkg/domain/domain.go:631-638 \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 \u0060pkg/domain/crossks/cross_ks.go:231\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":"pkg/domain/crossks/cross_ks.go"},"region":{"startLine":231}}}],"partialFingerprints":{"codehealthFindingId/v1":"921c472ca8298521af0e263f86e8a2155b3497174b94e3d18576350beac3fe5d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): pkg/domain/infosync/info.go:905-912 | pkg/domain/infosync/info.go:964-971 \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/domain/infosync/info.go:905\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":"pkg/domain/infosync/info.go"},"region":{"startLine":905}}}],"partialFingerprints":{"codehealthFindingId/v1":"9d1ccc32294597ffea834e4b125df1b8b62a1f27b1287ff293f062a4bd9805e2"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): pkg/dxf/importinto/collect_conflicts.go:119-126 | pkg/dxf/importinto/conflict_resolution.go:94-101 \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":"pkg/dxf/importinto/collect_conflicts.go"},"region":{"startLine":119}}}],"partialFingerprints":{"codehealthFindingId/v1":"211b7d9ab1035d42b87f541f62adb876f2df63bd1fac9f3bf2257ddccb2eb617"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): pkg/dxf/importinto/task_executor.go:496-503 | pkg/dxf/importinto/task_executor.go:718-726 \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/dxf/importinto/task_executor.go:496\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":"pkg/dxf/importinto/task_executor.go"},"region":{"startLine":496}}}],"partialFingerprints":{"codehealthFindingId/v1":"beaf1fa612ae86e4490cc19c606e78fa6f4627ee0ae21dfbcd4ad26ccfb7abbd"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 4): pkg/ddl/executor.go:2350-2356 | pkg/ddl/executor.go:2891-2897 | pkg/ddl/executor.go:4490-4496 | pkg/ddl/executor.go:7666-7673 \u2014 all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites \u2014 resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/ddl/executor.go:2350\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":"pkg/ddl/executor.go"},"region":{"startLine":2350}}}],"partialFingerprints":{"codehealthFindingId/v1":"99291a4bccca2cfb79ac4e3b35dcb9ff7cbc4caca5689a5fad655c7e0acb3cef"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 3): br/pkg/restore/internal/prealloc_db/db.go:189-195 | br/pkg/restore/internal/prealloc_db/db.go:199-205 | br/pkg/restore/internal/prealloc_db/db.go:254-260 \u2014 all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites \u2014 resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060br/pkg/restore/internal/prealloc_db/db.go:189\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":"br/pkg/restore/internal/prealloc_db/db.go"},"region":{"startLine":189}}}],"partialFingerprints":{"codehealthFindingId/v1":"d6ead081f7f1f5b8dfa6d247323ab81ee309e7b92089557e2ba7ea163608340d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 3): br/pkg/restore/split/split.go:194-200 | br/pkg/restore/split/split.go:378-385 | br/pkg/streamhelper/regioniter.go:105-111 \u2014 there are 3 copies across 2 file(s) \u2014 more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at \u0060br/pkg/restore/split/split.go:194\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"br/pkg/restore/split/split.go"},"region":{"startLine":194}}}],"partialFingerprints":{"codehealthFindingId/v1":"b83e50e83efa54f60f70251b2682cfa99126d491fb34475e99ea81b168341cec"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 3): br/pkg/restore/tiflashrec/tiflash_recorder.go:108-114 | br/pkg/restore/tiflashrec/tiflash_recorder.go:118-124 | br/pkg/restore/tiflashrec/tiflash_recorder.go:145-151 \u2014 all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites \u2014 resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060br/pkg/restore/tiflashrec/tiflash_recorder.go:108\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":"br/pkg/restore/tiflashrec/tiflash_recorder.go"},"region":{"startLine":108}}}],"partialFingerprints":{"codehealthFindingId/v1":"39a2de097da9d5ceef2745c85b6988cf225746a8b6107ed56b887edf5264cea5"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 3): pkg/ddl/executor.go:2287-2293 | pkg/ddl/executor.go:2839-2845 | pkg/ddl/executor.go:2911-2917 \u2014 all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites \u2014 resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/ddl/executor.go:2287\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/executor.go"},"region":{"startLine":2287}}}],"partialFingerprints":{"codehealthFindingId/v1":"298257a720f4b8f23236852b602b1ae0c12b1b9b1f81d1b94579c99981085173"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 3): pkg/ddl/executor.go:5524-5530 | pkg/ddl/executor.go:7118-7124 | pkg/ddl/executor.go:7154-7160 \u2014 all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites \u2014 resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060pkg/ddl/executor.go:5524\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/ddl/executor.go"},"region":{"startLine":5524}}}],"partialFingerprints":{"codehealthFindingId/v1":"023f40afa7b2063e4a48638d245a9d8e031a8150ddb64dba917678201d7cb9ce"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): br/pkg/registry/registration.go:317-323 | br/pkg/registry/registration.go:999-1006 \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 \u0060br/pkg/registry/registration.go:317\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"br/pkg/registry/registration.go"},"region":{"startLine":317}}}],"partialFingerprints":{"codehealthFindingId/v1":"dc351e286b7a539566245f908a6409e77c0aa189d1a66456a52ba8dffd781e66"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): br/pkg/restore/ingestrec/foreign_key.go:88-94 | br/pkg/restore/ingestrec/foreign_key.go:98-104 \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 \u0060br/pkg/restore/ingestrec/foreign_key.go:88\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":"br/pkg/restore/ingestrec/foreign_key.go"},"region":{"startLine":88}}}],"partialFingerprints":{"codehealthFindingId/v1":"623b3d89440952820137e34ac35861a0cc64e56e258170c9f385d15a52317924"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): br/pkg/restore/split/sum_sorted.go:147-153 | br/pkg/streamhelper/spans/sorted.go:139-145 \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 \u0060br/pkg/restore/split/sum_sorted.go:147\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"br/pkg/restore/split/sum_sorted.go"},"region":{"startLine":147}}}],"partialFingerprints":{"codehealthFindingId/v1":"abda7dffbd939d4b5c572efa7487242842f5b680cd243f5013dbfec3352c338d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): br/pkg/task/operator/test_storage.go:703-709 | br/pkg/task/operator/test_storage.go:711-717 \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 \u0060br/pkg/task/operator/test_storage.go:703\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":"br/pkg/task/operator/test_storage.go"},"region":{"startLine":703}}}],"partialFingerprints":{"codehealthFindingId/v1":"ddc2f4a387c58815af7c74589655f00c979c177a891538f1cec4337ea431b3a4"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): br/pkg/task/restore.go:2870-2876 | br/pkg/task/stream.go:1387-1393 \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 \u0060br/pkg/task/restore.go:2870\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"br/pkg/task/restore.go"},"region":{"startLine":2870}}}],"partialFingerprints":{"codehealthFindingId/v1":"efdef0be9b3f49b6ebf8df138be8ccd7a663c64f82d75472daaaf401ca5a110f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): br/pkg/utils/register.go:147-153 | br/pkg/utils/register.go:172-178 \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 \u0060br/pkg/utils/register.go:147\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"br/pkg/utils/register.go"},"region":{"startLine":147}}}],"partialFingerprints":{"codehealthFindingId/v1":"0c4f87f011d1538530ea57bd8a0ff65f0a94213cf05fd86fb1269ee120a6e893"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): lightning/pkg/importer/get_pre_info.go:493-499 | lightning/pkg/importer/get_pre_info.go:669-675 \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 \u0060lightning/pkg/importer/get_pre_info.go:493\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":"lightning/pkg/importer/get_pre_info.go"},"region":{"startLine":493}}}],"partialFingerprints":{"codehealthFindingId/v1":"8a049fb332c678a8d545341905725fc47740eff05ced1d03bef3c730e2b3d1c8"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): lightning/pkg/importer/table_import.go:1778-1784 | lightning/pkg/importer/table_import.go:1786-1792 \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 \u0060lightning/pkg/importer/table_import.go:1778\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lightning/pkg/importer/table_import.go"},"region":{"startLine":1778}}}],"partialFingerprints":{"codehealthFindingId/v1":"cad2a4853ac247ee173a9228bccf0cfbd17d9abb953d59f9e9a2edeca0e63d34"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): pkg/autoid_service/autoid.go:228-234 | pkg/autoid_service/autoid.go:270-276 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. 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":"pkg/autoid_service/autoid.go"},"region":{"startLine":228}}}],"partialFingerprints":{"codehealthFindingId/v1":"ce8789956f179ab7f926553ea81ab626e18800c92bf119a61ab166670dd45682"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): pkg/ddl/backfilling_dist_scheduler.go:615-621 | pkg/dxf/importinto/planner.go:602-609 \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 \u0060pkg/ddl/backfilling_dist_scheduler.go:615\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":"pkg/ddl/backfilling_dist_scheduler.go"},"region":{"startLine":615}}}],"partialFingerprints":{"codehealthFindingId/v1":"713ef36aecef96d564b4983fd87c2ef01220f799e8d2da2b2b3c705bfacdb97a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): pkg/ddl/backfilling_operators.go:1312-1318 | pkg/ddl/index_merge_tmp.go:252-258 \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 \u0060pkg/ddl/backfilling_operators.go:1312\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":"pkg/ddl/backfilling_operators.go"},"region":{"startLine":1312}}}],"partialFingerprints":{"codehealthFindingId/v1":"ecd01d4a0df9ab256c3ad6f0d9ff3b9c2e85703562a112ac94728441ad109b87"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): pkg/ddl/create_table.go:491-500 | pkg/ddl/create_table.go:780-786 \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/ddl/create_table.go:491\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/ddl/create_table.go"},"region":{"startLine":491}}}],"partialFingerprints":{"codehealthFindingId/v1":"9271fedcc51b390dd916a4798ece6f1f6d0f2ec88fcadb9da9e6416291310c4f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): pkg/ddl/create_table.go:1697-1703 | pkg/ddl/executor.go:5411-5417 \u2014 the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/create_table.go"},"region":{"startLine":1697}}}],"partialFingerprints":{"codehealthFindingId/v1":"2a6b253e31f5489658baf2a3c292edee9d9d8692f319080b2c99487cf9acda32"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): pkg/ddl/executor.go:2368-2374 | pkg/ddl/executor.go:2966-2972 \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. 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":"pkg/ddl/executor.go"},"region":{"startLine":2368}}}],"partialFingerprints":{"codehealthFindingId/v1":"46cd25cd39e7cec8a5f6dc01e6f46ac3679e9f0afc58c8b3a8856d1d85b80c5e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): pkg/ddl/executor.go:3571-3577 | pkg/ddl/schematracker/dm_tracker.go:709-715 \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. 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":"pkg/ddl/executor.go"},"region":{"startLine":3571}}}],"partialFingerprints":{"codehealthFindingId/v1":"575b0435f01c767f59ecb44ff98a2267c19da3634cd16ec24a4f951ba7bcdcde"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): pkg/ddl/executor.go:4646-4652 | pkg/ddl/executor.go:4655-4661 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/executor.go"},"region":{"startLine":4646}}}],"partialFingerprints":{"codehealthFindingId/v1":"3b97920086a53744c5f319badcb498501c914bd41eae3d8d15776cccc931a845"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): pkg/ddl/partition.go:1545-1551 | pkg/ddl/partition.go:1640-1646 \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/ddl/partition.go:1545\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/ddl/partition.go"},"region":{"startLine":1545}}}],"partialFingerprints":{"codehealthFindingId/v1":"7381221a45c8c0b536141ed894348d6dc70bcebf5878aa611090fe3c8e1ef277"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): pkg/distsql/request_builder.go:540-546 | pkg/distsql/request_builder.go:766-772 \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/distsql/request_builder.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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/distsql/request_builder.go"},"region":{"startLine":540}}}],"partialFingerprints":{"codehealthFindingId/v1":"273a257475867ce0f055ee6bd713d10934a355fd8f200bd7bacc966d6a70e331"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): pkg/dxf/importinto/scheduler.go:787-796 | pkg/dxf/importinto/scheduler.go:849-855 \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/dxf/importinto/scheduler.go:787\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/dxf/importinto/scheduler.go"},"region":{"startLine":787}}}],"partialFingerprints":{"codehealthFindingId/v1":"82d4cb0bcdd32bf4490f009a0b2843522290c39d72faf576c0b9692f1f09ddc8"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): pkg/ddl/executor.go:1809-1814 | pkg/ddl/schematracker/dm_tracker.go:929-934 \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 \u0060pkg/ddl/executor.go:1809\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":"pkg/ddl/executor.go"},"region":{"startLine":1809}}}],"partialFingerprints":{"codehealthFindingId/v1":"fcde551969d5e1ce58e5284e3622fbc05ad8fb59597f8e0b52231ff42ab9345a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): pkg/ddl/partition.go:2216-2221 | pkg/ddl/partition.go:2342-2348 \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/ddl/partition.go:2216\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/ddl/partition.go"},"region":{"startLine":2216}}}],"partialFingerprints":{"codehealthFindingId/v1":"388a7427a80c869d393128770cff9d954917b0b7d2968bb2c91deb3a7758901f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): pkg/domain/infosync/info.go:1276-1281 | pkg/domain/infosync/info.go:1340-1345 \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. 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":"pkg/domain/infosync/info.go"},"region":{"startLine":1276}}}],"partialFingerprints":{"codehealthFindingId/v1":"29d0bebba681c5aa1578e7a43e4d87f2b6eca9b28e954bc9c2a490dfad7ef153"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): pkg/domain/plan_replayer_dump.go:250-255 | pkg/domain/plan_replayer_dump.go:263-268 \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/domain/plan_replayer_dump.go:250\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":"pkg/domain/plan_replayer_dump.go"},"region":{"startLine":250}}}],"partialFingerprints":{"codehealthFindingId/v1":"1598688b244282c25253a8168bb77c79f32c5b3054c5572dcc8222892cce4c4d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): pkg/domain/serverinfo/syncer.go:126-131 | pkg/domain/serverinfo/syncer.go:177-182 \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":"pkg/domain/serverinfo/syncer.go"},"region":{"startLine":126}}}],"partialFingerprints":{"codehealthFindingId/v1":"1c53527caf25ba16af96fd4d13b61dae8f0b8cd140a4b71e01e96eeecdc5172c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): pkg/dxf/framework/scheduler/scheduler.go:293-298 | pkg/dxf/framework/scheduler/scheduler.go:379-384 \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":"pkg/dxf/framework/scheduler/scheduler.go"},"region":{"startLine":293}}}],"partialFingerprints":{"codehealthFindingId/v1":"7a3fa9affc3114d9c53432fb088a64247ee9140dc947a82770b438a54435a796"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): pkg/dxf/framework/scheduler/scheduler.go:355-360 | pkg/dxf/framework/scheduler/scheduler.go:436-441 \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/dxf/framework/scheduler/scheduler.go:355\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":"pkg/dxf/framework/scheduler/scheduler.go"},"region":{"startLine":355}}}],"partialFingerprints":{"codehealthFindingId/v1":"9981d0517ad62faadf55006b3125f3be4a2789c0c86ef78a8094458d293f1ba1"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): pkg/dxf/framework/taskexecutor/task_executor.go:704-709 | pkg/dxf/framework/taskexecutor/task_executor.go:745-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 \u0060pkg/dxf/framework/taskexecutor/task_executor.go:704\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":"pkg/dxf/framework/taskexecutor/task_executor.go"},"region":{"startLine":704}}}],"partialFingerprints":{"codehealthFindingId/v1":"560acfc4b006249e54f3f322281aaa8595ce0b750386737b6a8349a9afc97e45"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): br/pkg/restore/log_client/client.go:2567-2571 | br/pkg/restore/log_client/client.go:2662-2666 \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 \u0060br/pkg/restore/log_client/client.go:2567\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":"br/pkg/restore/log_client/client.go"},"region":{"startLine":2567}}}],"partialFingerprints":{"codehealthFindingId/v1":"7d390b7c00d29a7a828f919c38114414b7d2548e2036c7a4ffd815fbf9c7f3ee"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): pkg/ddl/executor.go:3416-3420 | pkg/ddl/schematracker/dm_tracker.go:676-680 \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 \u0060pkg/ddl/executor.go:3416\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/ddl/executor.go"},"region":{"startLine":3416}}}],"partialFingerprints":{"codehealthFindingId/v1":"84a4ab12f0c160ddf67ff3bee1db073e9d83ada824a7eb5c3e78d02b78dcaf48"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): pkg/ddl/executor.go:3561-3565 | pkg/ddl/schematracker/dm_tracker.go:664-668 \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 \u0060pkg/ddl/executor.go:3561\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/ddl/executor.go"},"region":{"startLine":3561}}}],"partialFingerprints":{"codehealthFindingId/v1":"4b7dea8d584a4b9e604b0f990009d3af852326c10a86f67f27756e9825677f6a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): pkg/ddl/executor.go:4545-4549 | pkg/ddl/executor.go:4598-4602 \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/ddl/executor.go:4545\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/ddl/executor.go"},"region":{"startLine":4545}}}],"partialFingerprints":{"codehealthFindingId/v1":"8facab549f6d73edc00e3c15ccceb12328e0cd1e61b4feee3b91d44568bb10c8"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): pkg/ddl/executor.go:5807-5811 | pkg/ddl/executor.go:5960-5964 \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. 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":"pkg/ddl/executor.go"},"region":{"startLine":5807}}}],"partialFingerprints":{"codehealthFindingId/v1":"eae1ef8445d647f932acdd6cc31694068ad1d0364f28deb677488108eb3627fe"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): pkg/ddl/index.go:4030-4034 | pkg/ddl/index.go:4047-4051 \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/ddl/index.go:4030\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":"pkg/ddl/index.go"},"region":{"startLine":4030}}}],"partialFingerprints":{"codehealthFindingId/v1":"84214df23044fddffe0c8c9e0751090227f155bcfffe971838268bcab812007f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): pkg/ddl/partition.go:4161-4165 | pkg/ddl/partition.go:4236-4240 \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/ddl/partition.go:4161\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/ddl/partition.go"},"region":{"startLine":4161}}}],"partialFingerprints":{"codehealthFindingId/v1":"10b2afd035921cf9c2251e090f3411a01e0bd56c2d5b26d0691719d7c8331f22"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: br/pkg/task/restore.go: br/pkg/task/restore.go changed 16 times in last 90 days, max complexity 126. 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":"br/pkg/task/restore.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"55d0a49e863be3877242c6e3949a06950157c7d62a853ae003b9a270bbb1da41"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: pkg/ddl/executor.go: pkg/ddl/executor.go changed 11 times in last 90 days, max complexity 117. 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":"pkg/ddl/executor.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"9fbd1289ea136a60b38ceeb42aac250b35967f3673468a865c3252482a1b2b82"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: pkg/session/session.go: pkg/session/session.go changed 17 times in last 90 days, max complexity 64. 1 of those changes was a fix/bug commit, and the other 16 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":"pkg/session/session.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"213c9989ac8db0d97b0959badd80786416dd9799f3a68d24e0434a150ce58fa7"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: pkg/config/config.go: pkg/config/config.go changed 14 times in last 90 days, max complexity 74. 1 of those changes was a fix/bug commit, and the other 13 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":"pkg/config/config.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"7d5ee4b2685dc7ea715301363f8207ea775818d15189560f1d72c1b25d1cd22b"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: pkg/expression/distsql_builtin.go: pkg/expression/distsql_builtin.go changed 2 times in last 90 days, max complexity 515. 1 of those changes was a fix/bug commit, and the other 1 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":"pkg/expression/distsql_builtin.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"ea7af238ca7e5d488f70124826b3f067347375c77f190578a872be7929b6f5d9"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: pkg/executor/simple.go: pkg/executor/simple.go changed 7 times in last 90 days, max complexity 141. 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":"pkg/executor/simple.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"8516358f98ca093bc34732898f3e123a589ce3781f928982f392fd47e387efa1"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: pkg/planner/core/planbuilder.go: pkg/planner/core/planbuilder.go changed 10 times in last 90 days, max complexity 94. 1 of those changes was a fix/bug commit, and the other 9 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":"pkg/planner/core/planbuilder.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"4f4c8fded7803668389753494f55ab5d25f98050954057d24b4c77803a10648c"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: br/pkg/task/stream.go: br/pkg/task/stream.go changed 13 times in last 90 days, max complexity 58. 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":"br/pkg/task/stream.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"909ff1fd7c3aaf3b10b971dfb3da1a485767282b94b7a9327e015b913e7e3414"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: pkg/parser/ast/ddl.go: pkg/parser/ast/ddl.go changed 3 times in last 90 days, max complexity 197. 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":"pkg/parser/ast/ddl.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"025778bc55083b7b065a60bf6741deac24c6989b951d63ce4222c0ba57cb36e6"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: pkg/ddl/index.go: pkg/ddl/index.go changed 13 times in last 90 days, max complexity 44. 2 of those changes were fix/bug commits, and the other 11 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":"pkg/ddl/index.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"852ba45d2ed93b0003c8dd700025af62bdce53f0978c34e438297a4a469a242d"}},{"ruleId":"D16","level":"note","message":{"text":"Off-boarding risk: anonymized user #1: If anonymized user #1 becomes unavailable, 39 significant file(s) lose their only recent owner: lightning/pkg/checkpoints/checkpoints.go, pkg/dxf/framework/scheduler/scheduler.go, pkg/dxf/framework/taskexecutor/task_executor.go, pkg/dxf/importinto/planner.go, pkg/dxf/framework/scheduler/scheduler_manager.go, pkg/server/handler/tikvhandler/dxf.go, pkg/ddl/jobsubmit/submit.go, pkg/domain/crossks/cross_ks.go (\u002B31 more). Pair on, review, or document these before any departure."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"ff431b3e0163cd0570fcb31083b1997eb398100a567e09bb853c5e792e31b6e0"}},{"ruleId":"D16","level":"note","message":{"text":"Off-boarding risk: anonymized user #2: If anonymized user #2 becomes unavailable, 9 significant file(s) lose their only recent owner: pkg/util/topsql/reporter/ru_datamodel.go, pkg/util/topsql/reporter/single_target.go, pkg/util/topsql/stmtstats/aggregator.go, pkg/util/topsql/reporter/ru_window_aggregator.go, pkg/util/topsql/topsql.go, pkg/util/topsql/state/state.go, pkg/util/topsql/reporter/metrics/metrics.go, pkg/util/topsql/stmtstats/rustats.go (\u002B1 more). Pair on, review, or document these before any departure."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"3a9997f0ade091af2e3256a0e16bf17577b126595274710403d4ea8f14ca3d99"}},{"ruleId":"D16","level":"note","message":{"text":"Off-boarding risk: anonymized user #3: If anonymized user #3 becomes unavailable, 8 significant file(s) lose their only recent owner: pkg/statistics/handle/autoanalyze/priorityqueue/queue.go, pkg/parser/ast/stats.go, pkg/statistics/handle/autoanalyze/refresher/refresher.go, pkg/statistics/handle/autoanalyze/priorityqueue/static_partitioned_table_analysis_job.go, pkg/statistics/handle/autoanalyze/priorityqueue/non_partitioned_table_analysis_job.go, pkg/statistics/handle/autoanalyze/priorityqueue/job.go, pkg/statistics/estimate.go, pkg/statistics/handle/autoanalyze/priorityqueue/interval.go. Pair on, review, or document these before any departure."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"2d50df96a6d3d24b3986919b334fef88501592681896cd51a23e687a424dfef8"}},{"ruleId":"D16","level":"note","message":{"text":"Off-boarding risk: anonymized user #4: If anonymized user #4 becomes unavailable, 8 significant file(s) lose their only recent owner: pkg/executor/aggfuncs/func_first_row.go, pkg/executor/sortexec/sort.go, pkg/executor/join/hash_join_spill_helper.go, pkg/executor/aggfuncs/func_avg.go, pkg/executor/aggfuncs/func_percentile.go, pkg/executor/aggfuncs/func_sum.go, pkg/store/copr/mpp_probe.go, pkg/executor/aggfuncs/func_varpop.go. Pair on, review, or document these before any departure."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"5fed3792c04166f6648572b6165a757e03500ea4e2a55303cf8303ab0ebb9a9f"}},{"ruleId":"D16","level":"note","message":{"text":"Off-boarding risk: anonymized user #5: If anonymized user #5 becomes unavailable, 7 significant file(s) lose their only recent owner: pkg/planner/core/operator/physicalop/physical_common_plans.go, pkg/executor/windows/pipelined_window.go, pkg/executor/windows/builder.go, pkg/util/parser/ast.go, pkg/planner/core/subquery_plan_builder.go, pkg/expression/builtin_vectorized.go, pkg/planner/core/constraint/exprs.go. Pair on, review, or document these before any departure."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"b0eae9655d4079e1e0332c16ae7bc38e1ce35d45ec0192b47f2d9b299f51e381"}},{"ruleId":"D16","level":"note","message":{"text":"Off-boarding risk: anonymized user #6: If anonymized user #6 becomes unavailable, 6 significant file(s) lose their only recent owner: pkg/util/memory/arbitrator.go, pkg/util/memory/global_arbitrator.go, pkg/util/memory/pool.go, pkg/util/memory/utils.go, pkg/metrics/memory.go, pkg/executor/join/concurrent_map.go. Pair on, review, or document these before any departure."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"a0e35ee67ad6bd4a18b1ab77e7febb9c3c47fbb07946fdf0584bfb3ea65e0e49"}},{"ruleId":"D16","level":"note","message":{"text":"Off-boarding risk: anonymized user #7: If anonymized user #7 becomes unavailable, 6 significant file(s) lose their only recent owner: pkg/importsdk/file_scanner.go, lightning/pkg/importinto/job_orchestrator.go, lightning/pkg/importinto/importer.go, lightning/pkg/importinto/job_submitter.go, pkg/importsdk/pattern.go, pkg/importsdk/config.go. Pair on, review, or document these before any departure."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"480f955f4c3a8560f4e31b11bf004b386ca007aedf93b69af56a16bd98cf5905"}},{"ruleId":"D16","level":"note","message":{"text":"Off-boarding risk: anonymized user #8: If anonymized user #8 becomes unavailable, 4 significant file(s) lose their only recent owner: pkg/planner/core/operator/physicalop/fragment.go, pkg/planner/core/partidx/check_constraint.go, pkg/planner/util/null_misc_builtins.go, pkg/executor/internal/util/partition_table.go. Pair on, review, or document these before any departure."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"b6872840e28f4fe084c1ce291050970eb07fc2e5f5ac935aa986841fd5fcac1e"}},{"ruleId":"D16","level":"note","message":{"text":"Off-boarding risk: anonymized user #9: If anonymized user #9 becomes unavailable, 4 significant file(s) lose their only recent owner: pkg/resourcegroup/runaway/manager.go, pkg/resourcegroup/runaway/syncer.go, pkg/metrics/resource_group.go, pkg/resourcegroup/runaway/flusher.go. Pair on, review, or document these before any departure."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"6cd6f84b091f4ea575d17ce1f269d1a23522c6b6975bdc4e0c3408085f1475b2"}},{"ruleId":"D16","level":"note","message":{"text":"Off-boarding risk: anonymized user #10: If anonymized user #10 becomes unavailable, 4 significant file(s) lose their only recent owner: pkg/util/hint/hint_processor.go, pkg/planner/core/plan_cache_instance.go, pkg/executor/bind.go, pkg/planner/util/fixcontrol/set.go. Pair on, review, or document these before any departure."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"c933cb974d34024521261611e5438ba8e36e46fab2954deea24b0e69e11f20d7"}},{"ruleId":"D16","level":"note","message":{"text":"Off-boarding risk: anonymized user #11: If anonymized user #11 becomes unavailable, 3 significant file(s) lose their only recent owner: pkg/planner/cascades/memo/memo.go, pkg/planner/implementation/simple_plans.go, pkg/planner/core/operator/physicalop/physical_show.go. Pair on, review, or document these before any departure."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"0b40dea29f99b75dd8c4f2d9e41e78d5fa6d19e05e877bd74c86c68c58cdd1d3"}},{"ruleId":"D16","level":"note","message":{"text":"Further sole-owners (lower concentration): 22 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 (126 single-owned of 1741 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 #12 (3 file(s)), anonymized user #13 (2 file(s)), anonymized user #14 (2 file(s)), anonymized user #15 (2 file(s)), anonymized user #16 (2 file(s)), anonymized user #17 (1 file(s)) (\u002B16 more) \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":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2018-07-01-refactor-aggregate-framework.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"027163b19fabc65bd2b6563ce1b93ea09ef35f1a98178d55e94cf1568bc1c578"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2018-07-19-row-format.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"47d67e16ef24a7d889913236ffcab5f46b3480acd42da833a4fb629bd2d5a279"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2018-07-22-enhance-propagations.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"0f9d7cecf4a84181bf9734b24b992085ec2c0e349839d363ee1c3b3cc6e9fd71"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2018-08-10-restore-dropped-table.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"6e840391e8f850bb286223c7f5067f6cc478cad149b4237e4bcb279e93f1d097"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2018-08-29-new-planner.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"593caecc41c1f0d78cd827ca327c34196be9b8d9621005fe61a86729ce7017d1"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2018-09-04-histograms-in-plan.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"ee7b84c7d0c8054f27821af8b14b1b9172a9ed730a45688abfe09e72600e10b9"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2018-09-10-adding-tz-env.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"fdabd9e3ea1c86eb7b3dd79fb30ea583189689eb87dc567c0a1faeb6904b674d"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2018-09-21-radix-hashjoin.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"ba82f84f6112c73b6ebc3e1156d9f073c785e531be1f313db0ee1d4b014edbb2"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2018-10-08-online-DDL.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"1b139f08bf73a43571f59d35eb7697451116be4f99a7fda860933b5a4511f2a7"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2018-10-19-table-partition.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"48c5a0e85b6a6a8105c0847c562562e6893bf246d5aaac2c80008c8a1791440d"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2018-10-20-join-reorder-dp-v1.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"ea03cdbcf2e303078a74bf79c4042b032ada3625100218123805c7396e7302b1"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2018-10-22-the-column-pool.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"a012bedf615688a4183d1629909c69bb8d1d6ce1a595d45fe5a4d777c17c0092"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2018-10-24-view-support.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"1f9da9e49dd9a162c9227346469ee4e6fa719ebd2c8baac261e228db2d360bb8"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2018-10-31-window-functions.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"54d86ea4f17eb5c8350a626cef60a85e77df45036bc5882a15e8cf2d8324a046"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2018-11-29-ast-to-sql-text.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"689b7fd6b26574e18bc1f92995ad97b2716d537cbb99d231007872670f84e1bc"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2018-12-10-plugin-framework.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"70b66804e1fc523583031252cad5fc5c4587609738e886f0a1a98963826a835f"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2018-12-11-sql-plan-management.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"58431cb9fa9ac00ce6124254a47cfbf1845593bef82dd68f4872f58225733a3a"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2019-01-25-skyline-pruning.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"2995578b6259e23e73c8865c8ec9863cae7bf32d39f787d814663ac05011e384"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2019-11-14-tidb-builtin-diagnostics-zh_CN.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"e76afd5e9e842243cde14d94be48fff9c46d65815438dcb07a2ce52076c0dc2f"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2019-11-14-tidb-builtin-diagnostics.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"cc8b1b4f286d2cd788c52efc205a2e5523f8af899977c55f3bd83d121e93d8b9"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2019-11-18-tidb-with-wasm.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"c7bd75e49a73e4fe96b8aa3241cbb1f1b631046cdc60b76bfe82cb50f4c197c2"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2020-01-24-collations.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"091eaf685da85b32c74e578695a4df242a64dd28e0d64a45176dce8d8906b133"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2020-03-12-invisible-index.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"9d24a3a886c4de2d60df020f2111f1971d5af62536a27e7e84fd06e124974ea6"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2020-04-17-sql-sequence.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"96f8bdeaecaf9e100beef864b8e22744dda443e985c7bf8e1889b12630a4e8f1"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2020-04-20-brie.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"49d2f937c12dac7a9e7c73ef4b32408d5c92c76ff8960c96074ba901cab5d4a1"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2020-05-08-cluster-index.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"9894d35e63e3504ed5da1d3667b08dfe18e3e805ff5ca4c006ed8fca33209edf"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2020-05-08-standardize-error-codes-and-messages.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"e55578e22198d931f8fab1faad8e81261d27fd8535e0f3acd3dafc16c7a1d3c0"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2020-05-11-heap-profile-record.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"b52fe29598ce8d436a841a4ccf3fa695932544d019a035bd2e8af6925260b2b1"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2020-06-01-global-kill.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"8117ad7dd5c671089020cce16f07f18c2ea52954e342b69778aa3c6ea6dc20c3"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2020-06-24-placement-rules-in-sql.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"7ae4cb04e01e57dfe47d2c8597e38003b71ded90f7807f213a82952258633466"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2020-07-07-change-column-types.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"98fed902e5e4210ec01d015d6d133d52bd2db7b4b40b1e9f5c7e848fb2a30a82"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2020-08-04-global-index.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"80ae05a1edabc4ed7f3b243f75e493cced60a530fe3b2b454c7af849de5f4f57"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2020-09-12-utf8mb4-pinyin-order.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"a4446fcff4267434222a8a92a3b709795a2d4caa6ecedf6091ac5da83bc2fd2e"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2020-09-30-index-usage-information.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"8640efd189df59593246049878c7db874172ddece7aa4fa798f9b8ede92eb7d2"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2021-03-01-pipelined-window-functions.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"ab34d031c6ad73a1ae8e8a743c46ae87805e8dd3c4c8ad54b79411aeb9609b96"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2021-03-09-dynamic-privileges.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"56f75f44eb6f9465092bdcb388a0e5d4d9d079ea56abeeb58d83752521775c4c"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2021-03-09-security-enhanced-mode.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"790c90e096056d78c57d8b6c46094d278f9043ee9c136958ed6c8397127708a2"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2021-03-30-small-table-caching.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"1cc9da34810211d1648ee5c2a7cf96ff6bc52e41cceb2091a1e73e5df2ce4698"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2021-04-18-common-table-expression.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"e4bd33152aabca11fe70e44fa9f802983368f61ae6064bc894fd875705457eab"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2021-04-20-temporary-table.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"3b97afc351d03e2d35ce8875d7eec3345c21d46a48d871e157391f0b8b1b9140"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2021-04-21-unify-log-library.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"60e89f68707c5c5e52c4f440090d30c678e5a5b0a36c271ed4d2d86c18fdabaa"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2021-04-26-lock-view.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"7a4c0574fcc37b732b32867307c79c98fac43a14b4dc7eef1a893afbe397ab55"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2021-06-23-restricted-read-only.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"aa256fab63ec1a39e1e197ad03afa3fcb9b8c6923cc6095697e4995962c5aad4"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2021-06-23-spilled-unparallel-hashagg.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"c7edd5a162aa0eeedb9d462bd36674e6c40190e8ce1109c841b04bb113301275"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2021-06-27-restructure-tests.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"38a18353587915e4e3e011eb3d4b0edc5ea1909cf076452272814288ac361eb3"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2021-07-07-rule-based-index-selection.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"c1f9b716cd5e76f072534df0dab4cf8bf1592379657afb2e177833331ae7817c"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2021-07-29-hidden-sysvars.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"e731799f562f326efed5a13ea1d5a0dcd922227549918166f4400f16a24918f8"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2021-08-18-charsets.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"b5560960b6373ca4f010549e0e048e6b905a80dab94b1b73724cdc1b034823da"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2021-09-22-data-consistency.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"15bf08bdba39f7c191c76a5eb88273a7bd1167bf9670c71f8b98162120fac92e"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2021-09-22-stale-read.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"a8cc6bdceec8e6c5eca971ea945b77ed2ad29c4d3dd98f61133c146e2f703e48"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2021-09-29-secure-bootstrap.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"012c7be8be9587b0b49de1058ffaf15496e3cc8c8e85cec4240584a92bd26207"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2021-12-08-instance-scope.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"2769f0945e2f9727788130e7bc151db2d8d99df577b0d41774381444477adb38"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2021-12-09-TiDB-log-based-incremental-backup.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"06965ad901868dd525c83012c0d1ce1a7f0d08d9f078e60742187aae5c82dd09"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2022-01-04-integer-shard-index.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"bfd5d252086ca8ffb3cdc8e66e8fb3ffb59fc78175a51c1bddb866ba4f97c201"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2022-03-03-rc-read-tso-optimization.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"fbf71c2fbec1d6518a11de260703fec861819b36d83cdbbd9eff5b792cf071e8"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2022-03-09-optimize-gc-for-internal-transaction.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"bef5cda04c7f46c76828478d53c00c7844a8b6524f1e8b919b90b9cc14c275c2"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2022-03-10-backup-with-batch-create-table.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"54d1dfef0f9067ee3246d3cc15f2bab02d388a30232c372d6b82d0f78820b440"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2022-03-24-get-lock.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"36e2971d25ff08f6139bf080affee55e0571f8ab0de9cfa236999b3923540ccf"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2022-03-25-non-transactional-dml.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"0d24e9a349056479489be49c674e0cc39906c0cf309bb4bf772936f9521f385d"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2022-04-15-multi-schema-change.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"653c72a556fdd0d5df825140b44bdf49061879acfaa5c291917040940d7ca0bb"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2022-06-07-adding-index-acceleration.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"e14d82aaf26ce3485161b57eed53236448d60a304df8d65d2c904fc1b2bf6424"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2022-07-20-session-manager.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"88e41cfab89114b8e7af8dca3641d9cbe68b4eee70d2c25e64d6c4c65457b7d4"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2022-07-22-transaction-savepoint.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"fbc1b42d0df3046930031f90e7bc7eae45a01f3792311f13df4a2bee1f5e0faf"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2022-08-02-stats-lru-cache.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"4350cb65264cd64eb2b6454e5459f0fc8b2dafbea2340b6b82feee5afaad3b1b"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2022-09-19-distributed-ddl-reorg.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"27bd8fd2d7c429e42087606262193bc2b7a24355bb7be042968fdbaf785c7436"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2022-09-29-reorganize-partition.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"b147e368cbe6ce234dac45c6786b19fd10c1a07d44b0c6a84e42e0371db6d317"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2022-11-22-view-hint.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"ca35232b5b39eb411539192132e59ddef12023215d5803261b56b01611cf2b90"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2022-11-25-global-resource-control.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"1e3e7c40aabcce5f6ed2fff8675147133d2b00de0fbfd8a829b450cb778a76ce"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2023-03-14-multi-valued-index.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"bfec723d6768dac16b58ad5eda1732ba744279f922249242ae8a0ead4bb6b72c"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2023-04-11-dist-task.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"c2137ac58da8eb016f87cc6d2b374f8a3da4694d3a8ccbe194557c67dce1cf73"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2023-04-11-pause-user-ddl-when-upgrading.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"836972c35cd0e67d71c6e6f23cc553969133db03acc59756a2268349413a7a12"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2023-06-30-configurable-kv-timeout.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"6abdfdd1f03d0e2865d7df73860dc7363b2034b049f49fb19f410bb720986a02"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2023-09-12-grouping-sets.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"1a3136b3d46269084e747c394c81cee36118af4c373f93581287ee10d313074a"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2023-11-29-priority-queue-for-auto-analyze.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"1d56cc8a3543a057c3fb9f1611dbd6a9c500bfddf243f83088f1e4e05971adb6"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2024-01-09-pipelined-DML.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"97af0f46f42ea47adf7213c786c2210a48e80ae0f975779ee280c112f3feac71"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2024-05-10-extension-authentication-plugin.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"9f6ddb693618d8cddf8be23a832c31a8f5be3a9be707af6f8dd9b9ba7033c90a"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2024-05-23-predicate-columns.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"89aecef9341ccd9a690858f1db38d95ec783dd3b3bc6abb334f178e7f890748d"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2024-07-12-support-vector-index.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"fa6447c2daa5829ebd7a68ea790baf1f5ff081a08fe1ba9c94e8e1b7feb3f2f4"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2024-09-06-maintain-priority-queue-in-memory.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"73f9c110c58c0aca2c94279fa0c0492b74656b6fc14fe4cccbac98b9bb988583"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2025-04-15-global-memory-arbitrator.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"5936f466ddab40784fd45597da55652824c3991ff6a45a6fb4569526d98b79c3"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2025-05-26-refresh-stats-command.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"e9ce6b1235c4176487378d608d3325a3f2edcd8755aacabbb8446d9b0e6c2625"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2025-07-24-index-lookup-push-down.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"fc4d7df4573214c63df09282a59f8e12c75430861ead4155af9dececb64b4cc8"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2026-01-19-topru-design.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"419e9a3ef7783cfb8bd858088b080b7415cfe907b0b97134716a52487b2aa04d"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2026-03-16-null-reject-proof-framework.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"7c227dc8849f431d9cdb1c0706c0b3cc5310f1f32d52991435621fcdf82ad03d"}},{"ruleId":"D20","level":"note","message":{"text":"ADR lacks an enforcement field: Add an \u0060enforcement:\u0060 frontmatter field or a plain \u0060Enforcement:\u0060 header line (prose/test/analyzer/not-applicable) to make the rung explicit \u2014 the other ADRs in this repo already declare one."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2026-06-22-integrate-analyze-into-background-task-resource-control.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"270c7ad1898bdfeea5afe5e12fb460d5dd98e2da22ee8ca76d73566e0f73cd59"}},{"ruleId":"D20","level":"warning","message":{"text":"Context/problem and consequences/trade-offs are both present but thin: the body describes only the architecture (queues, job types, roles, states) without explaining why a single-node owner model is chosen over locking tables or how the trade-offs of concurrency vs. consistency play out: Add a brief Context section on the problem (locking, transaction blocking, memory cost for reading ops) and a Consequences section covering trade-offs such as downtime during schema changes and the two-schema lease state"},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/design/2018-10-08-online-DDL.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"198b4b0c76ad200252af2e26b4c3cb18014cc6d90f057a4c44487b17a6111412"}},{"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":"2b11d7dab1abd1d51bd4981991f966005714dfc456f8de25979d1b62d53147ca"}},{"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":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"52c6b43e74e82d68de2d0cee15966271bb5db51be5c651168a4084de16db4d99"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"70dcaaadfa1e0403d6d38a9b31d0e0a4507632253cc19bd40e3989641717ccda"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"d5b8f11381d61a58459ffc7c595fd52d09c03c711894a63a9578043d2338412b"},"taxa":[{"id":"CWE-829","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"222675477e16cca345f06e10e6d6abc20c212dc035472e51d28cde8253da27fa"},"taxa":[{"id":"CWE-89","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"5b3bbc33ab81570ea98b3540628302cc78af0160acbbf3abc9c6e505977e7d1c"},"taxa":[{"id":"CWE-89","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"7564816da930809288958df76bcadc1223ddd064ab1fccf0fc258789ca0ac78c"},"taxa":[{"id":"CWE-89","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"73789e75458f32d4ed2e1a756f9d8700aebee8aaa9b24ee29be80c12417aa9c1"},"taxa":[{"id":"CWE-89","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"7319c22e1b203ad21889cd0079d4dd3a94caa0de043f30418016a2d868d4cb4b"},"taxa":[{"id":"CWE-89","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"4f83df8ac9339d946d890110de64ea5d5b7e41e7ece8869849e780cbea72ed26"},"taxa":[{"id":"CWE-89","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"6f41c7df755b4d30390d2f04a1f669cdd25b79c5fe2c83291c2dbb511d5f4b2a"},"taxa":[{"id":"CWE-89","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"3d92fc46e46ae0bfe170c36c1566b37109599747a6519647d500b50de5afd08b"},"taxa":[{"id":"CWE-89","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"833df4733d3a0a8c2c2f0ebc9543941b8b3185744c4298b7c3c7e4d9e521cc3f"},"taxa":[{"id":"CWE-89","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"737063fd24e1c2647a3a32ea4620f9f10dd1aae876566dc0d4bdc2fb9a6dd7f4"},"taxa":[{"id":"CWE-89","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"af99c05968a211e77d06f57f3aeabf2cf234a8d9c69520f0ef7c78cd236442eb"},"taxa":[{"id":"CWE-89","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"e368cb38ee354e4d9976e562b8551157a177759909efe7a0d5b1c1d3b1df30f4"},"taxa":[{"id":"CWE-89","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"9df62dd25ffe40d4bc5dd4880b7c1faa7bdd77370d12867d870ef2f6e687c434"},"taxa":[{"id":"CWE-89","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"a7bbb4c6fb20c458b73e51891b4bca73800803f378cfea47ff6f1872e198ff5c"},"taxa":[{"id":"CWE-89","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"5004946273bd358bf1c4e017b198fb46d585894da1d1df88dd6ca07b8b495f46"},"taxa":[{"id":"CWE-89","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"e618688722cc0a2d9592b350f331e6c63e27f66f4245159ed800e49f51da740c"},"taxa":[{"id":"CWE-89","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"01e313ad36192dc431674c23cd704e79472289d5591979c71bbfc3dfe7057b95"},"taxa":[{"id":"CWE-89","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"356e0b7929bafa1dcd8350c6c98c3152513d59d4e7e6283d7e815dfe57e09848"},"taxa":[{"id":"CWE-89","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"43d57d2e7ce2a4140b4c22df23000ffb4b5374fed05ad09f5de653c36143bde6"},"taxa":[{"id":"CWE-89","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"75798b9dcf029065586876d37728b54470d768c19288ed34de4d8401ace195e1"},"taxa":[{"id":"CWE-89","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"e7f861c290e724d177c9a5131a9e5fc2804d60c6e260b8487363dcbd20a3f1c4"},"taxa":[{"id":"CWE-89","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"1bf65aa99d38cfcb92d7de18c41109640e7a308142eff9420e7a6fa8d1b8f8e1"},"taxa":[{"id":"CWE-89","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"38219c28d3cc385e600e96d3c09b796c76f9b4b07a032bf3b220aa125a9c73e7"},"taxa":[{"id":"CWE-89","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"e181d1d475f57e9ecc04ccf94174d0adfb93d8c05a598d0cb4d4329213e08236"},"taxa":[{"id":"CWE-89","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"3debe9b60305413c9572120942131f13547127088ac2fbb43d6bb155f45dd8e2"},"taxa":[{"id":"CWE-89","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"6a03c549aab02daa10988a656ea74ba07c1d4b07347142e1b2a7b6253294ee80"},"taxa":[{"id":"CWE-89","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"13544501cfbdcf4942a7a03d5a13938d8cf3f8705101c30252d4bf2153fe92b9"},"taxa":[{"id":"CWE-89","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"ae81649aa75e9325ed0d2e30d4e699bca51cf257231619c60db784a710235be1"},"taxa":[{"id":"CWE-89","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"10aca7507be2c57b7a82dc34f067cfe62473b2dc1e0518e026ad891ce19839a9"},"taxa":[{"id":"CWE-89","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"e54d2c19cb9af9c25bef62d1db638c331feedaf2023d69aedf6ec0d125b9bfc9"},"taxa":[{"id":"CWE-89","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"ddd5edd16a7ece8cf940970f5c23fc5cef0815e820b28afaae0143ce6612fa66"},"taxa":[{"id":"CWE-89","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"0b6bbe8fb901c9b8546c9b109f69336bab4bb95327c09919f76d487cbf7ac694"},"taxa":[{"id":"CWE-89","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"525b57e27f729d3cd0cc143fe5433b49bb0b1550fce57260e045f030c67aefd3"},"taxa":[{"id":"CWE-89","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"aa2ac8cf7e1f691ab82ea19d2731c638f56805c77b1ae9ef7d395c2c04e8c7c1"},"taxa":[{"id":"CWE-89","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"d4b31df21f19b1e66ae7bfd617fe327c6bdc8c1bb073cc6bd53e3b1e675dbe11"},"taxa":[{"id":"CWE-89","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"220a14599d6bf284c94fe07f80485505ae5c4d1478df6677132e003262a0a32d"},"taxa":[{"id":"CWE-89","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"6dbae27828823a592af0b67bb189d88b9b7c016ae56481bd2c990e94c264e4fa"},"taxa":[{"id":"CWE-89","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"dc9715c03618ae6c5f93534b9e0d883b9b0073c230c68877a68a7d814628984f"},"taxa":[{"id":"CWE-89","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"4a350170635e5084fdce07bc0b6e8be948618e8aa51a4586f357c8110c9c798e"},"taxa":[{"id":"CWE-89","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"d7daf7675bc787c47aeaabf75be8dbf83c8af6b851a46f7dbc2bbb78f9630cfb"},"taxa":[{"id":"CWE-89","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"0d50203a0c38b49f7ea1b23f63f137b1cd97313807bb5236ce54ff72ee515bd7"},"taxa":[{"id":"CWE-89","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"3c53569705e67a25a9c4836d1c314204c237323d51dc7b05e53cb853c34cda71"},"taxa":[{"id":"CWE-89","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"d6a9df457c696dc93b46d1ba3351df181da7c658e44bd2dc834284467e0e5fb1"},"taxa":[{"id":"CWE-89","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"4d7367424a26e571a8b5751f88b3c782f8abb21c5435c060a4c731e3eb7236db"},"taxa":[{"id":"CWE-89","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"1ed679549052698a24266244fc62ff659f69737ab0cddbf69aca094915424ca9"},"taxa":[{"id":"CWE-89","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"924573161ac6b50344e78c2aa6321ca8344cc8dc3f15b57d469474e9436dda9e"},"taxa":[{"id":"CWE-89","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"4e4151e3092970c864a2085b53477315b464c18fb8a2207c42a15fa63c19f922"},"taxa":[{"id":"CWE-89","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D31","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"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":"3c57e9736fe86b6adff94bcbbf4036ae9a3f1a2ee3bf9ca1b60a5d1cc11298c1"}},{"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":"e32166b8e2ca6df89b5bda472a1a098770df4a3277ce1fd100c3b8d5ceef9a49"}},{"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":"a37f31eb4ce244afc80245baf3e9d8deacb89b5f8ede0b4cd59f4eee3175947d"}},{"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":"5ae19c4fecfc9fa51051701d6dd5d9eaf197d0a762c1347594ef3bcfbd236e83"}},{"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":"87dbd77eddf16b7957f8e543678a90f1e3f749be1e9b9150de70a3031e13e30b"}},{"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":"850fe4206c1e53af8f458180e4c99e21bc592daf81ebec3a9c91eeca2eb90b53"}},{"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":"675132701dd56f61600344f4818cea2795cf31b3dbf624a8f241059924e6c419"}},{"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":"715d452b86776346758e00ea209b41b2d635bfe9be845b63aed50411afba6fa6"}},{"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":"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":"f0dc2d68fce76808f5d7d9c6ebe638ef3a68e04600afc7329f20607f6437d10e"}},{"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":"46fa93f98ce08b7115ba4902495627b6bb600b6796cdd1c0feb69fe77b5bd306"}},{"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":"d56d3ad79e4ce4cb290eddaf440fd16f1670a3d7a5f9726fb4ea62b2f6645d62"}},{"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":"c8779bde7c8b47982d60246cda8e03f5f7abb80afb499cc3e09af374311eb7f8"}},{"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":"7caa07b1f9428658f24bc0ff74f901ef0d8275b2daa59056ceeb67b182da7493"}},{"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":"4f8fbc77c5c298d3b5e85673b51cf1902824dec8f7b379b39385803d234b5a57"}},{"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":"25de018721538ee3ba9f2d84e83126069e3ee12315d06e352714bb7a5804c0d8"}},{"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/parser/mysql/errname.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"99be7907e62bda049ddff3eb08d88aeabbfff402f1a128ca12b7a284cfe71c12"}},{"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/parser/mysql/errcode.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"86135987f2661f69b65499ab249c4b94f033b3c64da5d60a5884246071f90bff"}},{"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/parser/charset/encoding_gb18030_data.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"7fbb7351cf531e318eda24abe2f7225cf676a9d449eaa91e434a7bc35175b92d"}},{"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/util/extsort/disk_sorter.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"2b2efc0b0613f51269f752bc39b45cc3d921e08ed03e8d3cdfbfcc175ac3f2d4"}},{"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":"br/pkg/task/operator/test_storage.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"71a23e9e33296e652e12669360be6a421fb265a810e9299684784688302f214e"}},{"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/infoschema/perfschema/const.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"b5303b9d12b48914065784ebeda3d59a91c64dff0faf7188a6361d92cf18ead7"}},{"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/executor/internal/calibrateresource/calibrate_resource.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"93bca437083ff74c67f4f5d78988361e5cd3ec910a8b1dfe65d5750777c0900b"}},{"ruleId":"D34","level":"note","message":{"text":"Further orphaned files (smaller): 76 smaller file(s) also have no living knowledge \u2014 folded into the freshness score and metrics rather than listed individually (83 orphaned of 1742 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":"warning","message":{"text":"Change coupling: logical_initialize.go \u2194 property_cols_prune.go: \u0060pkg/planner/core/logical_initialize.go\u0060 and \u0060pkg/planner/core/property_cols_prune.go\u0060 change together 85% of the time (11 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package \u2014 so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/logical_initialize.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"46e4487ae5ebfb11a66d201af5c1cef381f9e20554b0581e73cbadf1534e6ebe"}},{"ruleId":"D35","level":"warning","message":{"text":"Change coupling: errcode.go \u2194 errcode.go: \u0060pkg/errno/errcode.go\u0060 and \u0060pkg/parser/mysql/errcode.go\u0060 change together 80% of the time (8 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well) with no explicit dependency \u2014 the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE \u2014 the registration is the link, and it is meant not to be an import \u2014 and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/errno/errcode.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"10405e91e26a5d76c8911cbb242611e04a8ea0f29b4eeb090fd968919b499724"}},{"ruleId":"D35","level":"warning","message":{"text":"Change coupling: logical_initialize.go \u2194 stats.go: \u0060pkg/planner/core/logical_initialize.go\u0060 and \u0060pkg/planner/core/stats.go\u0060 change together 77% of the time (20 of the 26 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package \u2014 so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/logical_initialize.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"4b219bdcf3a2feca3d901ac1d63345ac63b5e9d7faa7673837f499a46659a7fb"}},{"ruleId":"D35","level":"warning","message":{"text":"Change coupling: property_cols_prune.go \u2194 stats.go: \u0060pkg/planner/core/property_cols_prune.go\u0060 and \u0060pkg/planner/core/stats.go\u0060 change together 77% of the time (10 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package \u2014 so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/property_cols_prune.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"6e60c445070d567a9a45db7f383ed534b73fd7c2c968071b59463e71f5f8866a"}},{"ruleId":"D35","level":"warning","message":{"text":"Change coupling: exhaust_physical_plans.go \u2194 rule_topn_push_down.go: \u0060pkg/planner/core/exhaust_physical_plans.go\u0060 and \u0060pkg/planner/core/rule_topn_push_down.go\u0060 change together 76% of the time (13 of the 17 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package \u2014 so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/exhaust_physical_plans.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"195750e6719868b921689eb705ae8dab23bc2f626b4abb2b8c0eff35dd44cbf0"}},{"ruleId":"D35","level":"warning","message":{"text":"Change coupling: rule_inject_extra_projection.go \u2194 task.go: \u0060pkg/planner/core/rule_inject_extra_projection.go\u0060 and \u0060pkg/planner/core/task.go\u0060 change together 75% of the time (9 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package \u2014 so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/rule_inject_extra_projection.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"b3ff8522b0980ed0509440538d526de20ae3caaf4b09b767a824c2a67042666e"}},{"ruleId":"D35","level":"warning","message":{"text":"Change coupling: pattern.go \u2194 core_init.go: \u0060pkg/planner/cascades/pattern/pattern.go\u0060 and \u0060pkg/planner/core/core_init.go\u0060 change together 75% of the time (9 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well) with no explicit dependency \u2014 the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE \u2014 the registration is the link, and it is meant not to be an import \u2014 and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/cascades/pattern/pattern.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"f2a1fe0632559da72c6d581a63cda267e7020b7de61ac715c5b551f732ada1f2"}},{"ruleId":"D35","level":"warning","message":{"text":"Change coupling: pattern.go \u2194 func_pointer_misc.go: \u0060pkg/planner/cascades/pattern/pattern.go\u0060 and \u0060pkg/planner/util/utilfuncp/func_pointer_misc.go\u0060 change together 75% of the time (9 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well) with no explicit dependency \u2014 the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE \u2014 the registration is the link, and it is meant not to be an import \u2014 and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/cascades/pattern/pattern.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"e4cc45555be6926d7a61579ff5f8bc5d09383cf2f497c12f60ba8291159717d9"}},{"ruleId":"D35","level":"warning","message":{"text":"Change coupling: stringer.go \u2194 func_pointer_misc.go: \u0060pkg/planner/core/stringer.go\u0060 and \u0060pkg/planner/util/utilfuncp/func_pointer_misc.go\u0060 change together 74% of the time (23 of the 31 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well) with no explicit dependency \u2014 the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE \u2014 the registration is the link, and it is meant not to be an import \u2014 and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/stringer.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"6cfcd9cfc78e709cf7bd3bef3404dc08122eb3ff2ada5aa869431f607a35f91a"}},{"ruleId":"D35","level":"warning","message":{"text":"Change coupling: core_init.go \u2194 stringer.go: \u0060pkg/planner/core/core_init.go\u0060 and \u0060pkg/planner/core/stringer.go\u0060 change together 74% of the time (23 of the 31 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package \u2014 so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"pkg/planner/core/core_init.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"1972fb6bfcfae235197de50eea725f170be43293d9262d08306389c92fe495fe"}},{"ruleId":"D38","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"8eef6ff2e93423004c8e226d1ea52bdeb86ab763512312464e5c35a636bae536"}},{"ruleId":"D38","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"24fcae53239a1ac72bc974dcc3442f0bef6a331b9ed40849b5e99c9cb4cbc05a"}},{"ruleId":"D38","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"0e15b74722e351a790e6480ccf8674d9d22eda000d31ccb57e98d50f5ebe0f9e"}},{"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":"09eaa729d7499407c9f5c1d1a0ea6d934e4cd9cf1530c587a31db484dc18041d"}},{"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":"aeec9931ef08337c6205bf10ebe110ddf1ae33983515f7088e01d537c7a36e40"}},{"ruleId":"D38","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"c8e6740321a9758be2667eea6842293616ba35402441f8df0a0ca2a8f6a5fa68"}},{"ruleId":"D38","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"50c379534161bb30611d421e82af3666b891a67b9a6a35df5a4fc4b4977e653b"}},{"ruleId":"D38","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"94e02eea5764fec7c68881dfaf08794994cb5f5915475658189d0ffad65d6e22"}},{"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":"3acac62094c8c06f657078f2be3be35e27e5bcd6cf151b50110de54bed0d0aa8"}},{"ruleId":"D38","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"231ad4dc838e4a2768e6f7a1e67ca410b16632a9e046ea516d551978147d4308"}}],"taxonomies":[{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d","organization":"MITRE","informationUri":"https://cwe.mitre.org/","isComprehensive":false,"shortDescription":{"text":"The MITRE Common Weakness Enumeration (CWE)."},"taxa":[{"id":"CWE-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-353","guid":"09d7e902-d4ee-f05d-ae6c-0a1554d0c18f","name":"CWE-353","shortDescription":{"text":"CWE-353"},"helpUri":"https://cwe.mitre.org/data/definitions/353.html"},{"id":"CWE-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-829","guid":"13c33925-97fb-5a5e-b40c-56d328b8a4d7","name":"CWE-829","shortDescription":{"text":"CWE-829"},"helpUri":"https://cwe.mitre.org/data/definitions/829.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":80,"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."]}]}