{"$schema":"https://json.schemastore.org/sarif-2.1.0.json","version":"2.1.0","runs":[{"tool":{"driver":{"name":"codehealth","informationUri":"https://codehealth.canine.dev","rules":[{"id":"D1","name":"Cyclomatic Complexity","shortDescription":{"text":"Cyclomatic Complexity"},"helpUri":"https://codehealth.canine.dev/dimensions/D1"},{"id":"D2","name":"Cognitive Complexity","shortDescription":{"text":"Cognitive Complexity"},"helpUri":"https://codehealth.canine.dev/dimensions/D2"},{"id":"D3","name":"God Classes","shortDescription":{"text":"God Classes"},"helpUri":"https://codehealth.canine.dev/dimensions/D3"},{"id":"D4","name":"Code Duplication","shortDescription":{"text":"Code Duplication"},"helpUri":"https://codehealth.canine.dev/dimensions/D4"},{"id":"D13","name":"Secret Scanning","shortDescription":{"text":"Secret Scanning"},"helpUri":"https://codehealth.canine.dev/dimensions/D13","relationships":[{"target":{"id":"CWE-798","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-259","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-798","CWE-259"]}},{"id":"D15","name":"Churn \u00D7 Complexity Hotspots","shortDescription":{"text":"Churn \u00D7 Complexity Hotspots"},"helpUri":"https://codehealth.canine.dev/dimensions/D15"},{"id":"D16","name":"Bus Factor","shortDescription":{"text":"Bus Factor"},"helpUri":"https://codehealth.canine.dev/dimensions/D16"},{"id":"D19","name":"Documentation Quality","shortDescription":{"text":"Documentation Quality"},"helpUri":"https://codehealth.canine.dev/dimensions/D19"},{"id":"D21","name":"Naming Consistency","shortDescription":{"text":"Naming Consistency"},"helpUri":"https://codehealth.canine.dev/dimensions/D21"},{"id":"D28","name":"Secrets (history)","shortDescription":{"text":"Secrets (history)"},"helpUri":"https://codehealth.canine.dev/dimensions/D28","relationships":[{"target":{"id":"CWE-798","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-259","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-798","CWE-259"]}},{"id":"D29","name":"Static Analysis (SAST)","shortDescription":{"text":"Static Analysis (SAST)"},"helpUri":"https://codehealth.canine.dev/dimensions/D29","relationships":[{"target":{"id":"CWE-79","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-89","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-78","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-94","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-77","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-79","CWE-89","CWE-78","CWE-94","CWE-77"]}},{"id":"D31","name":"IaC \u0026 Container Security","shortDescription":{"text":"IaC \u0026 Container Security"},"helpUri":"https://codehealth.canine.dev/dimensions/D31","relationships":[{"target":{"id":"CWE-1032","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-732","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-16","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-1032","CWE-732","CWE-16"]}},{"id":"D33","name":"JS/npm Dependency Vulnerabilities","shortDescription":{"text":"JS/npm Dependency Vulnerabilities"},"helpUri":"https://codehealth.canine.dev/dimensions/D33","relationships":[{"target":{"id":"CWE-1395","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-937","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-1395","CWE-937"]}},{"id":"D34","name":"Knowledge Freshness","shortDescription":{"text":"Knowledge Freshness"},"helpUri":"https://codehealth.canine.dev/dimensions/D34"},{"id":"D35","name":"Change Coupling","shortDescription":{"text":"Change Coupling"},"helpUri":"https://codehealth.canine.dev/dimensions/D35"},{"id":"D36","name":"Supply-chain Provenance \u0026 Signing","shortDescription":{"text":"Supply-chain Provenance \u0026 Signing"},"helpUri":"https://codehealth.canine.dev/dimensions/D36","relationships":[{"target":{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-494","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-1357","CWE-494"]}},{"id":"D38","name":"OSV Dependency Vulnerabilities","shortDescription":{"text":"OSV Dependency Vulnerabilities"},"helpUri":"https://codehealth.canine.dev/dimensions/D38","relationships":[{"target":{"id":"CWE-1395","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-937","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-1395","CWE-937"]}}]}},"results":[{"ruleId":"D1","level":"warning","message":{"text":"d2oracle._set (cyclomatic 182): d2oracle._set has cyclomatic complexity 182 (threshold 15). Of this number, 176 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":"d2oracle/edit.go"},"region":{"startLine":327}}}],"partialFingerprints":{"codehealthFindingId/v1":"d1d797d265f05ea55fd36f9d830ab0f4d36ec2d0820098360bbaf986d3f91811"}},{"ruleId":"D1","level":"warning","message":{"text":"d2oracle.move (cyclomatic 121): d2oracle.move has cyclomatic complexity 121 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2oracle/edit.go"},"region":{"startLine":1767}}}],"partialFingerprints":{"codehealthFindingId/v1":"65464b03aaa628eb8c84d92be11f357d9e7dfd0dbefb5cb1c799749e29553db2"}},{"ruleId":"D1","level":"warning","message":{"text":"d2svg.drawShape (cyclomatic 107): d2svg.drawShape has cyclomatic complexity 107 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svg/d2svg.go"},"region":{"startLine":1602}}}],"partialFingerprints":{"codehealthFindingId/v1":"3aee35e5a82b3608282fa9206470a0571a11262248e9546bc5a2f4058105beb4"}},{"ruleId":"D1","level":"warning","message":{"text":"d2dagrelayout.fitPadding (cyclomatic 103): d2dagrelayout.fitPadding has cyclomatic complexity 103 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2dagrelayout/layout.go"},"region":{"startLine":1339}}}],"partialFingerprints":{"codehealthFindingId/v1":"043f28a9bca218766fe0d8dfd84b347b8540696ae86f44e7b5003b397f880e27"}},{"ruleId":"D1","level":"warning","message":{"text":"d2dagrelayout.shiftReachableDown (cyclomatic 102): d2dagrelayout.shiftReachableDown has cyclomatic complexity 102 (threshold 15). Of this number, 26 points are the body\u0027s own statements and 76 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":"d2layouts/d2dagrelayout/layout.go"},"region":{"startLine":765}}}],"partialFingerprints":{"codehealthFindingId/v1":"ac64831d6bb4050bad355eadbf5236a07cf96dea2d475ac0008e5df1769b5a13"}},{"ruleId":"D1","level":"warning","message":{"text":"d2elklayout.Layout (cyclomatic 101): d2elklayout.Layout has cyclomatic complexity 101 (threshold 15). Of this number, 75 points are the body\u0027s own statements and 26 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":"d2layouts/d2elklayout/layout.go"},"region":{"startLine":154}}}],"partialFingerprints":{"codehealthFindingId/v1":"1448fa6e25ec06e61ed503072e0c213dc543e4c35ca3b1b4b33b40ccb432a19c"}},{"ruleId":"D1","level":"warning","message":{"text":"Ruler.measureNode (cyclomatic 92): Ruler.measureNode has cyclomatic complexity 92 (threshold 15). Of this number, 89 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":"lib/textmeasure/markdown.go"},"region":{"startLine":217}}}],"partialFingerprints":{"codehealthFindingId/v1":"dc62bd4d2ba82b6d643b216de33a7439c6f29e6ff3cb8fb680784a0ace1f6e47"}},{"ruleId":"D1","level":"warning","message":{"text":"d2cli.Run (cyclomatic 89): d2cli.Run has cyclomatic complexity 89 (threshold 15). 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: 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":"d2cli/main.go"},"region":{"startLine":52}}}],"partialFingerprints":{"codehealthFindingId/v1":"0de7628a132e0db0cfd4e141c9f3b5f1570baee9450959a601f51f65ebbf4881"}},{"ruleId":"D1","level":"warning","message":{"text":"d2svg.Render (cyclomatic 78): d2svg.Render has cyclomatic complexity 78 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svg/d2svg.go"},"region":{"startLine":2733}}}],"partialFingerprints":{"codehealthFindingId/v1":"ae84efcb81f0b19768934f6ecfc7364c0f73ea41027fb44eff659a51b9637a1a"}},{"ruleId":"D1","level":"warning","message":{"text":"compiler.compileReserved (cyclomatic 72): compiler.compileReserved has cyclomatic complexity 72 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2compiler/compile.go"},"region":{"startLine":537}}}],"partialFingerprints":{"codehealthFindingId/v1":"06d57f8d722eca3064d208c33af249de5f18e2c97749ad6f37bd797d4a6421af"}},{"ruleId":"D1","level":"warning","message":{"text":"Style.Apply (cyclomatic 70): Style.Apply has cyclomatic complexity 70 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2graph/d2graph.go"},"region":{"startLine":315}}}],"partialFingerprints":{"codehealthFindingId/v1":"a2a1d6a9eadadf99925ee56c118327fef060d1cbba44b3caa8c020dc4c9c87b3"}},{"ruleId":"D1","level":"warning","message":{"text":"Graph.SetDimensions (cyclomatic 64): Graph.SetDimensions 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":"d2graph/d2graph.go"},"region":{"startLine":1502}}}],"partialFingerprints":{"codehealthFindingId/v1":"d3b71de398dd1b90e3f728d6045b3881cf9f8ca817de6a71f2cb0721866d19de"}},{"ruleId":"D1","level":"warning","message":{"text":"Map.ensureField (cyclomatic 64): Map.ensureField has cyclomatic complexity 64 (threshold 15). Of this number, 48 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":"d2ir/d2ir.go"},"region":{"startLine":858}}}],"partialFingerprints":{"codehealthFindingId/v1":"4cd0a8a13831039151f8b367865a74aa5ca8a14b1763ce9264bd4fb2c9ab2893"}},{"ruleId":"D1","level":"warning","message":{"text":"d2dagrelayout.Layout (cyclomatic 64): d2dagrelayout.Layout 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":"d2layouts/d2dagrelayout/layout.go"},"region":{"startLine":72}}}],"partialFingerprints":{"codehealthFindingId/v1":"cddc37683773e083b0ae572711f72192fdcc9514b543bbe28b50450860d08c88"}},{"ruleId":"D1","level":"warning","message":{"text":"d2svg.drawConnection (cyclomatic 58): d2svg.drawConnection 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":"d2renderers/d2svg/d2svg.go"},"region":{"startLine":1006}}}],"partialFingerprints":{"codehealthFindingId/v1":"19b07483faef2c04a8712f476598af4e6ef4a435474b549c1f0e5c4ab12ae119"}},{"ruleId":"D1","level":"warning","message":{"text":"compiler.ampersandFilter (cyclomatic 57): compiler.ampersandFilter 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":"d2ir/compile.go"},"region":{"startLine":718}}}],"partialFingerprints":{"codehealthFindingId/v1":"a091b29a55e99556ef8ac6e263f89e4f5e9a0ee40c8e5f1821282bf3d88f2e46"}},{"ruleId":"D1","level":"warning","message":{"text":"compiler._compileEdges (cyclomatic 52): compiler._compileEdges 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":"d2ir/compile.go"},"region":{"startLine":1392}}}],"partialFingerprints":{"codehealthFindingId/v1":"40bca2df54ba9fdb3374e2b229602ce44e8866888aeec4df86b0fe9be5bf40c5"}},{"ruleId":"D1","level":"warning","message":{"text":"d2dagrelayout.adjustRankSpacing (cyclomatic 52): d2dagrelayout.adjustRankSpacing 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":"d2layouts/d2dagrelayout/layout.go"},"region":{"startLine":1078}}}],"partialFingerprints":{"codehealthFindingId/v1":"263313be6d9ad0889e4bbf519c9e9b7db9941891de7226154b43450fc5e09f0e"}},{"ruleId":"D1","level":"warning","message":{"text":"compiler._compileField (cyclomatic 49): compiler._compileField 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":"d2ir/compile.go"},"region":{"startLine":1058}}}],"partialFingerprints":{"codehealthFindingId/v1":"d01c40cb0b778adfa35ef3075172410b7d723e2e5f51399de0e26c74c539c9e1"}},{"ruleId":"D1","level":"warning","message":{"text":"d2graph.CompareSerializedObject (cyclomatic 47): d2graph.CompareSerializedObject has cyclomatic complexity 47 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2graph/serde.go"},"region":{"startLine":211}}}],"partialFingerprints":{"codehealthFindingId/v1":"594eabdf68c22ec4452cf317ecb1c35506dc84780aa5bd2e2ee21d60a30e911b"}},{"ruleId":"D1","level":"warning","message":{"text":"compiler.resolveSubstitutions (cyclomatic 46): compiler.resolveSubstitutions 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":"d2ir/compile.go"},"region":{"startLine":228}}}],"partialFingerprints":{"codehealthFindingId/v1":"53cf825f21fbcfb76a2b0de478fccb7e86d5c80d4c3a2d916427281f8e03e77e"}},{"ruleId":"D1","level":"warning","message":{"text":"d2layouts.LayoutNested (cyclomatic 46): d2layouts.LayoutNested has cyclomatic complexity 46 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2layouts.go"},"region":{"startLine":78}}}],"partialFingerprints":{"codehealthFindingId/v1":"a2732248a443d587116681a977dbe7cb4b8c340ec4773121b3b723b4f2896d03"}},{"ruleId":"D1","level":"warning","message":{"text":"Edge.TraceToShape (cyclomatic 45): Edge.TraceToShape 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":"d2graph/layout.go"},"region":{"startLine":414}}}],"partialFingerprints":{"codehealthFindingId/v1":"d19a2f8c48219178010c1ee19f0ef208a1de995ed506bb94b14e2293d2c98449"}},{"ruleId":"D1","level":"warning","message":{"text":"d2oracle.ReconnectEdge (cyclomatic 44): d2oracle.ReconnectEdge 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":"d2oracle/edit.go"},"region":{"startLine":124}}}],"partialFingerprints":{"codehealthFindingId/v1":"3f2d79772cf8a343ffaf94273952d817a5d30b2324c244c38634501c9bf3a7c4"}},{"ruleId":"D1","level":"warning","message":{"text":"d2oracle.DeleteIDDeltas (cyclomatic 42): d2oracle.DeleteIDDeltas has cyclomatic complexity 42 (threshold 15). Of this number, 34 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":"d2oracle/edit.go"},"region":{"startLine":2970}}}],"partialFingerprints":{"codehealthFindingId/v1":"1c6172d035d3406685fb9265ed3476f3530bb72efcd40f6bd583158c92fad424"}},{"ruleId":"D1","level":"warning","message":{"text":"ASCIIartist.Render (cyclomatic 42): ASCIIartist.Render has cyclomatic complexity 42 (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":"d2renderers/d2ascii/d2ascii.go"},"region":{"startLine":222}}}],"partialFingerprints":{"codehealthFindingId/v1":"ee30699888f54f8df17f328ee603925285abe34e776049a6b1d2a5951cc36a8d"}},{"ruleId":"D1","level":"warning","message":{"text":"ThemableElement.Render (cyclomatic 42): ThemableElement.Render 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":"d2themes/element.go"},"region":{"startLine":111}}}],"partialFingerprints":{"codehealthFindingId/v1":"2c48fbd2da713382c84115da44ebd1376d1b41398527c9144a6e2420461f48c9"}},{"ruleId":"D1","level":"warning","message":{"text":"Key.Equals (cyclomatic 41): Key.Equals 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":"d2ast/d2ast.go"},"region":{"startLine":895}}}],"partialFingerprints":{"codehealthFindingId/v1":"51c87a69bb103cf8fd5de754190a5551eb2df1f4ef6b14107f5f4c8b919fdd49"}},{"ruleId":"D1","level":"warning","message":{"text":"d2cli.compile (cyclomatic 41): d2cli.compile 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":"d2cli/main.go"},"region":{"startLine":490}}}],"partialFingerprints":{"codehealthFindingId/v1":"bf18b95f9c4ce0088cb36083819d5068a926f86bb688226140de2b66adcb31e0"}},{"ruleId":"D1","level":"warning","message":{"text":"d2exporter.toConnection (cyclomatic 41): d2exporter.toConnection has cyclomatic complexity 41 (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":"d2exporter/export.go"},"region":{"startLine":338}}}],"partialFingerprints":{"codehealthFindingId/v1":"2acb7404c234272dcf09efe4b1452486b2a0bc3cafbe0747c649608a7cc07da7"}},{"ruleId":"D1","level":"warning","message":{"text":"d2grid.Layout (cyclomatic 41): d2grid.Layout 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":"d2layouts/d2grid/layout.go"},"region":{"startLine":25}}}],"partialFingerprints":{"codehealthFindingId/v1":"710b322479dd4506a8ac7afa717c347bda489dc891eaf807d507c07f5c8ca5ef"}},{"ruleId":"D1","level":"warning","message":{"text":"d2oracle.Delete (cyclomatic 40): d2oracle.Delete 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":"d2oracle/edit.go"},"region":{"startLine":938}}}],"partialFingerprints":{"codehealthFindingId/v1":"87c4ff0563c35d098cd1273e4d199aeb0da7e92598b5c9fde640a07a8734c266"}},{"ruleId":"D1","level":"warning","message":{"text":"d2oracle.MoveIDDeltas (cyclomatic 40): d2oracle.MoveIDDeltas has cyclomatic complexity 40 (threshold 15). Of this number, 28 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":"d2oracle/edit.go"},"region":{"startLine":2776}}}],"partialFingerprints":{"codehealthFindingId/v1":"7c2f953e8f5414e7daa6572f605ab01dc56118e3f38943c2424217d2b3e4c5e2"}},{"ruleId":"D1","level":"warning","message":{"text":"Object.GetFill (cyclomatic 38): Object.GetFill 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":"d2graph/d2graph.go"},"region":{"startLine":512}}}],"partialFingerprints":{"codehealthFindingId/v1":"d55a5d72a945264cd125983e1a7f8e719b3f447f953c0416a99d24cb28ab7fa3"}},{"ruleId":"D1","level":"warning","message":{"text":"d2lsp.getKeywordContext (cyclomatic 38): d2lsp.getKeywordContext 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":"d2lsp/completion.go"},"region":{"startLine":103}}}],"partialFingerprints":{"codehealthFindingId/v1":"c730347af6a4adfb8952867df7a073050105081da4f3acf1fb4b8ff597fcb3fc"}},{"ruleId":"D1","level":"warning","message":{"text":"d2exporter.applyTheme (cyclomatic 37): d2exporter.applyTheme 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":"d2exporter/export.go"},"region":{"startLine":80}}}],"partialFingerprints":{"codehealthFindingId/v1":"715cc17f4899391179d8ec9511cb9c23dbe29e49011d266ece81f291f80e85f9"}},{"ruleId":"D1","level":"warning","message":{"text":"d2elklayout.deleteBends (cyclomatic 37): d2elklayout.deleteBends 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":"d2layouts/d2elklayout/layout.go"},"region":{"startLine":661}}}],"partialFingerprints":{"codehealthFindingId/v1":"463222d1417af988e05bd9f313c69e161a98a0ac253cad9c7359130d5dd0abbe"}},{"ruleId":"D1","level":"warning","message":{"text":"d2oracle.updateNear (cyclomatic 37): d2oracle.updateNear 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":"d2oracle/edit.go"},"region":{"startLine":2330}}}],"partialFingerprints":{"codehealthFindingId/v1":"961e51bc05f3823e1f0604d91fbaf9a11f9103d964d778ad24c2962def18c962"}},{"ruleId":"D1","level":"warning","message":{"text":"compiler.compileField (cyclomatic 36): compiler.compileField 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":"d2compiler/compile.go"},"region":{"startLine":346}}}],"partialFingerprints":{"codehealthFindingId/v1":"9921a92d2d4e7607e8f46588919f8735d2cdfa9ce4150fab59483c4115caed66"}},{"ruleId":"D1","level":"warning","message":{"text":"Canvas.ToByteArray (cyclomatic 36): Canvas.ToByteArray 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":"d2renderers/d2ascii/asciicanvas/asciicanvas.go"},"region":{"startLine":76}}}],"partialFingerprints":{"codehealthFindingId/v1":"9f168be31425737a94a1f689ce30367de3f51acb10c0d141925cf5506053a368"}},{"ruleId":"D1","level":"warning","message":{"text":"d2cli.loadFonts (cyclomatic 35): d2cli.loadFonts 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":"d2cli/main.go"},"region":{"startLine":1320}}}],"partialFingerprints":{"codehealthFindingId/v1":"343272c339fc4d325a0d2ea42aeb047925c151b22910d47cda654df3d7738265"}},{"ruleId":"D1","level":"warning","message":{"text":"d2oracle.deleteReserved (cyclomatic 35): d2oracle.deleteReserved 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":"d2oracle/edit.go"},"region":{"startLine":1314}}}],"partialFingerprints":{"codehealthFindingId/v1":"1a4b0a8fa73cf5bcbb53780c34d785008c12dc00c5c249c618678e9bd408ed9e"}},{"ruleId":"D1","level":"warning","message":{"text":"parser.parseUnquotedString (cyclomatic 35): parser.parseUnquotedString has cyclomatic complexity 35 (threshold 15). Of this number, 31 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":"d2parser/parse.go"},"region":{"startLine":1068}}}],"partialFingerprints":{"codehealthFindingId/v1":"079d354b927509204a55023b56a5204e9702a03047391a68d33789d312385c25"}},{"ruleId":"D1","level":"warning","message":{"text":"main.main (cyclomatic 35): main.main has cyclomatic complexity 35 (threshold 15). Of this number, 19 points are the body\u0027s own statements and 16 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":"e2etests/report/main.go"},"region":{"startLine":34}}}],"partialFingerprints":{"codehealthFindingId/v1":"40d43ca86205be5ecbb9d255ff0dff0ab8c52682feffccb31932609eef71c1bb"}},{"ruleId":"D1","level":"warning","message":{"text":"Key.D2OracleEquals (cyclomatic 34): Key.D2OracleEquals 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":"d2ast/d2ast.go"},"region":{"startLine":813}}}],"partialFingerprints":{"codehealthFindingId/v1":"5ef7e779c4069a8276d45f3686d170482f9ceabd188bbfc0b1bacb72bedf1c9f"}},{"ruleId":"D1","level":"warning","message":{"text":"d2oracle.renameConflictsToParent (cyclomatic 34): d2oracle.renameConflictsToParent 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":"d2oracle/edit.go"},"region":{"startLine":1163}}}],"partialFingerprints":{"codehealthFindingId/v1":"258c90c17fe2ddf01e4f0bf72fc537efdfd7b35d7e8dbcff677ff6db3dca7011"}},{"ruleId":"D1","level":"warning","message":{"text":"Map.createEdge (cyclomatic 33): Map.createEdge 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":"d2ir/d2ir.go"},"region":{"startLine":1272}}}],"partialFingerprints":{"codehealthFindingId/v1":"1b19959cef8f046872a29373a8f2e50598b2c43de7c37204c56af2fa0d5cf945"}},{"ruleId":"D1","level":"warning","message":{"text":"d2oracle.deleteObject (cyclomatic 33): d2oracle.deleteObject 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":"d2oracle/edit.go"},"region":{"startLine":1525}}}],"partialFingerprints":{"codehealthFindingId/v1":"3130b4c1e6c97595e921ad97fdb0522969935c23e757488de843e9439ee011e6"}},{"ruleId":"D1","level":"warning","message":{"text":"d2svg.arrowheadMarker (cyclomatic 33): d2svg.arrowheadMarker 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":"d2renderers/d2svg/d2svg.go"},"region":{"startLine":454}}}],"partialFingerprints":{"codehealthFindingId/v1":"032196fc7041dd83d806887697b820777aa1b936dd2f6e4546b619abf357fb9c"}},{"ruleId":"D1","level":"warning","message":{"text":"gridDiagram.layoutDynamic (cyclomatic 32): gridDiagram.layoutDynamic has cyclomatic complexity 32 (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":"d2layouts/d2grid/layout.go"},"region":{"startLine":324}}}],"partialFingerprints":{"codehealthFindingId/v1":"ee64304f52262dcf24cc67c00501c3e7efc89bba5b9144f6acd28a1da385b4b4"}},{"ruleId":"D1","level":"warning","message":{"text":"d2oracle.ReconnectEdgeIDDeltas (cyclomatic 32): d2oracle.ReconnectEdgeIDDeltas 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":"d2oracle/edit.go"},"region":{"startLine":2502}}}],"partialFingerprints":{"codehealthFindingId/v1":"b450aef83fca620b018245d4fd9d964a2a776000ccadac4937e6c40518d7dc80"}},{"ruleId":"D1","level":"warning","message":{"text":"compiler.validateKey (cyclomatic 31): compiler.validateKey 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":"d2compiler/compile.go"},"region":{"startLine":1098}}}],"partialFingerprints":{"codehealthFindingId/v1":"635cc53641aed4858afcd07fb9a25b397b041905778dde64f09052bb959d0b46"}},{"ruleId":"D1","level":"warning","message":{"text":"compiler.compileMap (cyclomatic 31): compiler.compileMap 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":"d2ir/compile.go"},"region":{"startLine":502}}}],"partialFingerprints":{"codehealthFindingId/v1":"bc359e4851893055ed977982a3e0d25f4cc8b155b6c138de0d4a5c98af97e984"}},{"ruleId":"D1","level":"warning","message":{"text":"Graph.Texts (cyclomatic 30): Graph.Texts 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":"d2graph/d2graph.go"},"region":{"startLine":1697}}}],"partialFingerprints":{"codehealthFindingId/v1":"c72daec7eb6808db826cfea787f687d32e6d65b64aa7c037f3986977ac36f146"}},{"ruleId":"D1","level":"warning","message":{"text":"gridDiagram.getBestLayout (cyclomatic 29): gridDiagram.getBestLayout has cyclomatic complexity 29 (threshold 15). 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: 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":"d2layouts/d2grid/layout.go"},"region":{"startLine":550}}}],"partialFingerprints":{"codehealthFindingId/v1":"fb9f2b9b7aff6165abffacbb1df74b258b020ae8d1817b05717f90669a0ac111"}},{"ruleId":"D1","level":"warning","message":{"text":"Diagram.BoundingBox (cyclomatic 29): Diagram.BoundingBox 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":"d2target/d2target.go"},"region":{"startLine":277}}}],"partialFingerprints":{"codehealthFindingId/v1":"588eca2be78c9c6ad469e49c009c8c4dc8121feb658447d00310e049defb48cd"}},{"ruleId":"D1","level":"warning","message":{"text":"printer._map (cyclomatic 28): printer._map 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":"d2format/format.go"},"region":{"startLine":287}}}],"partialFingerprints":{"codehealthFindingId/v1":"e1435dfefd773114da56afdf0272be3f8619a7f8f9e988389f45535aa00129b8"}},{"ruleId":"D1","level":"warning","message":{"text":"asciishapes.DrawPerson (cyclomatic 27): asciishapes.DrawPerson 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":"d2renderers/d2ascii/asciishapes/person.go"},"region":{"startLine":5}}}],"partialFingerprints":{"codehealthFindingId/v1":"54ebd6a88de270de9f18417938f9373b357216118c26ca6c98279d3ff40fa7be"}},{"ruleId":"D1","level":"warning","message":{"text":"asciishapes.DrawCylinder (cyclomatic 26): asciishapes.DrawCylinder 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":"d2renderers/d2ascii/asciishapes/cylinder.go"},"region":{"startLine":3}}}],"partialFingerprints":{"codehealthFindingId/v1":"9c92fe09c9f1eb60fde1379e8f10c6dd2bb8c64c409e5d58f278d3d1781d0376"}},{"ruleId":"D1","level":"warning","message":{"text":"d2compiler.compileThemeOverrides (cyclomatic 25): d2compiler.compileThemeOverrides 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":"d2compiler/compile.go"},"region":{"startLine":1591}}}],"partialFingerprints":{"codehealthFindingId/v1":"f95c2b0ac0cec0a38777f2d4a05e08279ac3c6f6deb7ce41baf2080f48222700"}},{"ruleId":"D1","level":"warning","message":{"text":"d2dagrelayout.adjustDeltaForEdges (cyclomatic 25): d2dagrelayout.adjustDeltaForEdges has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 12 of the 25 points are its own statements and the rest belongs to one function literal inside it that branches (line 1667). 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":"d2layouts/d2dagrelayout/layout.go"},"region":{"startLine":1666}}}],"partialFingerprints":{"codehealthFindingId/v1":"09f7f1712b747c7ea45a0bee0a4437a6dc787840e2212ff414e1dd77c03342a0"}},{"ruleId":"D1","level":"warning","message":{"text":"asciishapes.DrawDocument (cyclomatic 25): asciishapes.DrawDocument has cyclomatic complexity 25 (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":"d2renderers/d2ascii/asciishapes/document.go"},"region":{"startLine":5}}}],"partialFingerprints":{"codehealthFindingId/v1":"bdce5e65aa56b7219dfafc22bc4bbe097718c715a63f2b67e077c8c457405a07"}},{"ruleId":"D1","level":"warning","message":{"text":"compiler.compileMap (cyclomatic 24): compiler.compileMap 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":"d2compiler/compile.go"},"region":{"startLine":274}}}],"partialFingerprints":{"codehealthFindingId/v1":"5f861480c78d31b4f3255cf418d9dcffbc7c02df5113f2edc1f3274593063001"}},{"ruleId":"D1","level":"warning","message":{"text":"Object.GetDefaultSize (cyclomatic 24): Object.GetDefaultSize 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":"d2graph/d2graph.go"},"region":{"startLine":995}}}],"partialFingerprints":{"codehealthFindingId/v1":"291069e6f468dbd700fc07aee4c409c7df6c769b38c5059207cfc24e8864f18e"}},{"ruleId":"D1","level":"warning","message":{"text":"Object.SpacingOpt (cyclomatic 24): Object.SpacingOpt 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":"d2graph/d2graph.go"},"region":{"startLine":1885}}}],"partialFingerprints":{"codehealthFindingId/v1":"3688f5b67fa927c674cda16dd609b03afd63a44b0a32848c02e8ceaba96222b3"}},{"ruleId":"D1","level":"warning","message":{"text":"compiler.extendLinks (cyclomatic 24): compiler.extendLinks 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":"d2ir/compile.go"},"region":{"startLine":1238}}}],"partialFingerprints":{"codehealthFindingId/v1":"60a31fc6ce426e4193ccbd8540bf97246d6f01401ff1801b59f78f0fac1277f6"}},{"ruleId":"D1","level":"warning","message":{"text":"d2dagrelayout.shiftDown (cyclomatic 24): d2dagrelayout.shiftDown 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":"d2layouts/d2dagrelayout/layout.go"},"region":{"startLine":633}}}],"partialFingerprints":{"codehealthFindingId/v1":"0495c7c600d640c3227d6f413b11cab2be9b3c6fe7d49cdcca63acd6e4002d67"}},{"ruleId":"D1","level":"warning","message":{"text":"d2dagrelayout.shiftUp (cyclomatic 24): d2dagrelayout.shiftUp 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":"d2layouts/d2dagrelayout/layout.go"},"region":{"startLine":697}}}],"partialFingerprints":{"codehealthFindingId/v1":"f913a80e9ecd8f8dd4c50848e3adce85ce9bcf41a656334bc1f4f6bcd3131bb7"}},{"ruleId":"D1","level":"warning","message":{"text":"d2plugin.FeatureSupportCheck (cyclomatic 24): d2plugin.FeatureSupportCheck 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":"d2plugin/plugin_features.go"},"region":{"startLine":27}}}],"partialFingerprints":{"codehealthFindingId/v1":"8e2568fa5d8415fd8d7e238ac1da3156fe712cfce183b0d29ca1134918108fb4"}},{"ruleId":"D1","level":"warning","message":{"text":"asciishapes.DrawQueue (cyclomatic 24): asciishapes.DrawQueue has cyclomatic complexity 24 (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":"d2renderers/d2ascii/asciishapes/queue.go"},"region":{"startLine":3}}}],"partialFingerprints":{"codehealthFindingId/v1":"167d8278f4699e56eebdb64bafa2c697c6b3f45c6504815025a60610865218c6"}},{"ruleId":"D1","level":"warning","message":{"text":"d2svg.RenderLegend (cyclomatic 24): d2svg.RenderLegend 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":"d2renderers/d2svg/d2svg.go"},"region":{"startLine":181}}}],"partialFingerprints":{"codehealthFindingId/v1":"c77c4df87824d3a71253f4c98bad085cfa88be482635a5dcb5090ee01bdc3ade"}},{"ruleId":"D1","level":"warning","message":{"text":"d2cli._render (cyclomatic 23): d2cli._render 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":"d2cli/main.go"},"region":{"startLine":909}}}],"partialFingerprints":{"codehealthFindingId/v1":"d3a331a0b1fa90338a2171d703af5992f0249ff4c5ee0eda93cf2648a32353e1"}},{"ruleId":"D1","level":"warning","message":{"text":"ASCIIartist.calculateExtendedBounds (cyclomatic 23): ASCIIartist.calculateExtendedBounds 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":"d2renderers/d2ascii/d2ascii.go"},"region":{"startLine":140}}}],"partialFingerprints":{"codehealthFindingId/v1":"11f76e026caaeeda6b7a8b60a7e49f747b7b3c34cd59c412ab7eb07c24970efa"}},{"ruleId":"D1","level":"warning","message":{"text":"d2target.ToArrowhead (cyclomatic 23): d2target.ToArrowhead 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":"d2target/d2target.go"},"region":{"startLine":938}}}],"partialFingerprints":{"codehealthFindingId/v1":"1a7bf3564352085b7d0546144285afc443055e66b1a9a394d45ea4ae08aff904"}},{"ruleId":"D1","level":"warning","message":{"text":"compiler.validateNear (cyclomatic 22): compiler.validateNear 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":"d2compiler/compile.go"},"region":{"startLine":1170}}}],"partialFingerprints":{"codehealthFindingId/v1":"71db3fe4a6445d60255190d85d8a080634c96c30508b9f3527e63a8cb8d01edd"}},{"ruleId":"D1","level":"warning","message":{"text":"printer.mapKey (cyclomatic 22): printer.mapKey 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":"d2format/format.go"},"region":{"startLine":367}}}],"partialFingerprints":{"codehealthFindingId/v1":"047445bb1a8d2894977115f1e7955cec6014f85baac43ff01ce33e915d2bc291"}},{"ruleId":"D1","level":"warning","message":{"text":"d2oracle.generateUniqueKey (cyclomatic 22): d2oracle.generateUniqueKey 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":"d2oracle/edit.go"},"region":{"startLine":2648}}}],"partialFingerprints":{"codehealthFindingId/v1":"9e534acdfe75219dec99e7722546991a19b3bc683b42c5d16e7620649719c900"}},{"ruleId":"D1","level":"warning","message":{"text":"asciishapes.DrawStoredData (cyclomatic 22): asciishapes.DrawStoredData 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":"d2renderers/d2ascii/asciishapes/stored_data.go"},"region":{"startLine":7}}}],"partialFingerprints":{"codehealthFindingId/v1":"0c0d7600e5dcb9adfa33dbbdece28875f1a4337d16e79d72293b73097c43e436"}},{"ruleId":"D1","level":"warning","message":{"text":"Diagram.GetBoard (cyclomatic 22): Diagram.GetBoard 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":"d2target/d2target.go"},"region":{"startLine":106}}}],"partialFingerprints":{"codehealthFindingId/v1":"d80ba8b11cf2add9bce46356f698c7d9713009f1235714ced99f16084512490e"}},{"ruleId":"D1","level":"warning","message":{"text":"d2cli.render (cyclomatic 21): d2cli.render 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":"d2cli/main.go"},"region":{"startLine":813}}}],"partialFingerprints":{"codehealthFindingId/v1":"084606f6be7cc38a8ec1e59d73fb51d527fcb2de1ef0d53c50deedfd957c239c"}},{"ruleId":"D1","level":"warning","message":{"text":"d2cli.renderPPTX (cyclomatic 21): d2cli.renderPPTX 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":"d2cli/main.go"},"region":{"startLine":1133}}}],"partialFingerprints":{"codehealthFindingId/v1":"498907a26ff889fd989e41b5b7e0926768f6210772dd20d36e1722eac55fd7d6"}},{"ruleId":"D1","level":"warning","message":{"text":"watcher.watchLoop (cyclomatic 21): watcher.watchLoop 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":"d2cli/watch.go"},"region":{"startLine":225}}}],"partialFingerprints":{"codehealthFindingId/v1":"8063bd45c9a477f00288b760e0901f8364db77b2970bee7823c26f136210eeda"}},{"ruleId":"D1","level":"warning","message":{"text":"d2compiler.compileConfig (cyclomatic 21): d2compiler.compileConfig 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":"d2compiler/compile.go"},"region":{"startLine":1505}}}],"partialFingerprints":{"codehealthFindingId/v1":"f1a0268f3207eebff562f410264595782bccdb27fecfdc7afd13b09d72883620"}},{"ruleId":"D1","level":"warning","message":{"text":"d2graph.CompareSerializedEdge (cyclomatic 21): d2graph.CompareSerializedEdge 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":"d2graph/serde.go"},"region":{"startLine":357}}}],"partialFingerprints":{"codehealthFindingId/v1":"59f464bac90c020f04e7e60f7a328e5c2c3c49e854943b6975decd758aae5f85"}},{"ruleId":"D1","level":"warning","message":{"text":"Object.GetMargin (cyclomatic 21): Object.GetMargin 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":"d2graph/layout.go"},"region":{"startLine":289}}}],"partialFingerprints":{"codehealthFindingId/v1":"fb0b9e613195c62c0e52bcbea48ede57e89a268212b81e8c239a1a904bccc02d"}},{"ruleId":"D1","level":"warning","message":{"text":"compiler.compileLink (cyclomatic 21): compiler.compileLink 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":"d2ir/compile.go"},"region":{"startLine":1305}}}],"partialFingerprints":{"codehealthFindingId/v1":"628123169e2ce88781b7f7e842e537e997257bf016ae672c5e0e62de7991f294"}},{"ruleId":"D1","level":"warning","message":{"text":"d2dagrelayout.adjustCrossRankSpacing (cyclomatic 21): d2dagrelayout.adjustCrossRankSpacing 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":"d2layouts/d2dagrelayout/layout.go"},"region":{"startLine":1261}}}],"partialFingerprints":{"codehealthFindingId/v1":"39d1bc61c64ed4309498c681c07822b9cd8c6dede63e2e09d98c0ad582e74d49"}},{"ruleId":"D1","level":"warning","message":{"text":"d2oracle.RenameIDDeltas (cyclomatic 21): d2oracle.RenameIDDeltas has cyclomatic complexity 21 (threshold 15). Of this number, 15 points are the body\u0027s own statements and 6 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":"d2oracle/edit.go"},"region":{"startLine":3161}}}],"partialFingerprints":{"codehealthFindingId/v1":"bc249566f980e5052b6d798dbca4f8a8985c2406f3a9c5ab1c0347c670a35411"}},{"ruleId":"D1","level":"warning","message":{"text":"parser.parseMap (cyclomatic 21): parser.parseMap 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":"d2parser/parse.go"},"region":{"startLine":386}}}],"partialFingerprints":{"codehealthFindingId/v1":"8872ad65f27f1ee9f729b0a573156ec12408ed270e823c1d015ce7d61c1b9872"}},{"ruleId":"D1","level":"warning","message":{"text":"parser.parseBlockString (cyclomatic 21): parser.parseBlockString 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":"d2parser/parse.go"},"region":{"startLine":1397}}}],"partialFingerprints":{"codehealthFindingId/v1":"f3edc6a3abfd3c60bae3bf05a04c9d0e97437e2b2b6ce561f3e876347b7a0ef7"}},{"ruleId":"D1","level":"warning","message":{"text":"d2svg.singleThemeRulesets (cyclomatic 21): d2svg.singleThemeRulesets 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":"d2renderers/d2svg/d2svg.go"},"region":{"startLine":3142}}}],"partialFingerprints":{"codehealthFindingId/v1":"b536d3d8a0468ac03ea5e633919ce381f6f064cc3a374064f6a56857303f3b7d"}},{"ruleId":"D1","level":"warning","message":{"text":"Theme.ApplyOverrides (cyclomatic 21): Theme.ApplyOverrides 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":"d2themes/d2themes.go"},"region":{"startLine":33}}}],"partialFingerprints":{"codehealthFindingId/v1":"08c786e867e7d809898aee7a01e7e8263c1b61324d96bb9d0cc5de7ab826363f"}},{"ruleId":"D1","level":"warning","message":{"text":"color.Darken (cyclomatic 21): color.Darken 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":"lib/color/color.go"},"region":{"startLine":22}}}],"partialFingerprints":{"codehealthFindingId/v1":"6bb5f3d1d9e62fc2d6f565b21ebc43aa6ea576ee55190830dbe1819928f42d6f"}},{"ruleId":"D1","level":"warning","message":{"text":"d2cli.resolveLinks (cyclomatic 20): d2cli.resolveLinks has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2cli/main.go"},"region":{"startLine":706}}}],"partialFingerprints":{"codehealthFindingId/v1":"bc5a476dd1ae0fa3cb933d92f4336aa951332c1eb39888ede92ad4ce3425405e"}},{"ruleId":"D1","level":"warning","message":{"text":"compiler.compileSubstitutions (cyclomatic 20): compiler.compileSubstitutions 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":"d2ir/compile.go"},"region":{"startLine":127}}}],"partialFingerprints":{"codehealthFindingId/v1":"6107f99340a3d735797581371c96bac12273fccbf55ec81a87b6618c8351ff01"}},{"ruleId":"D1","level":"warning","message":{"text":"compiler.IsContainer (cyclomatic 20): compiler.IsContainer 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":"d2ir/d2ir.go"},"region":{"startLine":708}}}],"partialFingerprints":{"codehealthFindingId/v1":"13cc8de8e63a9f728f03219379884420e2a001cf1ae137782cec388b145f490b"}},{"ruleId":"D1","level":"warning","message":{"text":"Map.DeleteField (cyclomatic 20): Map.DeleteField 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":"d2ir/d2ir.go"},"region":{"startLine":1089}}}],"partialFingerprints":{"codehealthFindingId/v1":"7fde5e778be461906bf79ee8624becb93537a0f83b9847a726d7cbb9b02f5496"}},{"ruleId":"D1","level":"warning","message":{"text":"d2dagrelayout.adjustEdges (cyclomatic 20): d2dagrelayout.adjustEdges 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 1757). 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":"d2layouts/d2dagrelayout/layout.go"},"region":{"startLine":1756}}}],"partialFingerprints":{"codehealthFindingId/v1":"48b9b21d8ac523e2ae432cda73d922471bdcb14ad4729d445e3bc7c9975d7100"}},{"ruleId":"D1","level":"warning","message":{"text":"d2sequence.newSequenceDiagram (cyclomatic 20): d2sequence.newSequenceDiagram 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":"d2layouts/d2sequence/sequence_diagram.go"},"region":{"startLine":77}}}],"partialFingerprints":{"codehealthFindingId/v1":"cb1d359f58950ec7b93d57be285ed6bb9f88f41c5fd3d6e992791e09995cf5ed"}},{"ruleId":"D1","level":"warning","message":{"text":"d2cli.renderPDF (cyclomatic 19): d2cli.renderPDF 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":"d2cli/main.go"},"region":{"startLine":1021}}}],"partialFingerprints":{"codehealthFindingId/v1":"9f5ed31aac3317856a272d8cfe4c4327189756b0652e819ad69000ec9d841299"}},{"ruleId":"D1","level":"warning","message":{"text":"d2exporter.applyStyles (cyclomatic 19): d2exporter.applyStyles 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":"d2exporter/export.go"},"region":{"startLine":152}}}],"partialFingerprints":{"codehealthFindingId/v1":"e2d3e3fc435aeec35bd814ab92d9907a6842daabac4cd313b83b56ca81f42e70"}},{"ruleId":"D1","level":"warning","message":{"text":"compiler.validateConfigs (cyclomatic 19): compiler.validateConfigs 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":"d2ir/compile.go"},"region":{"startLine":172}}}],"partialFingerprints":{"codehealthFindingId/v1":"366038c08c6c90c056eac6f92aa18ca86e721309ba2d9aa4b8a9e6989c62f034"}},{"ruleId":"D1","level":"warning","message":{"text":"Map.getEdges (cyclomatic 19): Map.getEdges 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":"d2ir/d2ir.go"},"region":{"startLine":1179}}}],"partialFingerprints":{"codehealthFindingId/v1":"05633efe4a004c5c304ecd72e0285aca03ed0dc4ae85020c5b1d3016b81895df"}},{"ruleId":"D1","level":"warning","message":{"text":"d2dagrelayout.getLongestEdgeChainHead (cyclomatic 19): d2dagrelayout.getLongestEdgeChainHead 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":"d2layouts/d2dagrelayout/layout.go"},"region":{"startLine":414}}}],"partialFingerprints":{"codehealthFindingId/v1":"8c379be4823c35e03ba68e1b6d488e6cfc4c2b6943f7d4443360faa0bed2820b"}},{"ruleId":"D1","level":"warning","message":{"text":"d2near.place (cyclomatic 19): d2near.place 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":"d2layouts/d2near/layout.go"},"region":{"startLine":95}}}],"partialFingerprints":{"codehealthFindingId/v1":"97b039b84e559a872b07aca36dc40b6f4aa252de92aa6182bddeb7799f938c68"}},{"ruleId":"D1","level":"warning","message":{"text":"d2near.boundingBox (cyclomatic 19): d2near.boundingBox 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":"d2layouts/d2near/layout.go"},"region":{"startLine":151}}}],"partialFingerprints":{"codehealthFindingId/v1":"9932a88a5d630b08c2aec3f9daa1b0aef7d32995b2ee3687adbbf5231cc0bd8d"}},{"ruleId":"D1","level":"warning","message":{"text":"asciishapes.DrawPackage (cyclomatic 19): asciishapes.DrawPackage 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":"d2renderers/d2ascii/asciishapes/package.go"},"region":{"startLine":5}}}],"partialFingerprints":{"codehealthFindingId/v1":"7ac9aeb833ee29590936fff83cf627f751005846e1ec476f4e8d6ea0387c4fc1"}},{"ruleId":"D1","level":"warning","message":{"text":"asciishapes.DrawStep (cyclomatic 19): asciishapes.DrawStep 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":"d2renderers/d2ascii/asciishapes/step.go"},"region":{"startLine":3}}}],"partialFingerprints":{"codehealthFindingId/v1":"d3a6d2bb0dfcd14924fc9bf11905fdd74d7995de5ac4da0c639f331646ac07fe"}},{"ruleId":"D1","level":"warning","message":{"text":"d2svg.dimensions (cyclomatic 19): d2svg.dimensions 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":"d2renderers/d2svg/d2svg.go"},"region":{"startLine":99}}}],"partialFingerprints":{"codehealthFindingId/v1":"243b4c7142fe3a99e0047bdc8d0d9b5dac6d52ac4e79e12038fe65c91bbd7e2e"}},{"ruleId":"D1","level":"warning","message":{"text":"pptx.Validate (cyclomatic 19): pptx.Validate 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":"lib/pptx/validate.go"},"region":{"startLine":13}}}],"partialFingerprints":{"codehealthFindingId/v1":"fc4a6f3f5e2386203dc1acc6e5f1b6a06191969d35ca0e5b8a29a8ae3f3038bf"}},{"ruleId":"D1","level":"warning","message":{"text":"d2ast.RawString (cyclomatic 18): d2ast.RawString 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":"d2ast/d2ast.go"},"region":{"startLine":1563}}}],"partialFingerprints":{"codehealthFindingId/v1":"85d0d7abce32c0a1c142aa66f9db441602c7224f54a49f2b84d4608c460c73cb"}},{"ruleId":"D1","level":"warning","message":{"text":"compiler.compilePosition (cyclomatic 18): compiler.compilePosition 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":"d2compiler/compile.go"},"region":{"startLine":478}}}],"partialFingerprints":{"codehealthFindingId/v1":"1464655cfea20f77a8f52af92f3ad93f9f7c0373d65a6bd75d21712c6d08d482"}},{"ruleId":"D1","level":"warning","message":{"text":"d2exporter.toShape (cyclomatic 18): d2exporter.toShape 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":"d2exporter/export.go"},"region":{"startLine":209}}}],"partialFingerprints":{"codehealthFindingId/v1":"850bcc25664585983e86779d11892f57a3e6dc8360310e4d1773bf35ce7c62d6"}},{"ruleId":"D1","level":"warning","message":{"text":"Object.FindEdges (cyclomatic 18): Object.FindEdges 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":"d2graph/d2graph.go"},"region":{"startLine":820}}}],"partialFingerprints":{"codehealthFindingId/v1":"c7c7f48afbf05cd0f0c8571764a393f50ff87757ef1c47d373e1253b94f60460"}},{"ruleId":"D1","level":"warning","message":{"text":"Object.ShiftDescendants (cyclomatic 18): Object.ShiftDescendants has cyclomatic complexity 18 (threshold 15). 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 119). 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":"d2graph/layout.go"},"region":{"startLine":103}}}],"partialFingerprints":{"codehealthFindingId/v1":"225957c63f8624bf524f19a27638f09934ccc67c2325e7c09f59fc3df0703ca5"}},{"ruleId":"D1","level":"warning","message":{"text":"Map.FindBoardRoot (cyclomatic 18): Map.FindBoardRoot 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":"d2ir/d2ir.go"},"region":{"startLine":1937}}}],"partialFingerprints":{"codehealthFindingId/v1":"5997eb8dccc47dc9f0f548573707d0b4f873079722bac1f4de5f7728835dd711"}},{"ruleId":"D1","level":"warning","message":{"text":"gridDiagram.layoutEvenly (cyclomatic 18): gridDiagram.layoutEvenly 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":"d2layouts/d2grid/layout.go"},"region":{"startLine":232}}}],"partialFingerprints":{"codehealthFindingId/v1":"5621bff05487587bea2b92b39ec89eaec28f9eee667a7516fb95542d2bf68e8c"}},{"ruleId":"D1","level":"warning","message":{"text":"sequenceDiagram.adjustGroupLabel (cyclomatic 18): sequenceDiagram.adjustGroupLabel 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":"d2layouts/d2sequence/sequence_diagram.go"},"region":{"startLine":312}}}],"partialFingerprints":{"codehealthFindingId/v1":"b9e6d7108dcc7d5c68e555480e9f1bf383acc5634eeca9e3a096eb24f0ce9f0b"}},{"ruleId":"D1","level":"warning","message":{"text":"d2oracle.deleteObjField (cyclomatic 18): d2oracle.deleteObjField 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":"d2oracle/edit.go"},"region":{"startLine":1478}}}],"partialFingerprints":{"codehealthFindingId/v1":"f95fea9587b393dc4e25b7e9c2787ba896fd14309656355ae4ddad789aabd08d"}},{"ruleId":"D1","level":"warning","message":{"text":"d2oracle._updateImport (cyclomatic 18): d2oracle._updateImport 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":"d2oracle/edit.go"},"region":{"startLine":3352}}}],"partialFingerprints":{"codehealthFindingId/v1":"5d08295c61ecbec33d98cc861879692c884280b88a599c44f0e7f1d2bd1d5a4f"}},{"ruleId":"D1","level":"warning","message":{"text":"utf8FontFile.parseHMTXTable (cyclomatic 18): utf8FontFile.parseHMTXTable has cyclomatic complexity 18 (threshold 15). This file\u0027s own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes \u2014 or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/font/subsetFont.go"},"region":{"startLine":582}}}],"partialFingerprints":{"codehealthFindingId/v1":"33dc9ef36083055be8d45d2e7a985f151630b834b30429e185651d7749270cd4"}},{"ruleId":"D1","level":"warning","message":{"text":"Graph.IDA (cyclomatic 17): Graph.IDA 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":"d2graph/d2graph.go"},"region":{"startLine":94}}}],"partialFingerprints":{"codehealthFindingId/v1":"eb86eff151fe0b0794cc7dd6de2560e5face0b3d6570fcda06a655985110f8a5"}},{"ruleId":"D1","level":"warning","message":{"text":"Map.createEdge2 (cyclomatic 17): Map.createEdge2 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":"d2ir/d2ir.go"},"region":{"startLine":1383}}}],"partialFingerprints":{"codehealthFindingId/v1":"c3b35945bf666a952d7005d26be7ec4ab1f6c861a15dafc01781da80edff3fbf"}},{"ruleId":"D1","level":"warning","message":{"text":"d2elklayout.adjustPadding (cyclomatic 17): d2elklayout.adjustPadding 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":"d2layouts/d2elklayout/layout.go"},"region":{"startLine":1018}}}],"partialFingerprints":{"codehealthFindingId/v1":"5035e94ed4a9af4c18e554d83f43f8a3a8ef33b1cf3950f843e78149c5f9bf92"}},{"ruleId":"D1","level":"warning","message":{"text":"d2layouts.ExtractSubgraph (cyclomatic 17): d2layouts.ExtractSubgraph 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":"d2layouts/d2layouts.go"},"region":{"startLine":375}}}],"partialFingerprints":{"codehealthFindingId/v1":"925511dc2dac1bbe66a4a2373bfa300ae73e73ebe484e7b5628d334ac9fe5413"}},{"ruleId":"D1","level":"warning","message":{"text":"d2oracle.deleteMapField (cyclomatic 17): d2oracle.deleteMapField 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":"d2oracle/edit.go"},"region":{"startLine":1419}}}],"partialFingerprints":{"codehealthFindingId/v1":"f6103250aeb2d5b25830ad5143f1bc7c3b5bab30dda769f02fb393a782096ac5"}},{"ruleId":"D1","level":"warning","message":{"text":"parser.parseKey (cyclomatic 17): parser.parseKey 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":"d2parser/parse.go"},"region":{"startLine":974}}}],"partialFingerprints":{"codehealthFindingId/v1":"3cd08968270de641f8625893197aaa7eaa82d5231cbb3e4db0896393b6115b4d"}},{"ruleId":"D1","level":"warning","message":{"text":"asciishapes.DrawCallout (cyclomatic 17): asciishapes.DrawCallout 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":"d2renderers/d2ascii/asciishapes/callout.go"},"region":{"startLine":5}}}],"partialFingerprints":{"codehealthFindingId/v1":"585d410470968a96a6dc09e940cabec46c4495e7eb78286c4daeb04dc052bb99"}},{"ruleId":"D1","level":"warning","message":{"text":"asciishapes.DrawHex (cyclomatic 17): asciishapes.DrawHex 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":"d2renderers/d2ascii/asciishapes/hexagon.go"},"region":{"startLine":7}}}],"partialFingerprints":{"codehealthFindingId/v1":"1faf9d26893b0e5b67256011c9339d1f1e901c4c26e4f1e54a3fdd7ba45ede4b"}},{"ruleId":"D1","level":"warning","message":{"text":"Diagram.GetCorpus (cyclomatic 17): Diagram.GetCorpus 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":"d2target/d2target.go"},"region":{"startLine":506}}}],"partialFingerprints":{"codehealthFindingId/v1":"b0018f1942ccd77cb40c01b6b979258093b282aa3843c8af209975803ad19491"}},{"ruleId":"D1","level":"warning","message":{"text":"utf8FontFile.GenerateCutFont (cyclomatic 17): utf8FontFile.GenerateCutFont has cyclomatic complexity 17 (threshold 15). This file\u0027s own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes \u2014 or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/font/subsetFont.go"},"region":{"startLine":387}}}],"partialFingerprints":{"codehealthFindingId/v1":"458dddfaff650d29ff12e28f20e7ba062097d53f1a78543151cff227b3a3e9d0"}},{"ruleId":"D1","level":"warning","message":{"text":"Presentation.SaveTo (cyclomatic 17): Presentation.SaveTo 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":"lib/pptx/pptx.go"},"region":{"startLine":172}}}],"partialFingerprints":{"codehealthFindingId/v1":"067288532b8ecd498edbe10295b782d97bf4bcd7118326bc8fb9d2d3c0b3ee13"}},{"ruleId":"D1","level":"warning","message":{"text":"Object.Text (cyclomatic 16): Object.Text 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":"d2graph/d2graph.go"},"region":{"startLine":661}}}],"partialFingerprints":{"codehealthFindingId/v1":"d63c01320ed0a6b3b83647498001a88afa041a87e794f5c034da464ed3fa6a07"}},{"ruleId":"D1","level":"warning","message":{"text":"compiler._ampersandPropertyFilter (cyclomatic 16): compiler._ampersandPropertyFilter 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":"d2ir/compile.go"},"region":{"startLine":962}}}],"partialFingerprints":{"codehealthFindingId/v1":"6dd24ea8db5d8e35dffd36dfdd29a05ad1b8cba3e54ae71e136fa8ca03427869"}},{"ruleId":"D1","level":"warning","message":{"text":"RefContext.Equal (cyclomatic 16): RefContext.Equal 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":"d2ir/d2ir.go"},"region":{"startLine":650}}}],"partialFingerprints":{"codehealthFindingId/v1":"27af38c626a0999cfbed899df770a6eedc146f75ebcceded39377868877329c9"}},{"ruleId":"D1","level":"warning","message":{"text":"d2dagrelayout.getLongestEdgeChainTail (cyclomatic 16): d2dagrelayout.getLongestEdgeChainTail 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":"d2layouts/d2dagrelayout/layout.go"},"region":{"startLine":479}}}],"partialFingerprints":{"codehealthFindingId/v1":"84f22afe8ec3311597a0265aad007b35857634491cc0d6403c938ac335dfa4c1"}},{"ruleId":"D1","level":"warning","message":{"text":"d2dagrelayout.positionLabelsIcons (cyclomatic 16): d2dagrelayout.positionLabelsIcons 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":"d2layouts/d2dagrelayout/layout.go"},"region":{"startLine":546}}}],"partialFingerprints":{"codehealthFindingId/v1":"2634efdb354f469716e97586a52234aba7963bad8f7f2fa06416834d24a9b236"}},{"ruleId":"D1","level":"warning","message":{"text":"d2elklayout.positionLabelsIcons (cyclomatic 16): d2elklayout.positionLabelsIcons 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":"d2layouts/d2elklayout/layout.go"},"region":{"startLine":1110}}}],"partialFingerprints":{"codehealthFindingId/v1":"0dbac16b026e8646c16a8c3c561fcb87aafae3684a93274843775f5bb88ef019"}},{"ruleId":"D1","level":"warning","message":{"text":"d2lsp.GetRefRanges (cyclomatic 16): d2lsp.GetRefRanges 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":"d2lsp/d2lsp.go"},"region":{"startLine":14}}}],"partialFingerprints":{"codehealthFindingId/v1":"00cfd90720d17bc66fe58ab5572dccbce9ecee97239b946e335ef36292c7f1d3"}},{"ruleId":"D1","level":"warning","message":{"text":"parser.parseValue (cyclomatic 16): parser.parseValue 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":"d2parser/parse.go"},"region":{"startLine":1631}}}],"partialFingerprints":{"codehealthFindingId/v1":"8c5047c9ba2d5b75e21d727153e0b6eaea6d9c2aa863cb02ccf71ea8d2c2f59d"}},{"ruleId":"D1","level":"warning","message":{"text":"asciiroute.drawConnectionLabel (cyclomatic 16): asciiroute.drawConnectionLabel 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":"d2renderers/d2ascii/asciiroute/labels.go"},"region":{"startLine":87}}}],"partialFingerprints":{"codehealthFindingId/v1":"1c29d2372f8c36e335e8b7f10b4844e394c97d802008a271166d4ab4d1dc3558"}},{"ruleId":"D1","level":"warning","message":{"text":"asciishapes.DrawRect (cyclomatic 16): asciishapes.DrawRect 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":"d2renderers/d2ascii/asciishapes/rectangle.go"},"region":{"startLine":11}}}],"partialFingerprints":{"codehealthFindingId/v1":"f94bd49522141b81bd31174f928da1914134dcff243d275ac21d6901335afa74"}},{"ruleId":"D1","level":"warning","message":{"text":"GoFPDF.AddPDFPage (cyclomatic 16): GoFPDF.AddPDFPage 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":"lib/pdf/pdf.go"},"region":{"startLine":69}}}],"partialFingerprints":{"codehealthFindingId/v1":"12b71638672fd96fc8787a70fbcaac96bb72ca8756fd02fabf458d040b845435"}},{"ruleId":"D1","level":"warning","message":{"text":"xgif.AnimatePNGs (cyclomatic 16): xgif.AnimatePNGs 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 126). 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":"lib/xgif/xgif.go"},"region":{"startLine":95}}}],"partialFingerprints":{"codehealthFindingId/v1":"b938615c12af4fb3c6c70d4893bbc291fcefdda9cd39e4c490bfa670811eb3f7"}},{"ruleId":"D2","level":"warning","message":{"text":"d2oracle._set (cognitive 455): d2oracle._set has cognitive complexity 455 (threshold 15). Drivers by points: if/else 387, loops 26, boolean chains 25, match/switch 17 (nesting depth added 308). Of this number, 445 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":"d2oracle/edit.go"},"region":{"startLine":327}}}],"partialFingerprints":{"codehealthFindingId/v1":"820ced844b6185ccf91e206e2b6fe92f6cbdc237834604fb53e56947fe8557ba"}},{"ruleId":"D2","level":"warning","message":{"text":"d2oracle.move (cognitive 356): d2oracle.move has cognitive complexity 356 (threshold 15). Drivers by points: if/else 297, loops 42, boolean chains 17 (nesting depth added 230). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2oracle/edit.go"},"region":{"startLine":1767}}}],"partialFingerprints":{"codehealthFindingId/v1":"4ecc4f498b8bf3dda0b00d2ac241ddb880f5f36ea078b296edf5dd3373584c61"}},{"ruleId":"D2","level":"warning","message":{"text":"d2dagrelayout.shiftReachableDown (cognitive 279): d2dagrelayout.shiftReachableDown has cognitive complexity 279 (threshold 15). Drivers by points: if/else 214, loops 47, boolean chains 18 (nesting depth added 174). Of this number, 61 points are the body\u0027s own statements and 218 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":"d2layouts/d2dagrelayout/layout.go"},"region":{"startLine":765}}}],"partialFingerprints":{"codehealthFindingId/v1":"a300517bb3147a7c60984e9627b31c877cf1e0115a60f2cddd554695e3857c99"}},{"ruleId":"D2","level":"warning","message":{"text":"d2svg.drawShape (cognitive 268): d2svg.drawShape has cognitive complexity 268 (threshold 15). Drivers by points: if/else 228, loops 26, boolean chains 11, match/switch 3 (nesting depth added 149). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svg/d2svg.go"},"region":{"startLine":1602}}}],"partialFingerprints":{"codehealthFindingId/v1":"bda39f6d2d348ed896acbf567827b20f105b49d38d55e415eb9f27e3285e5c03"}},{"ruleId":"D2","level":"warning","message":{"text":"d2dagrelayout.fitPadding (cognitive 248): d2dagrelayout.fitPadding has cognitive complexity 248 (threshold 15). Drivers by points: if/else 172, loops 45, match/switch 22, boolean chains 9 (nesting depth added 166). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2dagrelayout/layout.go"},"region":{"startLine":1339}}}],"partialFingerprints":{"codehealthFindingId/v1":"17fe6b01e213455cd3874df4484cfd3b65c31d8feab7ea6837f8cb4bc410942f"}},{"ruleId":"D2","level":"warning","message":{"text":"Ruler.measureNode (cognitive 205): Ruler.measureNode has cognitive complexity 205 (threshold 15). Drivers by points: if/else 154, loops 28, boolean chains 15, match/switch 8 (nesting depth added 122). Of this number, 201 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":"lib/textmeasure/markdown.go"},"region":{"startLine":217}}}],"partialFingerprints":{"codehealthFindingId/v1":"f88e2fe7d88d48b927f84e368b630b8672b46aa9525e48bf1913f46b6472667a"}},{"ruleId":"D2","level":"warning","message":{"text":"compiler._compileEdges (cognitive 190): compiler._compileEdges has cognitive complexity 190 (threshold 15). Drivers by points: if/else 145, loops 30, boolean chains 15 (nesting depth added 136). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ir/compile.go"},"region":{"startLine":1392}}}],"partialFingerprints":{"codehealthFindingId/v1":"5be96eaffa022543bbcde8a5639d1fa3b0d637f05d934baf4f72e4b684dcd8b3"}},{"ruleId":"D2","level":"warning","message":{"text":"d2elklayout.Layout (cognitive 182): d2elklayout.Layout has cognitive complexity 182 (threshold 15). Drivers by points: if/else 119, loops 34, boolean chains 17, match/switch 12 (nesting depth added 87). Of this number, 145 points are the body\u0027s own statements and 37 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":"d2layouts/d2elklayout/layout.go"},"region":{"startLine":154}}}],"partialFingerprints":{"codehealthFindingId/v1":"42e996fa49112083c4fa537d00055d479a30bf6dcae0b2c2d94af8563a2e3518"}},{"ruleId":"D2","level":"warning","message":{"text":"d2dagrelayout.adjustRankSpacing (cognitive 176): d2dagrelayout.adjustRankSpacing has cognitive complexity 176 (threshold 15). Drivers by points: if/else 131, loops 37, boolean chains 8 (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":"d2layouts/d2dagrelayout/layout.go"},"region":{"startLine":1078}}}],"partialFingerprints":{"codehealthFindingId/v1":"ce98a49a994369b50e6e161dd427e745225747fae40532585964034d2d0927b2"}},{"ruleId":"D2","level":"warning","message":{"text":"compiler.resolveSubstitutions (cognitive 169): compiler.resolveSubstitutions has cognitive complexity 169 (threshold 15). Drivers by points: if/else 117, loops 33, match/switch 16, boolean chains 3 (nesting depth added 128). 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":"d2ir/compile.go"},"region":{"startLine":228}}}],"partialFingerprints":{"codehealthFindingId/v1":"c8fa9153e32ad671a49b20b3d3b758289aae4495b78085a299c189558a2b2acc"}},{"ruleId":"D2","level":"warning","message":{"text":"d2svg.Render (cognitive 141): d2svg.Render has cognitive complexity 141 (threshold 15). Drivers by points: if/else 109, loops 18, boolean chains 11, match/switch 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":"d2renderers/d2svg/d2svg.go"},"region":{"startLine":2733}}}],"partialFingerprints":{"codehealthFindingId/v1":"97cf9acdd13fba9a1774fc6495841ddfeaa7548a0a482babd6ccf17fd2d74cb0"}},{"ruleId":"D2","level":"warning","message":{"text":"d2svg.drawConnection (cognitive 137): d2svg.drawConnection has cognitive complexity 137 (threshold 15). Drivers by points: if/else 118, loops 12, boolean chains 7 (nesting depth added 74). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svg/d2svg.go"},"region":{"startLine":1006}}}],"partialFingerprints":{"codehealthFindingId/v1":"81e4a10da428a69568439d5a589d2a39577452b028513545f60ba027615cec4b"}},{"ruleId":"D2","level":"warning","message":{"text":"d2oracle.updateNear (cognitive 129): d2oracle.updateNear has cognitive complexity 129 (threshold 15). Drivers by points: if/else 120, loops 6, boolean chains 3 (nesting depth added 89). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2oracle/edit.go"},"region":{"startLine":2330}}}],"partialFingerprints":{"codehealthFindingId/v1":"d88f11f420c7197f0298b01084320d739930ebf87efbb210d14bcb88d4cb73de"}},{"ruleId":"D2","level":"warning","message":{"text":"compiler.compileReserved (cognitive 123): compiler.compileReserved has cognitive complexity 123 (threshold 15). Drivers by points: if/else 89, match/switch 14, loops 13, boolean chains 7 (nesting depth added 71). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2compiler/compile.go"},"region":{"startLine":537}}}],"partialFingerprints":{"codehealthFindingId/v1":"a313dd5d841eaf12cecf18a9635580acfe4b5bae7c90a48c14c2c943bd3ca4fe"}},{"ruleId":"D2","level":"warning","message":{"text":"Map.ensureField (cognitive 121): Map.ensureField has cognitive complexity 121 (threshold 15). Drivers by points: if/else 101, boolean chains 11, loops 9 (nesting depth added 59). Of this number, 96 points are the body\u0027s own statements and 25 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":"d2ir/d2ir.go"},"region":{"startLine":858}}}],"partialFingerprints":{"codehealthFindingId/v1":"ec8c5a7d79a221d4e21fd0f75f608ab919a2739863c2b959b480250214f80bc5"}},{"ruleId":"D2","level":"warning","message":{"text":"Graph.SetDimensions (cognitive 115): Graph.SetDimensions has cognitive complexity 115 (threshold 15). Drivers by points: if/else 92, boolean chains 15, match/switch 6, loops 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":"d2graph/d2graph.go"},"region":{"startLine":1502}}}],"partialFingerprints":{"codehealthFindingId/v1":"153f013706a50c563803170e74d16ab199f8ad6ea24726f8fad5003f9b3530d4"}},{"ruleId":"D2","level":"warning","message":{"text":"d2dagrelayout.Layout (cognitive 112): d2dagrelayout.Layout has cognitive complexity 112 (threshold 15). Drivers by points: if/else 80, loops 20, boolean chains 8, match/switch 4 (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":"d2layouts/d2dagrelayout/layout.go"},"region":{"startLine":72}}}],"partialFingerprints":{"codehealthFindingId/v1":"164fa85aa8505817ebf8455ecd7b5f4ae82b671b2749490563dc4558f8d3c739"}},{"ruleId":"D2","level":"warning","message":{"text":"compiler._compileField (cognitive 109): compiler._compileField has cognitive complexity 109 (threshold 15). Drivers by points: if/else 74, loops 15, match/switch 13, boolean chains 7 (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":"d2ir/compile.go"},"region":{"startLine":1058}}}],"partialFingerprints":{"codehealthFindingId/v1":"08570127e05d6c5811ce2e5bcc1c31f03076202c3c21ee4520e657bd1d161c59"}},{"ruleId":"D2","level":"warning","message":{"text":"d2cli.Run (cognitive 107): d2cli.Run has cognitive complexity 107 (threshold 15). Drivers by points: if/else 97, boolean chains 7, match/switch 3 (nesting depth added 23). Of this number, 105 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":"d2cli/main.go"},"region":{"startLine":52}}}],"partialFingerprints":{"codehealthFindingId/v1":"17a506a1d3686e119d60af0d3da74221a1a806758284cb63e71bf2b033d7c4fa"}},{"ruleId":"D2","level":"warning","message":{"text":"d2elklayout.deleteBends (cognitive 107): d2elklayout.deleteBends has cognitive complexity 107 (threshold 15). Drivers by points: if/else 95, loops 9, match/switch 3 (nesting depth added 68). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2elklayout/layout.go"},"region":{"startLine":661}}}],"partialFingerprints":{"codehealthFindingId/v1":"d12a798d74740e7f99fe5896965b209d3f4e03d89af09a2bb1a83039529c3283"}},{"ruleId":"D2","level":"warning","message":{"text":"d2oracle.Delete (cognitive 104): d2oracle.Delete has cognitive complexity 104 (threshold 15). Drivers by points: if/else 84, loops 19, boolean chains 1 (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":"d2oracle/edit.go"},"region":{"startLine":938}}}],"partialFingerprints":{"codehealthFindingId/v1":"94352eb4396e995b29a66113eae40e048d7e099cbaed65d456165d7e09e38e94"}},{"ruleId":"D2","level":"warning","message":{"text":"d2layouts.LayoutNested (cognitive 103): d2layouts.LayoutNested has cognitive complexity 103 (threshold 15). Drivers by points: if/else 77, loops 21, boolean chains 3, match/switch 2 (nesting depth added 58). 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":"d2layouts/d2layouts.go"},"region":{"startLine":78}}}],"partialFingerprints":{"codehealthFindingId/v1":"ccef4cd3c1dd0e6a598b5bc1643bd792b84d62b8b8fcdf5df3ff9005ade1aad1"}},{"ruleId":"D2","level":"warning","message":{"text":"d2oracle.DeleteIDDeltas (cognitive 101): d2oracle.DeleteIDDeltas has cognitive complexity 101 (threshold 15). Drivers by points: if/else 73, loops 25, boolean chains 3 (nesting depth added 59). Of this number, 85 points are the body\u0027s own statements and 16 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2oracle/edit.go"},"region":{"startLine":2970}}}],"partialFingerprints":{"codehealthFindingId/v1":"a24a066e7d767f703abc07d434738b6819f7b61eb01298df0ca8950e5560909b"}},{"ruleId":"D2","level":"warning","message":{"text":"compiler.ampersandFilter (cognitive 96): compiler.ampersandFilter has cognitive complexity 96 (threshold 15). Drivers by points: if/else 60, loops 17, boolean chains 13, match/switch 6 (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":"d2ir/compile.go"},"region":{"startLine":718}}}],"partialFingerprints":{"codehealthFindingId/v1":"4189a52422e3af5f1aeb4b48a71d1594da118ef8cd80ac23502d165329e4a98e"}},{"ruleId":"D2","level":"warning","message":{"text":"Edge.TraceToShape (cognitive 94): Edge.TraceToShape has cognitive complexity 94 (threshold 15). Drivers by points: if/else 68, boolean chains 14, loops 12 (nesting depth added 50). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2graph/layout.go"},"region":{"startLine":414}}}],"partialFingerprints":{"codehealthFindingId/v1":"d55e1bdc89032c0d9a141536cc0502cd1dae6d283f59e11f266bb37aebbad005"}},{"ruleId":"D2","level":"warning","message":{"text":"Style.Apply (cognitive 90): Style.Apply has cognitive complexity 90 (threshold 15). Drivers by points: if/else 80, boolean chains 9, match/switch 1 (nesting depth added 40). 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":"d2graph/d2graph.go"},"region":{"startLine":315}}}],"partialFingerprints":{"codehealthFindingId/v1":"ddd0c529534780e4032eee43fa850ba7dbbe1c24b07a2c5057d67dd92d38994d"}},{"ruleId":"D2","level":"warning","message":{"text":"d2oracle.renameConflictsToParent (cognitive 90): d2oracle.renameConflictsToParent has cognitive complexity 90 (threshold 15). Drivers by points: if/else 67, loops 21, boolean chains 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":"d2oracle/edit.go"},"region":{"startLine":1163}}}],"partialFingerprints":{"codehealthFindingId/v1":"120b8ec31d9f90cb8c0c171bb87cd9aca29160574fcc650c3d8aa8172b3b6561"}},{"ruleId":"D2","level":"warning","message":{"text":"gridDiagram.layoutDynamic (cognitive 89): gridDiagram.layoutDynamic has cognitive complexity 89 (threshold 15). Drivers by points: loops 67, if/else 22 (nesting depth added 56). 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":"d2layouts/d2grid/layout.go"},"region":{"startLine":324}}}],"partialFingerprints":{"codehealthFindingId/v1":"7bb9a777b3cfcb550384ada0eb6e30d4b64aa356a79065885835ac61bed4da92"}},{"ruleId":"D2","level":"warning","message":{"text":"d2oracle.MoveIDDeltas (cognitive 84): d2oracle.MoveIDDeltas has cognitive complexity 84 (threshold 15). Drivers by points: if/else 63, loops 17, boolean chains 4 (nesting depth added 44). Of this number, 69 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":"d2oracle/edit.go"},"region":{"startLine":2776}}}],"partialFingerprints":{"codehealthFindingId/v1":"434d8a379818bde093635cee14185347fca5241f74d5a7f3124522214ef4c9c6"}},{"ruleId":"D2","level":"warning","message":{"text":"d2lsp.getKeywordContext (cognitive 83): d2lsp.getKeywordContext has cognitive complexity 83 (threshold 15). Drivers by points: if/else 71, boolean chains 11, loops 1 (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":"d2lsp/completion.go"},"region":{"startLine":103}}}],"partialFingerprints":{"codehealthFindingId/v1":"6c8598096a3373e6b60b71c493a782b376cdf83490dc4fe448e64704656a4983"}},{"ruleId":"D2","level":"warning","message":{"text":"d2cli.compile (cognitive 77): d2cli.compile has cognitive complexity 77 (threshold 15). Drivers by points: if/else 75, boolean chains 1, match/switch 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":"d2cli/main.go"},"region":{"startLine":490}}}],"partialFingerprints":{"codehealthFindingId/v1":"6fff3da16d60c7643dd8dd05a2215ac5f3fff204092ab97d48fac424d630a9dd"}},{"ruleId":"D2","level":"warning","message":{"text":"compiler.compileMap (cognitive 76): compiler.compileMap has cognitive complexity 76 (threshold 15). Drivers by points: if/else 47, loops 24, boolean chains 3, match/switch 2 (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":"d2ir/compile.go"},"region":{"startLine":502}}}],"partialFingerprints":{"codehealthFindingId/v1":"efe74c23d31258c4a3ab9e353a830529a11c97ad65f9a5850a4e64b4c806d9ca"}},{"ruleId":"D2","level":"warning","message":{"text":"main.main (cognitive 76): main.main has cognitive complexity 76 (threshold 15). Drivers by points: if/else 71, loops 4, boolean chains 1 (nesting depth added 41). Of this number, 30 points are the body\u0027s own statements and 46 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":"e2etests/report/main.go"},"region":{"startLine":34}}}],"partialFingerprints":{"codehealthFindingId/v1":"789c5025931ccdd4683e4e810357a2e82b581fdd59869b0f875ad003a19ff680"}},{"ruleId":"D2","level":"warning","message":{"text":"d2oracle.ReconnectEdge (cognitive 72): d2oracle.ReconnectEdge has cognitive complexity 72 (threshold 15). Drivers by points: if/else 62, boolean chains 7, loops 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":"d2oracle/edit.go"},"region":{"startLine":124}}}],"partialFingerprints":{"codehealthFindingId/v1":"6117b919092200b9d34e5cb53f57ad7c5646e721461073c8f778c02f3afb5718"}},{"ruleId":"D2","level":"warning","message":{"text":"parser.parseUnquotedString (cognitive 70): parser.parseUnquotedString has cognitive complexity 70 (threshold 15). Drivers by points: if/else 52, match/switch 12, boolean chains 5, loops 1 (nesting depth added 37). Of this number, 64 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":"d2parser/parse.go"},"region":{"startLine":1068}}}],"partialFingerprints":{"codehealthFindingId/v1":"266f11a082b5546c9014f98466db7279741e329d22d7140491c6251fc611349d"}},{"ruleId":"D2","level":"warning","message":{"text":"Map.createEdge (cognitive 69): Map.createEdge has cognitive complexity 69 (threshold 15). Drivers by points: if/else 52, loops 13, boolean chains 4 (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":"d2ir/d2ir.go"},"region":{"startLine":1272}}}],"partialFingerprints":{"codehealthFindingId/v1":"31281b424137996c52b2985aec5e0d01c442c742decce8e627b1e06be98e5df4"}},{"ruleId":"D2","level":"warning","message":{"text":"d2grid.Layout (cognitive 69): d2grid.Layout has cognitive complexity 69 (threshold 15). Drivers by points: if/else 51, boolean chains 11, match/switch 6, 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":"d2layouts/d2grid/layout.go"},"region":{"startLine":25}}}],"partialFingerprints":{"codehealthFindingId/v1":"9d1aefbf6dca454cbb688a8a46b6d9aa6be254dec1b5cc4f8262cbdb5745acb6"}},{"ruleId":"D2","level":"warning","message":{"text":"d2oracle.deleteObject (cognitive 69): d2oracle.deleteObject has cognitive complexity 69 (threshold 15). Drivers by points: if/else 54, boolean chains 9, loops 6 (nesting depth added 35). Of this number, 68 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":"d2oracle/edit.go"},"region":{"startLine":1525}}}],"partialFingerprints":{"codehealthFindingId/v1":"c40baf0d7c6910d7041b628a6359c2bc46cfb867bdc5d3a3de5ecef7ab976e57"}},{"ruleId":"D2","level":"warning","message":{"text":"d2oracle._updateImport (cognitive 69): d2oracle._updateImport has cognitive complexity 69 (threshold 15). Drivers by points: if/else 67, boolean chains 1, loops 1 (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":"d2oracle/edit.go"},"region":{"startLine":3352}}}],"partialFingerprints":{"codehealthFindingId/v1":"9dd60311c6d70411a29055e42f35ca381bd7bd2b90ec23c634521a8c49dd66f9"}},{"ruleId":"D2","level":"warning","message":{"text":"Canvas.ToByteArray (cognitive 68): Canvas.ToByteArray has cognitive complexity 68 (threshold 15). Drivers by points: if/else 43, loops 18, boolean chains 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":"d2renderers/d2ascii/asciicanvas/asciicanvas.go"},"region":{"startLine":76}}}],"partialFingerprints":{"codehealthFindingId/v1":"080ce313d28516b651cbe4a7098ffc204d943cfb8dca6f03764a8b9c60e31aa4"}},{"ruleId":"D2","level":"warning","message":{"text":"compiler.validateNear (cognitive 66): compiler.validateNear has cognitive complexity 66 (threshold 15). Drivers by points: if/else 54, loops 10, boolean chains 2 (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":"d2compiler/compile.go"},"region":{"startLine":1170}}}],"partialFingerprints":{"codehealthFindingId/v1":"df5de6bb9135b40f1fe75e7caef4ab16667b3ea7323ecefad5738d52ef82f00e"}},{"ruleId":"D2","level":"warning","message":{"text":"d2elklayout.countEdgeIntersects (cognitive 65): d2elklayout.countEdgeIntersects has cognitive complexity 65 (threshold 15). Drivers by points: if/else 62, loops 3 (nesting depth added 50). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2elklayout/layout.go"},"region":{"startLine":900}}}],"partialFingerprints":{"codehealthFindingId/v1":"620a5e23efdfdf0414f98ae71806fc49d6d22a81d5f80289a8bf6e2f4a64f8b7"}},{"ruleId":"D2","level":"warning","message":{"text":"Key.Equals (cognitive 62): Key.Equals has cognitive complexity 62 (threshold 15). Drivers by points: if/else 50, loops 7, boolean chains 5 (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":"d2ast/d2ast.go"},"region":{"startLine":895}}}],"partialFingerprints":{"codehealthFindingId/v1":"8afb04bbdd995f1a28755c5093aa9344e2667f2881be8e8fc423b845d59a859d"}},{"ruleId":"D2","level":"warning","message":{"text":"d2dagrelayout.shiftDown (cognitive 62): d2dagrelayout.shiftDown has cognitive complexity 62 (threshold 15). Drivers by points: if/else 44, loops 14, boolean chains 4 (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":"d2layouts/d2dagrelayout/layout.go"},"region":{"startLine":633}}}],"partialFingerprints":{"codehealthFindingId/v1":"a09f6547ef26e9eb87b5c9eb324cb71f91c9f2f4775e5fa6ecf912fe2f79a197"}},{"ruleId":"D2","level":"warning","message":{"text":"d2dagrelayout.shiftUp (cognitive 62): d2dagrelayout.shiftUp has cognitive complexity 62 (threshold 15). Drivers by points: if/else 44, loops 14, boolean chains 4 (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":"d2layouts/d2dagrelayout/layout.go"},"region":{"startLine":697}}}],"partialFingerprints":{"codehealthFindingId/v1":"cf26384dcd1a11fdddd2db6a1bb4db96164bc3f721fe3ac994702b8a67c7d753"}},{"ruleId":"D2","level":"warning","message":{"text":"d2oracle.deleteReserved (cognitive 62): d2oracle.deleteReserved has cognitive complexity 62 (threshold 15). Drivers by points: if/else 56, boolean chains 5, loops 1 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2oracle/edit.go"},"region":{"startLine":1314}}}],"partialFingerprints":{"codehealthFindingId/v1":"e9e059e10548ef6cdabd6e88ea51d224b933e2eab9dfa2cf8af51ae0f17b6fe5"}},{"ruleId":"D2","level":"warning","message":{"text":"compiler.compileField (cognitive 61): compiler.compileField has cognitive complexity 61 (threshold 15). Drivers by points: if/else 42, boolean chains 11, loops 8 (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":"d2compiler/compile.go"},"region":{"startLine":346}}}],"partialFingerprints":{"codehealthFindingId/v1":"18d627eb607cba3778bb277ce00001fd360a3344f9b4faf1693ec72a10663b6f"}},{"ruleId":"D2","level":"warning","message":{"text":"d2exporter.applyTheme (cognitive 61): d2exporter.applyTheme has cognitive complexity 61 (threshold 15). Drivers by points: if/else 54, boolean chains 7 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2exporter/export.go"},"region":{"startLine":80}}}],"partialFingerprints":{"codehealthFindingId/v1":"c3caf70ae16c1d75cf7cd50398741fb9289769c72ae302cbf3600dab10b47bf5"}},{"ruleId":"D2","level":"warning","message":{"text":"compiler.compilePosition (cognitive 60): compiler.compilePosition has cognitive complexity 60 (threshold 15). Drivers by points: if/else 32, match/switch 25, 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":"d2compiler/compile.go"},"region":{"startLine":478}}}],"partialFingerprints":{"codehealthFindingId/v1":"dbd3e73414cba3aaf0bc806b98985e3111325df389ee063695c6ea84ab7c81d5"}},{"ruleId":"D2","level":"warning","message":{"text":"d2dagrelayout.adjustCrossRankSpacing (cognitive 60): d2dagrelayout.adjustCrossRankSpacing has cognitive complexity 60 (threshold 15). Drivers by points: if/else 43, loops 17 (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":"d2layouts/d2dagrelayout/layout.go"},"region":{"startLine":1261}}}],"partialFingerprints":{"codehealthFindingId/v1":"326e73940eaa018d8458026836ec611e0e785aa73fdd4f09b92c3f8b6cb277f5"}},{"ruleId":"D2","level":"warning","message":{"text":"compiler.compileMap (cognitive 59): compiler.compileMap has cognitive complexity 59 (threshold 15). Drivers by points: if/else 41, loops 14, boolean chains 2, match/switch 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":"d2compiler/compile.go"},"region":{"startLine":274}}}],"partialFingerprints":{"codehealthFindingId/v1":"921c22b9e3b50e1b3712ece934b4cbacb088c2e3f7c7a3e3c42e15e2d1c4f4c3"}},{"ruleId":"D2","level":"warning","message":{"text":"Map.DeleteField (cognitive 58): Map.DeleteField has cognitive complexity 58 (threshold 15). Drivers by points: if/else 29, loops 27, boolean chains 2 (nesting depth added 41). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ir/d2ir.go"},"region":{"startLine":1089}}}],"partialFingerprints":{"codehealthFindingId/v1":"89a67fe91385f61481ccd16de81fa07996b2a6ce7f9f4b04ed968ca21f1a803b"}},{"ruleId":"D2","level":"warning","message":{"text":"ASCIIartist.calculateExtendedBounds (cognitive 58): ASCIIartist.calculateExtendedBounds has cognitive complexity 58 (threshold 15). Drivers by points: if/else 51, loops 4, boolean chains 3 (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":"d2renderers/d2ascii/d2ascii.go"},"region":{"startLine":140}}}],"partialFingerprints":{"codehealthFindingId/v1":"e0a58710747d8ea2cbcc91f03c820f5efe44fbc62083651e3fdfc10a450f09ef"}},{"ruleId":"D2","level":"warning","message":{"text":"Graph.Texts (cognitive 57): Graph.Texts has cognitive complexity 57 (threshold 15). Drivers by points: if/else 27, loops 24, boolean chains 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":"d2graph/d2graph.go"},"region":{"startLine":1697}}}],"partialFingerprints":{"codehealthFindingId/v1":"d66608a776f09ec6476664b4a97841a013f687069c039535db47e2f6916a84ee"}},{"ruleId":"D2","level":"warning","message":{"text":"compiler.IsContainer (cognitive 57): compiler.IsContainer has cognitive complexity 57 (threshold 15). Drivers by points: if/else 41, loops 12, boolean chains 4 (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":"d2ir/d2ir.go"},"region":{"startLine":708}}}],"partialFingerprints":{"codehealthFindingId/v1":"ef70081fd0c1a33816089d95a46d3e9033cb46f44b667632aad410cbf33ae815"}},{"ruleId":"D2","level":"warning","message":{"text":"Diagram.BoundingBox (cognitive 57): Diagram.BoundingBox has cognitive complexity 57 (threshold 15). Drivers by points: if/else 49, boolean chains 4, loops 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":"d2target/d2target.go"},"region":{"startLine":277}}}],"partialFingerprints":{"codehealthFindingId/v1":"8f9056596037cdc5a617e71df09d1887d5de86c114c058b583a27ccb0e98b439"}},{"ruleId":"D2","level":"warning","message":{"text":"d2graph.CompareSerializedObject (cognitive 56): d2graph.CompareSerializedObject has cognitive complexity 56 (threshold 15). Drivers by points: if/else 43, boolean chains 11, loops 2 (nesting depth added 9). 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":"d2graph/serde.go"},"region":{"startLine":211}}}],"partialFingerprints":{"codehealthFindingId/v1":"3ec54f6a4ca238f6c2410f9f7b9450662e0848869026b91e0a6250d72037f000"}},{"ruleId":"D2","level":"warning","message":{"text":"d2dagrelayout.adjustDeltaForEdges (cognitive 55): d2dagrelayout.adjustDeltaForEdges has cognitive complexity 55 (threshold 15). Drivers by points: if/else 50, boolean chains 4, loops 1 (nesting depth added 23). Of this number, 35 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":"d2layouts/d2dagrelayout/layout.go"},"region":{"startLine":1666}}}],"partialFingerprints":{"codehealthFindingId/v1":"41fca2490d4323d5f18a453b188afe046ec37ae7edbc8804152da71aab1fd98a"}},{"ruleId":"D2","level":"warning","message":{"text":"d2exporter.toConnection (cognitive 53): d2exporter.toConnection has cognitive complexity 53 (threshold 15). Drivers by points: if/else 49, boolean chains 3, loops 1 (nesting depth added 12). 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":"d2exporter/export.go"},"region":{"startLine":338}}}],"partialFingerprints":{"codehealthFindingId/v1":"c384adc2f85ac57f6f8d9e3d3f4fc9949cc0e57a1cfc0fa1e0d266185a5024b8"}},{"ruleId":"D2","level":"warning","message":{"text":"d2svg.arrowheadMarker (cognitive 52): d2svg.arrowheadMarker has cognitive complexity 52 (threshold 15). Drivers by points: if/else 48, boolean chains 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":"d2renderers/d2svg/d2svg.go"},"region":{"startLine":454}}}],"partialFingerprints":{"codehealthFindingId/v1":"650fb510f1734ad23e517ccc8ed68f0735f603c7872bad0e8e588a7b0d6a8a85"}},{"ruleId":"D2","level":"warning","message":{"text":"Key.D2OracleEquals (cognitive 51): Key.D2OracleEquals has cognitive complexity 51 (threshold 15). Drivers by points: if/else 40, loops 6, boolean chains 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":"d2ast/d2ast.go"},"region":{"startLine":813}}}],"partialFingerprints":{"codehealthFindingId/v1":"8db811f99221748c8d5396a63471cf3d2f860910d54d8bfc21d91e1a7fcde944"}},{"ruleId":"D2","level":"warning","message":{"text":"utf8FontFile.parseHMTXTable (cognitive 49): utf8FontFile.parseHMTXTable has cognitive complexity 49 (threshold 15). Drivers by points: if/else 38, loops 8, boolean chains 3 (nesting depth added 32). This file\u0027s own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes \u2014 or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/font/subsetFont.go"},"region":{"startLine":582}}}],"partialFingerprints":{"codehealthFindingId/v1":"c6e014583e75c956dc1b255917a5d7be90d25f1d6d65d44cc5308ad2fe555158"}},{"ruleId":"D2","level":"warning","message":{"text":"compiler.extendLinks (cognitive 48): compiler.extendLinks has cognitive complexity 48 (threshold 15). Drivers by points: if/else 36, boolean chains 8, loops 4 (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":"d2ir/compile.go"},"region":{"startLine":1238}}}],"partialFingerprints":{"codehealthFindingId/v1":"a2042ac4bb2a46d7ba59b59c970f4bb081fcae2773968844afc5deae99e0e06c"}},{"ruleId":"D2","level":"warning","message":{"text":"d2svg.dimensions (cognitive 48): d2svg.dimensions has cognitive complexity 48 (threshold 15). Drivers by points: if/else 37, loops 6, boolean chains 5 (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":"d2renderers/d2svg/d2svg.go"},"region":{"startLine":99}}}],"partialFingerprints":{"codehealthFindingId/v1":"6de1f7f820cbaa7b8eb17ba0bae0c7e127cf9c0d29abc2e0818947ff0adff4da"}},{"ruleId":"D2","level":"warning","message":{"text":"Map.getEdges (cognitive 47): Map.getEdges has cognitive complexity 47 (threshold 15). Drivers by points: if/else 34, loops 13 (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":"d2ir/d2ir.go"},"region":{"startLine":1179}}}],"partialFingerprints":{"codehealthFindingId/v1":"1b32d370453070dd0cdab9ed63a3377befaffd8f1a3f64f57a35d81372c36b61"}},{"ruleId":"D2","level":"warning","message":{"text":"d2dagrelayout.adjustEdges (cognitive 47): d2dagrelayout.adjustEdges has cognitive complexity 47 (threshold 15). Drivers by points: if/else 42, boolean chains 4, loops 1 (nesting depth added 22). Most of this is not in the body itself: 5 of the 47 points are its own statements and the rest belongs to one function literal inside it that branches (line 1757). 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":"d2layouts/d2dagrelayout/layout.go"},"region":{"startLine":1756}}}],"partialFingerprints":{"codehealthFindingId/v1":"00e00ee8a06826f50e921a5ac7be33f1a0a7945592c9907f76cc00c6ce7fef75"}},{"ruleId":"D2","level":"warning","message":{"text":"ThemableElement.Render (cognitive 47): ThemableElement.Render has cognitive complexity 47 (threshold 15). Drivers by points: if/else 46, boolean chains 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2themes/element.go"},"region":{"startLine":111}}}],"partialFingerprints":{"codehealthFindingId/v1":"1004132f05371fbe22489d21fc224ab60e1adb3a3f2e2c928993fb6d1ed5b26c"}},{"ruleId":"D2","level":"warning","message":{"text":"d2oracle.ReconnectEdgeIDDeltas (cognitive 45): d2oracle.ReconnectEdgeIDDeltas has cognitive complexity 45 (threshold 15). Drivers by points: if/else 39, boolean chains 4, 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":"d2oracle/edit.go"},"region":{"startLine":2502}}}],"partialFingerprints":{"codehealthFindingId/v1":"fe3baeddf7d18db033a3a7ecab487bb9bb53d4b9ed4c0a68a115e44150b7ad52"}},{"ruleId":"D2","level":"warning","message":{"text":"watcher.watchLoop (cognitive 44): watcher.watchLoop has cognitive complexity 44 (threshold 15). Drivers by points: if/else 31, loops 10, match/switch 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":"d2cli/watch.go"},"region":{"startLine":225}}}],"partialFingerprints":{"codehealthFindingId/v1":"fb27513f1e674a967130f72d56fbe452e9897a37720802c5bae4f1b6c38abb19"}},{"ruleId":"D2","level":"warning","message":{"text":"compiler.validateKey (cognitive 44): compiler.validateKey has cognitive complexity 44 (threshold 15). Drivers by points: if/else 29, boolean chains 11, match/switch 4 (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":"d2compiler/compile.go"},"region":{"startLine":1098}}}],"partialFingerprints":{"codehealthFindingId/v1":"98c6ff4e0bae0cda3afce68f3af484122db06bcb5b3c37b8c95bd4de4bec1668"}},{"ruleId":"D2","level":"warning","message":{"text":"Object.GetDefaultSize (cognitive 44): Object.GetDefaultSize has cognitive complexity 44 (threshold 15). Drivers by points: if/else 37, loops 6, 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":"d2graph/d2graph.go"},"region":{"startLine":995}}}],"partialFingerprints":{"codehealthFindingId/v1":"7db490e3b7e78d07ce0fde67076740faa1b3eb890e35b3136d11145f840be1d6"}},{"ruleId":"D2","level":"warning","message":{"text":"printer._map (cognitive 43): printer._map has cognitive complexity 43 (threshold 15). Drivers by points: if/else 34, boolean chains 7, 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":"d2format/format.go"},"region":{"startLine":287}}}],"partialFingerprints":{"codehealthFindingId/v1":"fc66464fd4dea34764157d6cf55c4338a6916407f2477ef1f8098d4e52e7189a"}},{"ruleId":"D2","level":"warning","message":{"text":"d2sequence.newSequenceDiagram (cognitive 43): d2sequence.newSequenceDiagram has cognitive complexity 43 (threshold 15). Drivers by points: if/else 29, loops 11, match/switch 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":"d2layouts/d2sequence/sequence_diagram.go"},"region":{"startLine":77}}}],"partialFingerprints":{"codehealthFindingId/v1":"8ef6ca45d8349f47886f6ed59889bc224b65d65e22f61d0c3c918642caaf6f36"}},{"ruleId":"D2","level":"warning","message":{"text":"d2plugin.FeatureSupportCheck (cognitive 43): d2plugin.FeatureSupportCheck has cognitive complexity 43 (threshold 15). Drivers by points: if/else 33, boolean chains 6, 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":"d2plugin/plugin_features.go"},"region":{"startLine":27}}}],"partialFingerprints":{"codehealthFindingId/v1":"9a1611d7569c36ef82c20e2f832e3916d419260767b5ed4b60533c697679069e"}},{"ruleId":"D2","level":"warning","message":{"text":"d2oracle.generateUniqueKey (cognitive 40): d2oracle.generateUniqueKey has cognitive complexity 40 (threshold 15). Drivers by points: if/else 32, 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":"d2oracle/edit.go"},"region":{"startLine":2648}}}],"partialFingerprints":{"codehealthFindingId/v1":"e94f4ab9bf71bc2788c837617080a5553bfa716740c8b72828529f995680aebe"}},{"ruleId":"D2","level":"warning","message":{"text":"d2dagrelayout.getLongestEdgeChainHead (cognitive 39): d2dagrelayout.getLongestEdgeChainHead has cognitive complexity 39 (threshold 15). Drivers by points: if/else 26, loops 10, 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":"d2layouts/d2dagrelayout/layout.go"},"region":{"startLine":414}}}],"partialFingerprints":{"codehealthFindingId/v1":"956daf77afabf9484bba5ddd556bdc4ad8d56072ae912ff4039f9714567eeb1b"}},{"ruleId":"D2","level":"warning","message":{"text":"parser.parseMap (cognitive 39): parser.parseMap has cognitive complexity 39 (threshold 15). Drivers by points: if/else 32, loops 3, 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":"d2parser/parse.go"},"region":{"startLine":386}}}],"partialFingerprints":{"codehealthFindingId/v1":"bb97a950cd25c1240add068d4ad1f780bedd3f7d7af244a39e523ee2b4b8ea19"}},{"ruleId":"D2","level":"warning","message":{"text":"asciishapes.DrawPerson (cognitive 39): asciishapes.DrawPerson has cognitive complexity 39 (threshold 15). Drivers by points: if/else 23, boolean chains 10, loops 3, match/switch 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":"d2renderers/d2ascii/asciishapes/person.go"},"region":{"startLine":5}}}],"partialFingerprints":{"codehealthFindingId/v1":"216f38410dc1f90341c5f0971ab1d7beb023d2465e77a2bad87154adcdcece25"}},{"ruleId":"D2","level":"warning","message":{"text":"gridDiagram.getBestLayout (cognitive 38): gridDiagram.getBestLayout has cognitive complexity 38 (threshold 15). Drivers by points: if/else 31, boolean chains 4, loops 3 (nesting depth added 7). Of this number, 24 points are the body\u0027s own statements and 14 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":"d2layouts/d2grid/layout.go"},"region":{"startLine":550}}}],"partialFingerprints":{"codehealthFindingId/v1":"12887060e918d1428f99dd9ee75c2047bcaca9a499b9aa336ca814ef1b61cb41"}},{"ruleId":"D2","level":"warning","message":{"text":"d2cli.renderPPTX (cognitive 37): d2cli.renderPPTX has cognitive complexity 37 (threshold 15). Drivers by points: if/else 31, 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":"d2cli/main.go"},"region":{"startLine":1133}}}],"partialFingerprints":{"codehealthFindingId/v1":"4308801455b8f46af67ac65dc87d00955b3f4a0c49ecf7cf3437f4860345518f"}},{"ruleId":"D2","level":"warning","message":{"text":"d2compiler.compileConfig (cognitive 37): d2compiler.compileConfig has cognitive complexity 37 (threshold 15). Drivers by points: if/else 18, match/switch 10, loops 7, boolean chains 2 (nesting depth added 17). 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":"d2compiler/compile.go"},"region":{"startLine":1505}}}],"partialFingerprints":{"codehealthFindingId/v1":"90951f009473e059cbe8d90676b48fb13bd73a77ea39fd5362817f7a05b43963"}},{"ruleId":"D2","level":"warning","message":{"text":"compiler.compileSubstitutions (cognitive 37): compiler.compileSubstitutions has cognitive complexity 37 (threshold 15). Drivers by points: if/else 29, loops 6, 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":"d2ir/compile.go"},"region":{"startLine":127}}}],"partialFingerprints":{"codehealthFindingId/v1":"6a6f3625094a63fef7561a6d0fef23d28640ef0b9d10b4863dc2e720f8008903"}},{"ruleId":"D2","level":"warning","message":{"text":"gridDiagram.layoutEvenly (cognitive 37): gridDiagram.layoutEvenly has cognitive complexity 37 (threshold 15). Drivers by points: if/else 19, loops 18 (nesting depth added 18). 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":"d2layouts/d2grid/layout.go"},"region":{"startLine":232}}}],"partialFingerprints":{"codehealthFindingId/v1":"bfe3e59cfa411e9fa12738c728afd8b52d1ed11bca86139f0f8fc657bba9bd4d"}},{"ruleId":"D2","level":"warning","message":{"text":"d2near.Layout (cognitive 37): d2near.Layout has cognitive complexity 37 (threshold 15). Drivers by points: loops 21, if/else 16 (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":"d2layouts/d2near/layout.go"},"region":{"startLine":35}}}],"partialFingerprints":{"codehealthFindingId/v1":"38580b39695f79353371e0f20ac8f965714f4da547a99034eb0036cb521f1ff6"}},{"ruleId":"D2","level":"warning","message":{"text":"ASCIIartist.Render (cognitive 37): ASCIIartist.Render has cognitive complexity 37 (threshold 15). Drivers by points: if/else 19, loops 9, match/switch 5, 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":"d2renderers/d2ascii/d2ascii.go"},"region":{"startLine":222}}}],"partialFingerprints":{"codehealthFindingId/v1":"190f6c747f8efb02667f36daf28e80662f160a0d2a2740f85a1dfa84deb49ceb"}},{"ruleId":"D2","level":"warning","message":{"text":"utf8FontFile.GenerateCutFont (cognitive 37): utf8FontFile.GenerateCutFont has cognitive complexity 37 (threshold 15). Drivers by points: if/else 28, loops 8, boolean chains 1 (nesting depth added 19). This file\u0027s own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes \u2014 or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/font/subsetFont.go"},"region":{"startLine":387}}}],"partialFingerprints":{"codehealthFindingId/v1":"cfcc4be086ba5f0c5eb2c99a8fe4e83806ca9e2f97aae811e6d29224182f6412"}},{"ruleId":"D2","level":"warning","message":{"text":"Graph.IDA (cognitive 36): Graph.IDA has cognitive complexity 36 (threshold 15). Drivers by points: if/else 25, loops 11 (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":"d2graph/d2graph.go"},"region":{"startLine":94}}}],"partialFingerprints":{"codehealthFindingId/v1":"7eb7512198feea34964463668e778369135882a42890867969a69451ef5fedc9"}},{"ruleId":"D2","level":"warning","message":{"text":"Object.GetFill (cognitive 36): Object.GetFill has cognitive complexity 36 (threshold 15). Drivers by points: if/else 29, boolean chains 7 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2graph/d2graph.go"},"region":{"startLine":512}}}],"partialFingerprints":{"codehealthFindingId/v1":"e31416de458b09764631e48c4476bf97588ce4825b76e20c687d36f575a1cfa1"}},{"ruleId":"D2","level":"warning","message":{"text":"d2oracle.deleteMapField (cognitive 36): d2oracle.deleteMapField has cognitive complexity 36 (threshold 15). Drivers by points: if/else 32, 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":"d2oracle/edit.go"},"region":{"startLine":1419}}}],"partialFingerprints":{"codehealthFindingId/v1":"aa4c5e5dfcc8941e933ecc6b45132adbce932190d14eab2493a5fe267bb0fdef"}},{"ruleId":"D2","level":"warning","message":{"text":"asciishapes.DrawCylinder (cognitive 36): asciishapes.DrawCylinder has cognitive complexity 36 (threshold 15). Drivers by points: if/else 21, boolean chains 9, loops 3, match/switch 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":"d2renderers/d2ascii/asciishapes/cylinder.go"},"region":{"startLine":3}}}],"partialFingerprints":{"codehealthFindingId/v1":"5200e3ed33ffafb770061caddaba42851e6037c6d55d0f2aae389d6c14254801"}},{"ruleId":"D2","level":"warning","message":{"text":"Map.FindBoardRoot (cognitive 35): Map.FindBoardRoot has cognitive complexity 35 (threshold 15). Drivers by points: if/else 26, loops 6, 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":"d2ir/d2ir.go"},"region":{"startLine":1937}}}],"partialFingerprints":{"codehealthFindingId/v1":"0b95ca6cfa3c2587eeeda22bf27421392b7492bbcdad0ec592a5ffc232e8531c"}},{"ruleId":"D2","level":"warning","message":{"text":"asciiroute.drawConnectionLabel (cognitive 35): asciiroute.drawConnectionLabel has cognitive complexity 35 (threshold 15). Drivers by points: if/else 22, loops 13 (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":"d2renderers/d2ascii/asciiroute/labels.go"},"region":{"startLine":87}}}],"partialFingerprints":{"codehealthFindingId/v1":"d61ba49114590e3607c219f35a8bc0ca4dba9ac9462552175ac899f0dcd70999"}},{"ruleId":"D2","level":"warning","message":{"text":"Diagram.GetCorpus (cognitive 35): Diagram.GetCorpus has cognitive complexity 35 (threshold 15). Drivers by points: loops 19, if/else 16 (nesting depth added 18). 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":"d2target/d2target.go"},"region":{"startLine":506}}}],"partialFingerprints":{"codehealthFindingId/v1":"1344207f66cfb3d01b6ce2a19459babe805a8e766cd11ba5f4f34c6174e03526"}},{"ruleId":"D2","level":"warning","message":{"text":"d2cli.loadFonts (cognitive 34): d2cli.loadFonts has cognitive complexity 34 (threshold 15). Drivers by points: if/else 31, 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":"d2cli/main.go"},"region":{"startLine":1320}}}],"partialFingerprints":{"codehealthFindingId/v1":"e41a8afcc898412733ea79013e31a6c4799ac551f1049a919a86a999a0326ba6"}},{"ruleId":"D2","level":"warning","message":{"text":"Diagram.GetBoard (cognitive 34): Diagram.GetBoard has cognitive complexity 34 (threshold 15). Drivers by points: if/else 23, loops 9, boolean chains 1, 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":"d2target/d2target.go"},"region":{"startLine":106}}}],"partialFingerprints":{"codehealthFindingId/v1":"e4e33d58581b7910da9f4f9191595482ddebabbdaea94d85aead98ce8d692c31"}},{"ruleId":"D2","level":"warning","message":{"text":"d2cli._render (cognitive 33): d2cli._render has cognitive complexity 33 (threshold 15). Drivers by points: if/else 29, boolean chains 2, 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":"d2cli/main.go"},"region":{"startLine":909}}}],"partialFingerprints":{"codehealthFindingId/v1":"94c5800eca2a0926756f3e93b5269258df74dc41df10dbc7a7270a64beffdf5f"}},{"ruleId":"D2","level":"warning","message":{"text":"Map.createEdge2 (cognitive 33): Map.createEdge2 has cognitive complexity 33 (threshold 15). Drivers by points: if/else 26, 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":"d2ir/d2ir.go"},"region":{"startLine":1383}}}],"partialFingerprints":{"codehealthFindingId/v1":"1f96ec58f884aa3ac855a8a14de1c96a7ab14386dcfe4c15f3eaec05e1ed25fd"}},{"ruleId":"D2","level":"warning","message":{"text":"d2format.escapeUnquotedValue (cognitive 32): d2format.escapeUnquotedValue has cognitive complexity 32 (threshold 15). Drivers by points: if/else 24, match/switch 6, 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":"d2format/escape.go"},"region":{"startLine":45}}}],"partialFingerprints":{"codehealthFindingId/v1":"0e97a2a7561d236687b0586b951fb7fb70fbf7a3f82bba186c175ffff659d3ba"}},{"ruleId":"D2","level":"warning","message":{"text":"d2graph.GetTextDimensionsWithMono (cognitive 32): d2graph.GetTextDimensionsWithMono 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":"d2graph/d2graph.go"},"region":{"startLine":1441}}}],"partialFingerprints":{"codehealthFindingId/v1":"b3045608a1a644d200a2afda5234cb3cb071f361814c10315202bafd67fc88d3"}},{"ruleId":"D2","level":"warning","message":{"text":"d2dagrelayout.getLongestEdgeChainTail (cognitive 32): d2dagrelayout.getLongestEdgeChainTail has cognitive complexity 32 (threshold 15). Drivers by points: if/else 20, 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":"d2layouts/d2dagrelayout/layout.go"},"region":{"startLine":479}}}],"partialFingerprints":{"codehealthFindingId/v1":"874b4972ef448e1807b5bbfc4d7ac0ee4229a3fd7bf12ced8e4fd2a2333b54fe"}},{"ruleId":"D2","level":"warning","message":{"text":"d2near.boundingBox (cognitive 32): d2near.boundingBox has cognitive complexity 32 (threshold 15). Drivers by points: if/else 20, loops 5, boolean chains 4, match/switch 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":"d2layouts/d2near/layout.go"},"region":{"startLine":151}}}],"partialFingerprints":{"codehealthFindingId/v1":"8d0af3778cfe67fe3bb579a1be8c00ba81f18e305f6683a4c0e7b4874ce20267"}},{"ruleId":"D2","level":"warning","message":{"text":"asciishapes.DrawStoredData (cognitive 32): asciishapes.DrawStoredData has cognitive complexity 32 (threshold 15). Drivers by points: if/else 20, boolean chains 6, loops 3, match/switch 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":"d2renderers/d2ascii/asciishapes/stored_data.go"},"region":{"startLine":7}}}],"partialFingerprints":{"codehealthFindingId/v1":"87407d66c718eead23eae96e17863c840e40971401d4202bc106fd318d0ffd19"}},{"ruleId":"D2","level":"warning","message":{"text":"d2ast.RawString (cognitive 31): d2ast.RawString has cognitive complexity 31 (threshold 15). Drivers by points: if/else 23, boolean chains 3, match/switch 3, 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":"d2ast/d2ast.go"},"region":{"startLine":1563}}}],"partialFingerprints":{"codehealthFindingId/v1":"0f566986c3c05d2cf64d881ddfc879f3f6455a01f92765e30728bf3cd3a8c03b"}},{"ruleId":"D2","level":"warning","message":{"text":"d2cli.renderPDF (cognitive 31): d2cli.renderPDF has cognitive complexity 31 (threshold 15). Drivers by points: if/else 28, 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":"d2cli/main.go"},"region":{"startLine":1021}}}],"partialFingerprints":{"codehealthFindingId/v1":"8d37bb78ec786d48200afe6056cfb1c58bb80816fcadf7233b3459250449a142"}},{"ruleId":"D2","level":"warning","message":{"text":"Object.ShiftDescendants (cognitive 31): Object.ShiftDescendants has cognitive complexity 31 (threshold 15). Drivers by points: if/else 20, loops 8, boolean chains 3 (nesting depth added 12). Most of this is not in the body itself: 7 of the 31 points are its own statements and the rest belongs to one function literal inside it that branches (line 119). 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":"d2graph/layout.go"},"region":{"startLine":103}}}],"partialFingerprints":{"codehealthFindingId/v1":"019bbbbe88a67bc8117659f84ef2f8e7a733d251704a821fdb4392dadb456a34"}},{"ruleId":"D2","level":"warning","message":{"text":"parser.parseKey (cognitive 31): parser.parseKey has cognitive complexity 31 (threshold 15). Drivers by points: if/else 25, boolean chains 3, loops 3 (nesting depth added 14). Of this number, 20 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":"d2parser/parse.go"},"region":{"startLine":974}}}],"partialFingerprints":{"codehealthFindingId/v1":"3324cdf0d7ead68e3cba6fe1a29e5a356db632758042605dac3d285dcd8486ee"}},{"ruleId":"D2","level":"warning","message":{"text":"d2svg.RenderLegend (cognitive 31): d2svg.RenderLegend has cognitive complexity 31 (threshold 15). Drivers by points: if/else 22, boolean chains 5, 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":"d2renderers/d2svg/d2svg.go"},"region":{"startLine":181}}}],"partialFingerprints":{"codehealthFindingId/v1":"560867fd00e147fc38ecf8617cc6429a0fb0c24cffa18f8fbfe780cde28c47ad"}},{"ruleId":"D2","level":"warning","message":{"text":"d2exporter.toPrettyLink (cognitive 30): d2exporter.toPrettyLink has cognitive complexity 30 (threshold 15). Drivers by points: if/else 18, loops 6, match/switch 4, boolean chains 1, jumps 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":"d2exporter/export.go"},"region":{"startLine":294}}}],"partialFingerprints":{"codehealthFindingId/v1":"b4615ead0d86f373403ec93e875a09777c0feba77623153cec6b4143def36d1a"}},{"ruleId":"D2","level":"warning","message":{"text":"printer.mapKey (cognitive 30): printer.mapKey has cognitive complexity 30 (threshold 15). Drivers by points: if/else 25, 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":"d2format/format.go"},"region":{"startLine":367}}}],"partialFingerprints":{"codehealthFindingId/v1":"2a4620ff3f208f17cf80b48f8628e7e0e09f9e9ce9497e7ab00e762ef5100dc4"}},{"ruleId":"D2","level":"warning","message":{"text":"sequenceDiagram.placeGroup (cognitive 30): sequenceDiagram.placeGroup has cognitive complexity 30 (threshold 15). Drivers by points: if/else 17, loops 13 (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":"d2layouts/d2sequence/sequence_diagram.go"},"region":{"startLine":245}}}],"partialFingerprints":{"codehealthFindingId/v1":"b9def1c4b9bb86ffbb3261dff0f4b044a4888f607eb18283aaa0e02e36efc3d0"}},{"ruleId":"D2","level":"warning","message":{"text":"d2oracle.filterReserved (cognitive 30): d2oracle.filterReserved has cognitive complexity 30 (threshold 15). Drivers by points: if/else 26, 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":"d2oracle/edit.go"},"region":{"startLine":2266}}}],"partialFingerprints":{"codehealthFindingId/v1":"bb1c400c17c4ad981961ae4ca251c95c074adbfc2c83425eaae0d57b276509ad"}},{"ruleId":"D2","level":"warning","message":{"text":"Segment.GetBounds (cognitive 30): Segment.GetBounds 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":"lib/geo/segment.go"},"region":{"startLine":81}}}],"partialFingerprints":{"codehealthFindingId/v1":"c3f6e997942dea4ced462e9ed35785dd57d5eb81263ecb8409f984065b884925"}},{"ruleId":"D2","level":"warning","message":{"text":"sequenceDiagram.placeActors (cognitive 29): sequenceDiagram.placeActors has cognitive complexity 29 (threshold 15). Drivers by points: if/else 27, 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":"d2layouts/d2sequence/sequence_diagram.go"},"region":{"startLine":362}}}],"partialFingerprints":{"codehealthFindingId/v1":"57084ddea75d1d0d283e082d25e67a97210f4b420e902bf2cb5ca0bc0a62d2b1"}},{"ruleId":"D2","level":"warning","message":{"text":"d2oracle.RenameIDDeltas (cognitive 29): d2oracle.RenameIDDeltas has cognitive complexity 29 (threshold 15). Drivers by points: if/else 26, loops 2, boolean chains 1 (nesting depth added 9). Of this number, 20 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":"d2oracle/edit.go"},"region":{"startLine":3161}}}],"partialFingerprints":{"codehealthFindingId/v1":"a100a96584609d4a8d14384a8ad2bb300ac8d580f36b3ec494c365a13fe3d88c"}},{"ruleId":"D2","level":"warning","message":{"text":"parser.parseBlockString (cognitive 29): parser.parseBlockString has cognitive complexity 29 (threshold 15). Drivers by points: if/else 24, 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":"d2parser/parse.go"},"region":{"startLine":1397}}}],"partialFingerprints":{"codehealthFindingId/v1":"c6ca4294a41cdc55a1975c4a348be6a6fd81df453d88fd06121b451d0873726b"}},{"ruleId":"D2","level":"warning","message":{"text":"geo.cubicRoots (cognitive 29): geo.cubicRoots has cognitive complexity 29 (threshold 15). Drivers by points: if/else 19, 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":"lib/geo/bezier.go"},"region":{"startLine":177}}}],"partialFingerprints":{"codehealthFindingId/v1":"131e9438de0b814905657c4cc7ff51ed81cee13fe6b851e91ec91700f5e2332e"}},{"ruleId":"D2","level":"warning","message":{"text":"GoFPDF.AddPDFPage (cognitive 29): GoFPDF.AddPDFPage has cognitive complexity 29 (threshold 15). Drivers by points: if/else 23, 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":"lib/pdf/pdf.go"},"region":{"startLine":69}}}],"partialFingerprints":{"codehealthFindingId/v1":"6513c649da1f922c8d0d059caad4186f5ccab08b25bd232ea056d77c91eb0f3b"}},{"ruleId":"D2","level":"warning","message":{"text":"compiler.validateConfigs (cognitive 28): compiler.validateConfigs has cognitive complexity 28 (threshold 15). Drivers by points: if/else 23, boolean chains 2, match/switch 2, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ir/compile.go"},"region":{"startLine":172}}}],"partialFingerprints":{"codehealthFindingId/v1":"934254b9dbb05d73c54dd164313691e80370f98ebc49f00feca6c2676271bd77"}},{"ruleId":"D2","level":"warning","message":{"text":"d2layouts.ExtractSubgraph (cognitive 28): d2layouts.ExtractSubgraph has cognitive complexity 28 (threshold 15). Drivers by points: if/else 19, loops 7, boolean chains 2 (nesting depth added 8). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2layouts.go"},"region":{"startLine":375}}}],"partialFingerprints":{"codehealthFindingId/v1":"14d519aa02efa5a4a322e8b3ffb8f25a0886879ce1b323093f54ab21e8c26d96"}},{"ruleId":"D2","level":"warning","message":{"text":"d2lsp.GetRefRanges (cognitive 28): d2lsp.GetRefRanges has cognitive complexity 28 (threshold 15). Drivers by points: if/else 16, loops 11, 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":"d2lsp/d2lsp.go"},"region":{"startLine":14}}}],"partialFingerprints":{"codehealthFindingId/v1":"2a9691f12d820f93dacad8646cf01928691b16937ca42c294e36401fe60cc8b5"}},{"ruleId":"D2","level":"warning","message":{"text":"watcher.compileLoop (cognitive 27): watcher.compileLoop has cognitive complexity 27 (threshold 15). Drivers by points: if/else 22, boolean chains 2, match/switch 2, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2cli/watch.go"},"region":{"startLine":414}}}],"partialFingerprints":{"codehealthFindingId/v1":"048ba0044afb1b4a5c5bbfbfc6c5df779b260ab0ca1f55aa5e9ff948b63ce27f"}},{"ruleId":"D2","level":"warning","message":{"text":"compiler.compileArray (cognitive 27): compiler.compileArray has cognitive complexity 27 (threshold 15). Drivers by points: if/else 21, match/switch 5, 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":"d2ir/compile.go"},"region":{"startLine":1571}}}],"partialFingerprints":{"codehealthFindingId/v1":"e41aacdfc8882f840ab7c2960cae24d1bc7d84cb142bb6c099d89cf025439fe7"}},{"ruleId":"D2","level":"warning","message":{"text":"compiler.compileEdgeMap (cognitive 26): compiler.compileEdgeMap has cognitive complexity 26 (threshold 15). Drivers by points: if/else 18, loops 7, 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":"d2compiler/compile.go"},"region":{"startLine":888}}}],"partialFingerprints":{"codehealthFindingId/v1":"e77bfe1d32e8873a6990add64234e07cfc690f1ec9b817a3c8faa81d2abc16de"}},{"ruleId":"D2","level":"warning","message":{"text":"compiler.validatePositionsCompatibility (cognitive 26): compiler.validatePositionsCompatibility has cognitive complexity 26 (threshold 15). Drivers by points: if/else 22, loops 3, 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":"d2compiler/compile.go"},"region":{"startLine":1243}}}],"partialFingerprints":{"codehealthFindingId/v1":"d87c6d81f23914ac28a883603aa4d47b4104359350ff30517446a52765383d72"}},{"ruleId":"D2","level":"warning","message":{"text":"xgif.AnimatePNGs (cognitive 26): xgif.AnimatePNGs has cognitive complexity 26 (threshold 15). Drivers by points: if/else 18, loops 7, boolean chains 1 (nesting depth added 11). Most of this is not in the body itself: 6 of the 26 points are its own statements and the rest belongs to one function literal inside it that branches (line 126). 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":"lib/xgif/xgif.go"},"region":{"startLine":95}}}],"partialFingerprints":{"codehealthFindingId/v1":"95aaa42fb4cf95726850a88ebb25fb5001730c5a89c8c4bd5c02b9dff334f4b7"}},{"ruleId":"D2","level":"warning","message":{"text":"d2cli.fmtCmd (cognitive 25): d2cli.fmtCmd has cognitive complexity 25 (threshold 15). Drivers by points: if/else 23, 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":"d2cli/fmt.go"},"region":{"startLine":18}}}],"partialFingerprints":{"codehealthFindingId/v1":"2ebc4fb413820243a7b45e6e72c09e7e322b9164268acce21ca22f3102e72250"}},{"ruleId":"D2","level":"warning","message":{"text":"d2cli.render (cognitive 25): d2cli.render has cognitive complexity 25 (threshold 15). Drivers by points: if/else 18, boolean chains 4, 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":"d2cli/main.go"},"region":{"startLine":813}}}],"partialFingerprints":{"codehealthFindingId/v1":"78cc8ba464565967eeacc77ab7acc5b8f8e38885869b430dedd84cdd1cdb7d7e"}},{"ruleId":"D2","level":"warning","message":{"text":"Map.QueryAll (cognitive 25): Map.QueryAll has cognitive complexity 25 (threshold 15). Drivers by points: if/else 20, 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":"d2ir/query.go"},"region":{"startLine":10}}}],"partialFingerprints":{"codehealthFindingId/v1":"0f5d0422d839964704cabf951d12f5c81c32b3e7d6542955cac7df5dc3781ace"}},{"ruleId":"D2","level":"warning","message":{"text":"d2dagrelayout.getRanks (cognitive 25): d2dagrelayout.getRanks has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14, loops 8, 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":"d2layouts/d2dagrelayout/layout.go"},"region":{"startLine":580}}}],"partialFingerprints":{"codehealthFindingId/v1":"b137bc65497b1ec3dc471bf9bc750ead3113e3ac3552c047e3ba88791605c0f2"}},{"ruleId":"D2","level":"warning","message":{"text":"sequenceDiagram.adjustGroupLabel (cognitive 25): sequenceDiagram.adjustGroupLabel has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14, 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":"d2layouts/d2sequence/sequence_diagram.go"},"region":{"startLine":312}}}],"partialFingerprints":{"codehealthFindingId/v1":"812c0c79d2d0b28e53eabbd3a0c2a60116fc19a5c59d09b5b857e732075a3aac"}},{"ruleId":"D2","level":"warning","message":{"text":"d2cli.resolveLinks (cognitive 24): d2cli.resolveLinks has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11, loops 9, 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":"d2cli/main.go"},"region":{"startLine":706}}}],"partialFingerprints":{"codehealthFindingId/v1":"79ee7cdbd58f9c96c740f1dc888e11d71bcc5be7b81a8b4330ab30d75691dd0f"}},{"ruleId":"D2","level":"warning","message":{"text":"d2cli.relink (cognitive 24): d2cli.relink has cognitive complexity 24 (threshold 15). Drivers by points: if/else 17, 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":"d2cli/main.go"},"region":{"startLine":777}}}],"partialFingerprints":{"codehealthFindingId/v1":"3ddc37ec7d3918759524a8441252414c5f1b772d6f05861a0d0eceb3c025dec8"}},{"ruleId":"D2","level":"warning","message":{"text":"compiler.preprocessEdgeGroup (cognitive 24): compiler.preprocessEdgeGroup has cognitive complexity 24 (threshold 15). Drivers by points: if/else 16, 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":"d2compiler/compile.go"},"region":{"startLine":1394}}}],"partialFingerprints":{"codehealthFindingId/v1":"a9f5c0f16c906b3e1fd94f4d43783d76cafbcdcc24f35b1c8b39f8b2b769ad78"}},{"ruleId":"D2","level":"warning","message":{"text":"d2graph.ResolveUnderscoreKey (cognitive 24): d2graph.ResolveUnderscoreKey has cognitive complexity 24 (threshold 15). Drivers by points: if/else 18, 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":"d2graph/d2graph.go"},"region":{"startLine":779}}}],"partialFingerprints":{"codehealthFindingId/v1":"2bd7f362536e8569b8e192ff3c40396ec2eae1e78995c42e73e8fc4114f04db4"}},{"ruleId":"D2","level":"warning","message":{"text":"d2dagrelayout.positionLabelsIcons (cognitive 24): d2dagrelayout.positionLabelsIcons has cognitive complexity 24 (threshold 15). Drivers by points: if/else 20, 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":"d2layouts/d2dagrelayout/layout.go"},"region":{"startLine":546}}}],"partialFingerprints":{"codehealthFindingId/v1":"a10fe794392b95e73086daad54822ec781f591b838538d08623baf1e07176913"}},{"ruleId":"D2","level":"warning","message":{"text":"d2elklayout.positionLabelsIcons (cognitive 24): d2elklayout.positionLabelsIcons has cognitive complexity 24 (threshold 15). Drivers by points: if/else 20, 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":"d2layouts/d2elklayout/layout.go"},"region":{"startLine":1110}}}],"partialFingerprints":{"codehealthFindingId/v1":"46cb5f4a96702e9cfdc1fbb21c24b4b828c87f183762f32690249584950a2568"}},{"ruleId":"D2","level":"warning","message":{"text":"d2grid.layoutGrid (cognitive 24): d2grid.layoutGrid has cognitive complexity 24 (threshold 15). Drivers by points: if/else 20, 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":"d2layouts/d2grid/layout.go"},"region":{"startLine":186}}}],"partialFingerprints":{"codehealthFindingId/v1":"76a503a027f810a0fba8646b1634e0ece8f85278285386cd84a588efe3799609"}},{"ruleId":"D2","level":"warning","message":{"text":"sequenceDiagram.placeSpans (cognitive 24): sequenceDiagram.placeSpans has cognitive complexity 24 (threshold 15). Drivers by points: if/else 16, boolean chains 4, 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":"d2layouts/d2sequence/sequence_diagram.go"},"region":{"startLine":517}}}],"partialFingerprints":{"codehealthFindingId/v1":"18bf3c657856b80733835ce0b4122c1b0f5f18bd3fa3d6765d70fd5e3cd8ab30"}},{"ruleId":"D2","level":"warning","message":{"text":"d2lsp.getBoardPathAtPosition (cognitive 24): d2lsp.getBoardPathAtPosition has cognitive complexity 24 (threshold 15). Drivers by points: if/else 20, boolean chains 3, loops 1 (nesting depth added 11). Of this number, 23 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2lsp/d2lsp.go"},"region":{"startLine":107}}}],"partialFingerprints":{"codehealthFindingId/v1":"05247b8d8e55a962e19b3b4fe69dfcd2215674ad623a86cbcd4d9891696f96de"}},{"ruleId":"D2","level":"warning","message":{"text":"d2oracle.ensureNode (cognitive 24): d2oracle.ensureNode has cognitive complexity 24 (threshold 15). Drivers by points: if/else 18, boolean chains 3, 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":"d2oracle/edit.go"},"region":{"startLine":1654}}}],"partialFingerprints":{"codehealthFindingId/v1":"9b8fc2a839a4ccc1a3e612ec2b83e9187c665b4ee2ecd82003bcf1fd84d44650"}},{"ruleId":"D2","level":"warning","message":{"text":"parser.parseDoubleQuotedString (cognitive 24): parser.parseDoubleQuotedString has cognitive complexity 24 (threshold 15). Drivers by points: if/else 22, boolean chains 1, loops 1 (nesting depth added 12). Of this number, 23 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2parser/parse.go"},"region":{"startLine":1264}}}],"partialFingerprints":{"codehealthFindingId/v1":"d302c8f4b5cb047e666139d6efaaa7e7bfeffe910f713d083677305ab2aae1bf"}},{"ruleId":"D2","level":"warning","message":{"text":"d2sketch.Arrowheads (cognitive 24): d2sketch.Arrowheads 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":"d2renderers/d2sketch/sketch.go"},"region":{"startLine":930}}}],"partialFingerprints":{"codehealthFindingId/v1":"d0c4134326f9a4a0fb7902eb309904c0f694606354ff51772f555ac91bf76871"}},{"ruleId":"D2","level":"warning","message":{"text":"d2svg.addAppendixItems (cognitive 24): d2svg.addAppendixItems has cognitive complexity 24 (threshold 15). Drivers by points: if/else 20, boolean chains 2, 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":"d2renderers/d2svg/d2svg.go"},"region":{"startLine":2223}}}],"partialFingerprints":{"codehealthFindingId/v1":"779cd5447750c62ce774748b02aaf0636c50bece23a2177ac0769739707e6e86"}},{"ruleId":"D2","level":"warning","message":{"text":"utf8FontFile.generateSCCSDictionaries (cognitive 24): utf8FontFile.generateSCCSDictionaries has cognitive complexity 24 (threshold 15). Drivers by points: if/else 17, loops 7 (nesting depth added 12). This file\u0027s own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes \u2014 or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/font/subsetFont.go"},"region":{"startLine":672}}}],"partialFingerprints":{"codehealthFindingId/v1":"ad634c5dda5370949e28d46bda8bd29833cd703d61928d9797238d7261c7dc21"}},{"ruleId":"D2","level":"warning","message":{"text":"pptx.Validate (cognitive 24): pptx.Validate has cognitive complexity 24 (threshold 15). Drivers by points: if/else 22, 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":"lib/pptx/validate.go"},"region":{"startLine":13}}}],"partialFingerprints":{"codehealthFindingId/v1":"c724487d5e40b1a16a5b6185728f4ef51d240ca436eae1da226f39c84567d7dd"}},{"ruleId":"D2","level":"warning","message":{"text":"compiler.compileClass (cognitive 23): compiler.compileClass has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14, loops 4, match/switch 3, boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2compiler/compile.go"},"region":{"startLine":1000}}}],"partialFingerprints":{"codehealthFindingId/v1":"faebd0d9ef713fd24cc2091a08f3c4e9fef87dd6d8f8a2bec483d90e7664825a"}},{"ruleId":"D2","level":"warning","message":{"text":"d2graph.addSQLTableColumnIndices (cognitive 22): d2graph.addSQLTableColumnIndices has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16, 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":"d2graph/d2graph.go"},"region":{"startLine":1347}}}],"partialFingerprints":{"codehealthFindingId/v1":"bbbc43885af77257f92076ca73d685f4ae6ffb6794ad9b6e4fbdc534f86e934c"}},{"ruleId":"D2","level":"warning","message":{"text":"d2graph.CompareSerializedEdge (cognitive 22): d2graph.CompareSerializedEdge has cognitive complexity 22 (threshold 15). Drivers by points: if/else 18, 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":"d2graph/serde.go"},"region":{"startLine":357}}}],"partialFingerprints":{"codehealthFindingId/v1":"5aed4158c02d8e986d4faf2a4f865f32c3a57d28b14b7464f1a2a1811c159a36"}},{"ruleId":"D2","level":"warning","message":{"text":"compiler.ampersandFilterMap (cognitive 22): compiler.ampersandFilterMap 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":"d2ir/compile.go"},"region":{"startLine":465}}}],"partialFingerprints":{"codehealthFindingId/v1":"d0418ea410023b19d953af8a734de984824470984fb0bf3943f942bb1767bbd9"}},{"ruleId":"D2","level":"warning","message":{"text":"d2grid.newGridDiagram (cognitive 22): d2grid.newGridDiagram has cognitive complexity 22 (threshold 15). Drivers by points: if/else 18, 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":"d2layouts/d2grid/grid_diagram.go"},"region":{"startLine":28}}}],"partialFingerprints":{"codehealthFindingId/v1":"24c7a24373376e26d793e6eca74915fdfab8a969a39fcaa0256aa35707048084"}},{"ruleId":"D2","level":"warning","message":{"text":"sequenceDiagram.routeMessages (cognitive 22): sequenceDiagram.routeMessages has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14, 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":"d2layouts/d2sequence/sequence_diagram.go"},"region":{"startLine":582}}}],"partialFingerprints":{"codehealthFindingId/v1":"0e6c6f30860f50a178fe3af5f6449da7fb85d03686f5ff7f3c630d8ef6228b09"}},{"ruleId":"D2","level":"warning","message":{"text":"d2oracle.deleteObjField (cognitive 22): d2oracle.deleteObjField has cognitive complexity 22 (threshold 15). Drivers by points: if/else 17, 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":"d2oracle/edit.go"},"region":{"startLine":1478}}}],"partialFingerprints":{"codehealthFindingId/v1":"d6975d3bbe70ab42fc7c39870fc42b07e103480768caf16bc6977245acc03a7e"}},{"ruleId":"D2","level":"warning","message":{"text":"asciishapes.DrawDocument (cognitive 22): asciishapes.DrawDocument has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13, boolean chains 5, 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":"d2renderers/d2ascii/asciishapes/document.go"},"region":{"startLine":5}}}],"partialFingerprints":{"codehealthFindingId/v1":"c88df9d0775fb22f1f8affa55fa5ff4a6f41a0c8145f403073c74093920c0a48"}},{"ruleId":"D2","level":"warning","message":{"text":"dslGenState.edge (cognitive 21): dslGenState.edge 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":"d2chaos/d2chaos.go"},"region":{"startLine":127}}}],"partialFingerprints":{"codehealthFindingId/v1":"f177eff5e6cee770e9527b77befe09680c9865962866ae4afc9f5d9e7ce43df8"}},{"ruleId":"D2","level":"warning","message":{"text":"d2cli.renderPNGsForGIF (cognitive 21): d2cli.renderPNGsForGIF has cognitive complexity 21 (threshold 15). Drivers by points: if/else 18, 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":"d2cli/main.go"},"region":{"startLine":1435}}}],"partialFingerprints":{"codehealthFindingId/v1":"c2e7d0a653b0ba694da9c193727eb2a8419a80c09a9acc40196e8894d243fa90"}},{"ruleId":"D2","level":"warning","message":{"text":"watcher.replaceWatchList (cognitive 21): watcher.replaceWatchList has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15, 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":"d2cli/watch.go"},"region":{"startLine":377}}}],"partialFingerprints":{"codehealthFindingId/v1":"0b8c97f4d1a0a903dfbb3425c7ddc3bd7462e1526cf24184788ca2136538a273"}},{"ruleId":"D2","level":"warning","message":{"text":"compiler.compileArrowheads (cognitive 21): compiler.compileArrowheads has cognitive complexity 21 (threshold 15). Drivers by points: if/else 17, 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":"d2compiler/compile.go"},"region":{"startLine":948}}}],"partialFingerprints":{"codehealthFindingId/v1":"5e7f847b7506ac22f208ed9bbe5f301c72bf3d663490c6cc6acc2e087d5f4173"}},{"ruleId":"D2","level":"warning","message":{"text":"d2exporter.toShape (cognitive 21): d2exporter.toShape has cognitive complexity 21 (threshold 15). Drivers by points: if/else 19, 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":"d2exporter/export.go"},"region":{"startLine":209}}}],"partialFingerprints":{"codehealthFindingId/v1":"a9edfc3c273b2efa7b6d4fa68ba6c09bf36ffe8e21ba28bd88f0538d85a2c579"}},{"ruleId":"D2","level":"warning","message":{"text":"printer.array (cognitive 21): printer.array has cognitive complexity 21 (threshold 15). Drivers by points: if/else 17, 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":"d2format/format.go"},"region":{"startLine":245}}}],"partialFingerprints":{"codehealthFindingId/v1":"53c3b7a3c07c5e2b94819c26ef6d1a8a7340cda094cb21bcf0912facf73f5c45"}},{"ruleId":"D2","level":"warning","message":{"text":"Object.EnsureChild (cognitive 21): Object.EnsureChild has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15, 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":"d2graph/d2graph.go"},"region":{"startLine":875}}}],"partialFingerprints":{"codehealthFindingId/v1":"307281597a7605095273f06ccd74627f428a1958905013c598ec1d23defe1670"}},{"ruleId":"D2","level":"warning","message":{"text":"Object.GetLabelSize (cognitive 21): Object.GetLabelSize has cognitive complexity 21 (threshold 15). Drivers by points: if/else 18, 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":"d2graph/d2graph.go"},"region":{"startLine":944}}}],"partialFingerprints":{"codehealthFindingId/v1":"bec549e1dda4b876d7fd3fa836bfab8ae2661171eb0d7a4031f24b0044fedc33"}},{"ruleId":"D2","level":"warning","message":{"text":"compiler._ampersandPropertyFilter (cognitive 21): compiler._ampersandPropertyFilter has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14, loops 4, 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":"d2ir/compile.go"},"region":{"startLine":962}}}],"partialFingerprints":{"codehealthFindingId/v1":"40b039cbf62b2101344ee51fb4ee22d70b8d7af29c0545bafe060284651d7894"}},{"ruleId":"D2","level":"warning","message":{"text":"d2oracle.getMostNestedRefs (cognitive 21): d2oracle.getMostNestedRefs has cognitive complexity 21 (threshold 15). Drivers by points: if/else 18, 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":"d2oracle/edit.go"},"region":{"startLine":3278}}}],"partialFingerprints":{"codehealthFindingId/v1":"345f5c1b0bf2b5a1910f30c4ff8e249bd095b532705b8d4e767d20d3318334e3"}},{"ruleId":"D2","level":"warning","message":{"text":"d2oracle.replaceBoardNodeInMap (cognitive 21): d2oracle.replaceBoardNodeInMap has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15, 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":"d2oracle/get.go"},"region":{"startLine":56}}}],"partialFingerprints":{"codehealthFindingId/v1":"bb0d3a5b2ccd1e515b37ca354a898a6e37f236b0b5e719492b7a453597fd6229"}},{"ruleId":"D2","level":"warning","message":{"text":"parser.parseArray (cognitive 21): parser.parseArray has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15, loops 3, match/switch 2, boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2parser/parse.go"},"region":{"startLine":1510}}}],"partialFingerprints":{"codehealthFindingId/v1":"58d190702f50d0318a120bbacd69a9b9297460df0f75cbcb44394e472d6c1895"}},{"ruleId":"D2","level":"warning","message":{"text":"execPlugin.HydrateOpts (cognitive 21): execPlugin.HydrateOpts has cognitive complexity 21 (threshold 15). Drivers by points: loops 10, match/switch 8, if/else 3 (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":"d2plugin/exec.go"},"region":{"startLine":73}}}],"partialFingerprints":{"codehealthFindingId/v1":"cdefb9a2359d220f385f3abc6524ed52b88f2be0fb07e1966cfa606410c04dc6"}},{"ruleId":"D2","level":"warning","message":{"text":"d2svg.singleThemeRulesets (cognitive 21): d2svg.singleThemeRulesets has cognitive complexity 21 (threshold 15). Drivers by points: if/else 20, 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":"d2renderers/d2svg/d2svg.go"},"region":{"startLine":3142}}}],"partialFingerprints":{"codehealthFindingId/v1":"c8b1b2221450ef0126b89a411a21f4c852a22f98c10662e1746c66ed8a10e0ce"}},{"ruleId":"D2","level":"warning","message":{"text":"d2compiler.hasBoard (cognitive 20): d2compiler.hasBoard has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12, loops 6, 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":"d2compiler/compile.go"},"region":{"startLine":1339}}}],"partialFingerprints":{"codehealthFindingId/v1":"67eef5615b4e62f3119bc55aed1101b51eb5797659d96dcd00787d36b2c3d44b"}},{"ruleId":"D2","level":"warning","message":{"text":"d2exporter.Export (cognitive 20): d2exporter.Export has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11, loops 8, boolean chains 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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":"d2exporter/export.go"},"region":{"startLine":22}}}],"partialFingerprints":{"codehealthFindingId/v1":"d8efd50775eb10cfdd56a3e68f5ed12f7743c6c385deb1fc6d9fb63a55c932d3"}},{"ruleId":"D2","level":"warning","message":{"text":"d2near.place (cognitive 20): d2near.place has cognitive complexity 20 (threshold 15). Drivers by points: if/else 18, 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":"d2layouts/d2near/layout.go"},"region":{"startLine":95}}}],"partialFingerprints":{"codehealthFindingId/v1":"010a98d0458f0b25dd9a8b8818a0338249e7c6b4e1d12ae594ce12b85012637a"}},{"ruleId":"D2","level":"warning","message":{"text":"d2lib.compile (cognitive 20): d2lib.compile has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17, 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":"d2lib/d2.go"},"region":{"startLine":97}}}],"partialFingerprints":{"codehealthFindingId/v1":"9c36531c9231b8939424caea3f2afb85be2a530925434496ca4ada88d3eb5990"}},{"ruleId":"D2","level":"warning","message":{"text":"Theme.ApplyOverrides (cognitive 20): Theme.ApplyOverrides has cognitive complexity 20 (threshold 15). Drivers by points: if/else 20. 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":"d2themes/d2themes.go"},"region":{"startLine":33}}}],"partialFingerprints":{"codehealthFindingId/v1":"46b5530bc9919d52ee62b3f94d396f7a2be92e4e82bb8ec1cf8d1769df96427b"}},{"ruleId":"D2","level":"warning","message":{"text":"Presentation.SaveTo (cognitive 20): Presentation.SaveTo has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17, loops 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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/pptx/pptx.go"},"region":{"startLine":172}}}],"partialFingerprints":{"codehealthFindingId/v1":"b5af144b1d7ac0c23b18e7173757245a4e92697a8262eef5a7fb7320218bc580"}},{"ruleId":"D2","level":"warning","message":{"text":"onmessage (cognitive 20): onmessage has cognitive complexity 20 (threshold 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":"d2cli/static/watch.js"},"region":{"startLine":18}}}],"partialFingerprints":{"codehealthFindingId/v1":"d6889007650782521af1d5883ef46ccb8457cb3316d65a426fd4a9a54b8d2ca7"}},{"ruleId":"D2","level":"warning","message":{"text":"compiler.validateEdges (cognitive 19): compiler.validateEdges has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12, boolean chains 6, 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":"d2compiler/compile.go"},"region":{"startLine":1263}}}],"partialFingerprints":{"codehealthFindingId/v1":"1765ec72f7a78674ee9412781c5db0857e85c68ebf41ececa82167524ff1678c"}},{"ruleId":"D2","level":"warning","message":{"text":"printer.blockString (cognitive 19): printer.blockString has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, 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":"d2format/format.go"},"region":{"startLine":159}}}],"partialFingerprints":{"codehealthFindingId/v1":"adc119fd30c8fa727aa490711bd76c4ad6363182d5b6d21c9c15af6f385e5576"}},{"ruleId":"D2","level":"warning","message":{"text":"compiler.compileLink (cognitive 19): compiler.compileLink has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12, boolean chains 5, 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":"d2ir/compile.go"},"region":{"startLine":1305}}}],"partialFingerprints":{"codehealthFindingId/v1":"16c8a0ebf1aad325cbd117a28f6b5c72d1d88c0ab54954acb0455f35a97b4ab0"}},{"ruleId":"D2","level":"warning","message":{"text":"d2oracle.Rename (cognitive 19): d2oracle.Rename has cognitive complexity 19 (threshold 15). Drivers by points: if/else 18, 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":"d2oracle/edit.go"},"region":{"startLine":1701}}}],"partialFingerprints":{"codehealthFindingId/v1":"70d633bdde10a9d7b578bb02cd2b1fcc4a22379c0e80c518c2945deb08eff8ba"}},{"ruleId":"D2","level":"warning","message":{"text":"d2oracle.GetBoardGraph (cognitive 19): d2oracle.GetBoardGraph 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":"d2oracle/get.go"},"region":{"startLine":12}}}],"partialFingerprints":{"codehealthFindingId/v1":"81bf15387a1b0e8a657beccf02e8f5f39ef47b888de84b356fed0d8972f7511a"}},{"ruleId":"D2","level":"warning","message":{"text":"parser.parseEdgeIndex (cognitive 19): parser.parseEdgeIndex has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14, 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":"d2parser/parse.go"},"region":{"startLine":827}}}],"partialFingerprints":{"codehealthFindingId/v1":"dc3ed1c1adb1608097220fe564579b84e31e3a925de6c11a0071a3f96a2666c6"}},{"ruleId":"D2","level":"warning","message":{"text":"parser.parseEdges (cognitive 19): parser.parseEdges 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":"d2parser/parse.go"},"region":{"startLine":884}}}],"partialFingerprints":{"codehealthFindingId/v1":"8307ec990dde9ff27afbe1eb8a9dff354a740f7a8e08de0d486882ca56c4a321"}},{"ruleId":"D2","level":"warning","message":{"text":"parser.parseSingleQuotedString (cognitive 19): parser.parseSingleQuotedString has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, 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":"d2parser/parse.go"},"region":{"startLine":1335}}}],"partialFingerprints":{"codehealthFindingId/v1":"8677d7d46fd50881a2edfe563f42d9b1e09ecbca99f3f396ebfe2518debb95de"}},{"ruleId":"D2","level":"warning","message":{"text":"asciiroute.adjustRouteStartPoint (cognitive 19): asciiroute.adjustRouteStartPoint has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, 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":"d2renderers/d2ascii/asciiroute/routing.go"},"region":{"startLine":180}}}],"partialFingerprints":{"codehealthFindingId/v1":"b6e3862c38a0b06f1e813ef58d9db4058b8ce1f532679b7380d3ee5bf3a86d15"}},{"ruleId":"D2","level":"warning","message":{"text":"asciiroute.adjustRouteEndPoint (cognitive 19): asciiroute.adjustRouteEndPoint has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, 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":"d2renderers/d2ascii/asciiroute/routing.go"},"region":{"startLine":248}}}],"partialFingerprints":{"codehealthFindingId/v1":"11d238157d6d401764636f549f96376fedd9037782f16173598516d33754acda"}},{"ruleId":"D2","level":"warning","message":{"text":"asciishapes.DrawQueue (cognitive 19): asciishapes.DrawQueue has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 13, loops 3, match/switch 3 (nesting depth added 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":"d2renderers/d2ascii/asciishapes/queue.go"},"region":{"startLine":3}}}],"partialFingerprints":{"codehealthFindingId/v1":"a077d8c547dcc1e6d6423f890f3b3576c3265dfa5b663f29589ede0344700f49"}},{"ruleId":"D2","level":"warning","message":{"text":"asciishapes.DrawRect (cognitive 19): asciishapes.DrawRect has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11, boolean chains 5, loops 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":"d2renderers/d2ascii/asciishapes/rectangle.go"},"region":{"startLine":11}}}],"partialFingerprints":{"codehealthFindingId/v1":"9ca10d7eb29ef63cde56f9dc2258989432da75e748c1f6ed52e5ebde8266b3f9"}},{"ruleId":"D2","level":"warning","message":{"text":"asciishapes.DrawStep (cognitive 19): asciishapes.DrawStep has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 8, if/else 8, loops 3 (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":"d2renderers/d2ascii/asciishapes/step.go"},"region":{"startLine":3}}}],"partialFingerprints":{"codehealthFindingId/v1":"61ef84e20642fb99d763d69b4b706839512c50ec13cf92a14595ded87b2ada9d"}},{"ruleId":"D2","level":"warning","message":{"text":"Ruler.scaleUnicode (cognitive 19): Ruler.scaleUnicode has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10, loops 9 (nesting depth added 13). This file\u0027s own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes \u2014 or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/textmeasure/textmeasure.go"},"region":{"startLine":185}}}],"partialFingerprints":{"codehealthFindingId/v1":"38a19007426f23344d8e864fc721b9a2f1bb495754e83257ce9cb2994ef499bf"}},{"ruleId":"D2","level":"warning","message":{"text":"xgif.ConvertAnimatedSVGToPNGs (cognitive 19): xgif.ConvertAnimatedSVGToPNGs has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, loops 3 (nesting depth added 10). Most of this is not in the body itself: 2 of the 19 points are its own statements and the rest belongs to one function literal inside it that branches (line 48). 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":"lib/xgif/xgif.go"},"region":{"startLine":37}}}],"partialFingerprints":{"codehealthFindingId/v1":"8f3204d5fc3fd1fb63075e526bf5c88083bf3da16c27469bee71b700201f4c15"}},{"ruleId":"D2","level":"warning","message":{"text":"compiler.validateBoardLinks (cognitive 18): compiler.validateBoardLinks has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12, 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":"d2compiler/compile.go"},"region":{"startLine":1296}}}],"partialFingerprints":{"codehealthFindingId/v1":"9e2dbc1d17dd8c4c541f4d296acbca306b28395b433c3741d4e45ad0529c81bc"}},{"ruleId":"D2","level":"warning","message":{"text":"d2exporter.applyStyles (cognitive 18): d2exporter.applyStyles has cognitive complexity 18 (threshold 15). Drivers by points: if/else 18. 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":"d2exporter/export.go"},"region":{"startLine":152}}}],"partialFingerprints":{"codehealthFindingId/v1":"a0b94226c0bcee4cef63a5820d46a2ed93620d51890fae3f6a3eeea5bbf4e375"}},{"ruleId":"D2","level":"warning","message":{"text":"Object.GetMargin (cognitive 18): Object.GetMargin 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":"d2graph/layout.go"},"region":{"startLine":289}}}],"partialFingerprints":{"codehealthFindingId/v1":"c78d5500d38b86d8aaa658ce8177802af0b028c4fa5740f938b73896236cb009"}},{"ruleId":"D2","level":"warning","message":{"text":"d2oracle.bumpChildrenUnderscores (cognitive 18): d2oracle.bumpChildrenUnderscores has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, 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":"d2oracle/edit.go"},"region":{"startLine":1108}}}],"partialFingerprints":{"codehealthFindingId/v1":"1108810c2b54cb657aeec6d3fd117c02da4510873d6ff65a69267fc70b37a57a"}},{"ruleId":"D2","level":"warning","message":{"text":"parser.parseArrayNode (cognitive 18): parser.parseArrayNode 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":"d2parser/parse.go"},"region":{"startLine":1566}}}],"partialFingerprints":{"codehealthFindingId/v1":"173bba9a2585bdc50ab0f86997beb86661b5ac157b2a114fc69ce02695ca3394"}},{"ruleId":"D2","level":"warning","message":{"text":"asciiroute.shouldDrawTJunction (cognitive 18): asciiroute.shouldDrawTJunction has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10, boolean chains 8 (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":"d2renderers/d2ascii/asciiroute/drawing.go"},"region":{"startLine":223}}}],"partialFingerprints":{"codehealthFindingId/v1":"00f737379dfb33e39033f7d00ba5be6bd24448b9df155c095fce3a5535498c16"}},{"ruleId":"D2","level":"warning","message":{"text":"appendix.Append (cognitive 18): appendix.Append has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, loops 3 (nesting depth added 3). 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: 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":"d2renderers/d2svg/appendix/appendix.go"},"region":{"startLine":66}}}],"partialFingerprints":{"codehealthFindingId/v1":"55c3fbdd6e6976f4dcb9becebd5211da86cef15507d987216ec0350bece06a68"}},{"ruleId":"D2","level":"warning","message":{"text":"d2compiler._findFieldAST (cognitive 17): d2compiler._findFieldAST 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":"d2compiler/compile.go"},"region":{"startLine":218}}}],"partialFingerprints":{"codehealthFindingId/v1":"3d307f7277baa256ecdff17da7ce1c08cbeb781bea750f7ef9694ff32f3eecf0"}},{"ruleId":"D2","level":"warning","message":{"text":"compiler.compileLabel (cognitive 17): compiler.compileLabel has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10, match/switch 7 (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":"d2compiler/compile.go"},"region":{"startLine":441}}}],"partialFingerprints":{"codehealthFindingId/v1":"f0712e94c2c42d65b288ab527c9ba3011f8aebc248012c54b0b9f0b0e1a1817d"}},{"ruleId":"D2","level":"warning","message":{"text":"d2graph.DeserializeGraph (cognitive 17): d2graph.DeserializeGraph 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":"d2graph/serde.go"},"region":{"startLine":24}}}],"partialFingerprints":{"codehealthFindingId/v1":"af961723aa1e86bc345006eb3c6d5ef26e78c78370e5dc2f7ba536f0b4c8907a"}},{"ruleId":"D2","level":"warning","message":{"text":"Object.Text (cognitive 17): Object.Text has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10, boolean chains 7 (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":"d2graph/d2graph.go"},"region":{"startLine":661}}}],"partialFingerprints":{"codehealthFindingId/v1":"b97f58292b1f17acbc1df6764b584d130cb39c9923b905039e4e3357da50e333"}},{"ruleId":"D2","level":"warning","message":{"text":"compiler._ampersandFilter (cognitive 17): compiler._ampersandFilter 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":"d2ir/compile.go"},"region":{"startLine":1025}}}],"partialFingerprints":{"codehealthFindingId/v1":"04dbcc86d6975c5bc08d24f9741754acb1ce74a0fe4d9331eabea66a7b038ae3"}},{"ruleId":"D2","level":"warning","message":{"text":"Map.removeSuspendedFields (cognitive 17): Map.removeSuspendedFields has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, 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":"d2ir/compile.go"},"region":{"startLine":1636}}}],"partialFingerprints":{"codehealthFindingId/v1":"bf6cd691030d90488bdf1c6cc1b0b827e1ea3532b3195794bb4adce8d4e7e0e5"}},{"ruleId":"D2","level":"warning","message":{"text":"Map.getField (cognitive 17): Map.getField 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":"d2ir/d2ir.go"},"region":{"startLine":792}}}],"partialFingerprints":{"codehealthFindingId/v1":"940f84c22b8167c8afb106e73169210a118dc62bb3adbfa8b0bf92a674f112f2"}},{"ruleId":"D2","level":"warning","message":{"text":"RefContext.Equal (cognitive 17): RefContext.Equal 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":"d2ir/d2ir.go"},"region":{"startLine":650}}}],"partialFingerprints":{"codehealthFindingId/v1":"b9faea9e2ee254e5043aa4a41637084cc92dff9de22d1d5004d61744eb2b9319"}},{"ruleId":"D2","level":"warning","message":{"text":"sequenceDiagram.placeNotes (cognitive 17): sequenceDiagram.placeNotes 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":"d2layouts/d2sequence/sequence_diagram.go"},"region":{"startLine":473}}}],"partialFingerprints":{"codehealthFindingId/v1":"84d2a88b1766d9b27e4069e5cc5306a73bb374fe888dacbf4c945224e0122287"}},{"ruleId":"D2","level":"warning","message":{"text":"parser.parseMapKey (cognitive 17): parser.parseMapKey has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15, boolean chains 1, match/switch 1 (nesting depth added 2). 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: 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":"d2parser/parse.go"},"region":{"startLine":650}}}],"partialFingerprints":{"codehealthFindingId/v1":"7054366bd51a97f77f6db2c72003cfd3da6b7b82ec213189be822c3a6c8c2b64"}},{"ruleId":"D2","level":"warning","message":{"text":"asciiroute.drawSegmentBetweenPoints (cognitive 17): asciiroute.drawSegmentBetweenPoints 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":"d2renderers/d2ascii/asciiroute/drawing.go"},"region":{"startLine":14}}}],"partialFingerprints":{"codehealthFindingId/v1":"767edbe7b88444961b862d0ef0d814b050871130cab36886aef910daaf467d06"}},{"ruleId":"D2","level":"warning","message":{"text":"asciishapes.DrawCallout (cognitive 17): asciishapes.DrawCallout has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8, boolean chains 6, loops 3 (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":"d2renderers/d2ascii/asciishapes/callout.go"},"region":{"startLine":5}}}],"partialFingerprints":{"codehealthFindingId/v1":"4ee376220d8ba08627e5063950cf36402ea3e208996ff2fea55084418085a60f"}},{"ruleId":"D2","level":"warning","message":{"text":"asciishapes.DrawDiamond (cognitive 17): asciishapes.DrawDiamond has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7, loops 6, boolean chains 4 (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":"d2renderers/d2ascii/asciishapes/diamond.go"},"region":{"startLine":5}}}],"partialFingerprints":{"codehealthFindingId/v1":"1ce9fedb643305efaf0adb333b015fb47ab8a1ccad13fa5e784a4823c53a8104"}},{"ruleId":"D2","level":"warning","message":{"text":"compiler.compileLegend (cognitive 16): compiler.compileLegend has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, boolean chains 5, 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":"d2compiler/compile.go"},"region":{"startLine":116}}}],"partialFingerprints":{"codehealthFindingId/v1":"a5490d0bcd0f43ffb530120e610cc865736d1e88a0763608dc1cded84b7fe239"}},{"ruleId":"D2","level":"warning","message":{"text":"printer.interpolationBoxes (cognitive 16): printer.interpolationBoxes 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":"d2format/format.go"},"region":{"startLine":129}}}],"partialFingerprints":{"codehealthFindingId/v1":"e20ff80518c24c681abae6f0e2ec9e42da9c9e528e5001754b3dd6874f7e6b6a"}},{"ruleId":"D2","level":"warning","message":{"text":"Object.FindEdges (cognitive 16): Object.FindEdges has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, boolean chains 7, 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":"d2graph/d2graph.go"},"region":{"startLine":820}}}],"partialFingerprints":{"codehealthFindingId/v1":"65a3862189c2fd068091dfa3de99009b737bf911017a48bd97ff8b6c7f85b1ac"}},{"ruleId":"D2","level":"warning","message":{"text":"Object.SpacingOpt (cognitive 16): Object.SpacingOpt has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, match/switch 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":"d2graph/d2graph.go"},"region":{"startLine":1885}}}],"partialFingerprints":{"codehealthFindingId/v1":"9e3777f3ca57fe40d817c33be93377d7befe6dc08c4395516a5389ae123d3530"}},{"ruleId":"D2","level":"warning","message":{"text":"d2ir.matchPattern (cognitive 16): d2ir.matchPattern 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":"d2ir/pattern.go"},"region":{"startLine":66}}}],"partialFingerprints":{"codehealthFindingId/v1":"17d9860cb3c7b1376b19c262259c90d38624fdee6bd6bdbb9f45963b02113c45"}},{"ruleId":"D2","level":"warning","message":{"text":"Map._doubleGlob (cognitive 16): Map._doubleGlob 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":"d2ir/pattern.go"},"region":{"startLine":22}}}],"partialFingerprints":{"codehealthFindingId/v1":"2bce6d2c973a7fc3904aeb40fbec1d43dbcc56d25569102b8f1367cb48b816ff"}},{"ruleId":"D2","level":"warning","message":{"text":"EdgeID.resolve (cognitive 16): EdgeID.resolve has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, boolean chains 4, 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":"d2ir/d2ir.go"},"region":{"startLine":454}}}],"partialFingerprints":{"codehealthFindingId/v1":"a8d130fed3d72d15da1b4639f3c31e17902d153cbbc7fba6a1800a5c90d97d35"}},{"ruleId":"D2","level":"warning","message":{"text":"gridDiagram.fastLayout (cognitive 16): gridDiagram.fastLayout 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":"d2layouts/d2grid/layout.go"},"region":{"startLine":729}}}],"partialFingerprints":{"codehealthFindingId/v1":"52875ef9429c1edecb79addb67ecacec1090c36719b93ec1ef1f028c9e57ea25"}},{"ruleId":"D2","level":"warning","message":{"text":"parser.parseBlockComment (cognitive 16): parser.parseBlockComment 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":"d2parser/parse.go"},"region":{"startLine":574}}}],"partialFingerprints":{"codehealthFindingId/v1":"0f14ebba7e59fbbc99c05145645249cf43d062fd6877c42b0ee3c3110e20bb8b"}},{"ruleId":"D2","level":"warning","message":{"text":"d2fonts.AddFontFamily (cognitive 16): d2fonts.AddFontFamily 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":"d2renderers/d2fonts/d2fonts_common.go"},"region":{"startLine":129}}}],"partialFingerprints":{"codehealthFindingId/v1":"2bb1959659f5a369dc90e018b9f368c6055ca0225b62fa40447c8defe193b9d3"}},{"ruleId":"D2","level":"warning","message":{"text":"d2sketch.Paths (cognitive 16): d2sketch.Paths has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, 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":"d2renderers/d2sketch/sketch.go"},"region":{"startLine":324}}}],"partialFingerprints":{"codehealthFindingId/v1":"accc60f4183cc15714e595d7efdab2d7b8e9f80df471136d332723d166f6ccd1"}},{"ruleId":"D2","level":"warning","message":{"text":"d2sketch.Connection (cognitive 16): d2sketch.Connection has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, 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":"d2renderers/d2sketch/sketch.go"},"region":{"startLine":373}}}],"partialFingerprints":{"codehealthFindingId/v1":"1c50b557c1ff0ee655848d63fc51cc5dc0250937f65b80dd9f6d87429f469a1d"}},{"ruleId":"D2","level":"warning","message":{"text":"d2target.ToArrowhead (cognitive 16): d2target.ToArrowhead has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, boolean chains 5, 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":"d2target/d2target.go"},"region":{"startLine":938}}}],"partialFingerprints":{"codehealthFindingId/v1":"d6f74f30b58434008f1f7cda31dbd402851ed466655eeeee7fccd480ccf39302"}},{"ruleId":"D2","level":"warning","message":{"text":"utf8FontFile.getSymbols (cognitive 16): utf8FontFile.getSymbols has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, loops 2 (nesting depth added 7). This file\u0027s own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes \u2014 or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/font/subsetFont.go"},"region":{"startLine":541}}}],"partialFingerprints":{"codehealthFindingId/v1":"4276d75fbc0eca1d2b38efcaa2cca24aecb661a60b25f75c75839c2248096517"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: d2svg/d2svg.go: FileTooLong \u2014 2369 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svg/d2svg.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"41ea51bb60f8931be9aeb105015a97319854c31a9fca2acd610391163d1d32a7"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: d2oracle/edit.go: FileTooLong \u2014 2211 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2oracle/edit.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"4cee5d29a8eb0bcbf3d3a3874b61401c38669027c06e165d777fdefd4da5ed73"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: d2graph/d2graph.go: FileTooLong \u2014 1273 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2graph/d2graph.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"5df5898f99724f7549ff50fabf8518089778507ba751974b7fbde7d5a8362ff3"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: d2ir/d2ir.go: FileTooLong \u2014 1242 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ir/d2ir.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"a94428897dff0f116b97668cfd17a019461424b681afc5350ab9147cb13bab88"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: d2parser/parse.go: FileTooLong \u2014 1224 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2parser/parse.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"fcf17968b74d6bfa4a9e719ae23abcca04d5d04b6b01e28fdaa400419ab437f2"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: d2dagrelayout/layout.go: FileTooLong \u2014 1194 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2dagrelayout/layout.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"fc1c03501867e1915b3914a98c902fdc91494340c4325490e5bb50814efcd3de"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: d2compiler/compile.go: FileTooLong \u2014 1160 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2compiler/compile.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"9774c1184ad55023f9c79721babb3ba0676a36010e6cf5b92e6c89c0945955bc"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: d2ir/compile.go: FileTooLong \u2014 1082 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ir/compile.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"33919f3e8cafc21414fb3f96f86306b3ad0c36a9755976dd2dc60723896412f3"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: d2cli/main.go: FileTooLong \u2014 1068 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2cli/main.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"d39b49dacca81d5896ae17abd660277188e10b90aca65b5570947180bab9793c"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: d2ast/d2ast.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":"d2ast/d2ast.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"d15319c9b62cc0980af22b4510ae6b45462629cf2d5263f42015ebbcf3f051c2"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: d2target/d2target.go: FileTooLong \u2014 863 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2target/d2target.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"3e7a2ec5f7bbaf6fadb1101a09ef88c73264ffab5a08cf97df3d92cd11acd9e7"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: Object: TooManyMethods \u2014 50 methods, declared across 4 files: d2graph/d2graph.go (29), d2graph/layout.go (9), d2graph/seqdiagram.go (8), d2graph/grid_diagram.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":"d2graph/d2graph.go"},"region":{"startLine":165}}}],"partialFingerprints":{"codehealthFindingId/v1":"0b996f3419dc473b48b9820e56c7d4609625bb056c0d857d544a876a91f0bfc0"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: d2elklayout/layout.go: FileTooLong \u2014 738 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2elklayout/layout.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"af2e2328f1c1d466176842df079f0aa9035c8687f8546e532964a4b381e6d470"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: Map: TooManyMethods \u2014 42 methods, declared across 4 files: d2ir/d2ir.go (36), d2ir/pattern.go (3), d2ir/query.go (2), d2ir/compile.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":"d2ir/d2ir.go"},"region":{"startLine":168}}}],"partialFingerprints":{"codehealthFindingId/v1":"16794e4cca76f1a9bc62d14d4ca882ddaaa02474ed16d10964c8b588f14ebc44"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: d2sketch/sketch.go: FileTooLong \u2014 696 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2sketch/sketch.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"fbbff6b6bad2433ab532cfc9a3d6da2e2686725d3df88e65e51c65dc765bc5c2"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: font/subsetFont.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":"lib/font/subsetFont.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"09c1737dcba91f4a30cd64854a0af763ffbbf6482e894548f8c50eaa36408235"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: parser: 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":"d2parser/parse.go"},"region":{"startLine":142}}}],"partialFingerprints":{"codehealthFindingId/v1":"1951abcbb5792eb10c737aa096debd91e4e27646369fdbd1b7620805339d2eab"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: d2grid/layout.go: FileTooLong \u2014 537 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2grid/layout.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"5a956e5aef25723d37c2b05cdecd0049ec5b481445a8c0bacd31b0a7a3185f63"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: compiler: TooManyMethods \u2014 31 methods, declared across 3 files: d2ir/compile.go (25), d2ir/import.go (5), d2ir/d2ir.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":"d2ir/compile.go"},"region":{"startLine":31}}}],"partialFingerprints":{"codehealthFindingId/v1":"0fe9aa9a9f5b516068cfefeec5e930c264a4f84ea5b484a543e52b5e6afe4ab2"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (24 lines \u00D7 2): d2layouts/d2grid/layout.go:371-397 | d2layouts/d2grid/layout.go:464-487 \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 \u0060d2layouts/d2grid/layout.go:371\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2grid/layout.go"},"region":{"startLine":371}}}],"partialFingerprints":{"codehealthFindingId/v1":"6b7bfbe4da3ed8384da2fcf66e98147a4c348cd8edfc4b48f146e5a47059dc2c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (18 lines \u00D7 2): d2parser/parse.go:476-493 | d2parser/parse.go:1576-1593 \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 \u0060d2parser/parse.go:476\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":"d2parser/parse.go"},"region":{"startLine":476}}}],"partialFingerprints":{"codehealthFindingId/v1":"e488ccca91b0378c77f2075b39caae6d14c9d14169a4eeb03b7f2e806954a80f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (17 lines \u00D7 2): d2oracle/edit.go:166-182 | d2oracle/edit.go:2548-2564 \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 \u0060d2oracle/edit.go:166\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":"d2oracle/edit.go"},"region":{"startLine":166}}}],"partialFingerprints":{"codehealthFindingId/v1":"604180cb7b6e0de29159393612fcc57194b78356fe95d7064dab5298aae1e03b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (17 lines \u00D7 2): d2renderers/d2svg/d2svg.go:160-176 | d2renderers/d2svg/d2svg.go:2915-2931 \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 \u0060d2renderers/d2svg/d2svg.go:160\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":"d2renderers/d2svg/d2svg.go"},"region":{"startLine":160}}}],"partialFingerprints":{"codehealthFindingId/v1":"ca942fee6d944425bea58540390ac820c44562e8a8d7563f2f6641b90b1fe682"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (16 lines \u00D7 2): d2layouts/d2dagrelayout/layout.go:1482-1497 | d2layouts/d2dagrelayout/layout.go:1553-1568 \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 \u0060d2layouts/d2dagrelayout/layout.go:1482\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":"d2layouts/d2dagrelayout/layout.go"},"region":{"startLine":1482}}}],"partialFingerprints":{"codehealthFindingId/v1":"a026482bace1dac950a4adf74e0230daaca4f41cbf11957536d84ec492bfc8b6"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (16 lines \u00D7 2): d2oracle/edit.go:2951-2966 | d2oracle/edit.go:3139-3156 \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 \u0060d2oracle/edit.go:2951\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":"d2oracle/edit.go"},"region":{"startLine":2951}}}],"partialFingerprints":{"codehealthFindingId/v1":"3838e8d3b09fb26fcd26d91be4db3aeb230d615071612b2f836055d4b8700dc0"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (16 lines \u00D7 2): d2parser/parse.go:429-448 | d2parser/parse.go:1541-1556 \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 \u0060d2parser/parse.go:429\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":"d2parser/parse.go"},"region":{"startLine":429}}}],"partialFingerprints":{"codehealthFindingId/v1":"1545956768348c108bc32c390c9072dd382113a380f25fc2978a5d8a2216389a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (16 lines \u00D7 2): d2renderers/d2svg/d2svg.go:1445-1460 | d2renderers/d2svg/d2svg.go:1567-1584 \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 \u0060d2renderers/d2svg/d2svg.go:1445\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":"d2renderers/d2svg/d2svg.go"},"region":{"startLine":1445}}}],"partialFingerprints":{"codehealthFindingId/v1":"f8d8806e50d608ef9d3b675a27e05e94505c419b15721c46380106f894bbbf63"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15 lines \u00D7 2): d2layouts/d2dagrelayout/layout.go:1711-1725 | d2layouts/d2dagrelayout/layout.go:1728-1742 \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 \u0060d2layouts/d2dagrelayout/layout.go:1711\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":"d2layouts/d2dagrelayout/layout.go"},"region":{"startLine":1711}}}],"partialFingerprints":{"codehealthFindingId/v1":"7354367085fa7b45430d92a074d6b06cbe1d96de7520f87bed243395353fe5f9"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15 lines \u00D7 2): d2oracle/edit.go:126-140 | d2oracle/edit.go:2515-2529 \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":"d2oracle/edit.go"},"region":{"startLine":126}}}],"partialFingerprints":{"codehealthFindingId/v1":"7a36489b8577763550b2dac264b68309bd9065dd66cea03767dbe6a47a34b996"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15 lines \u00D7 2): d2renderers/d2sketch/sketch.go:945-959 | d2renderers/d2sketch/sketch.go:984-998 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2renderers/d2sketch/sketch.go:945\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":"d2renderers/d2sketch/sketch.go"},"region":{"startLine":945}}}],"partialFingerprints":{"codehealthFindingId/v1":"61702a0d4f3afe45e7d300120b67309e309ca83f061fbe7b4849a9cda102a626"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 4): d2oracle/edit.go:96-109 | d2oracle/edit.go:143-156 | d2oracle/edit.go:957-970 | d2oracle/edit.go:1775-1788 \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. 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":"d2oracle/edit.go"},"region":{"startLine":96}}}],"partialFingerprints":{"codehealthFindingId/v1":"596ecc449a62dac852911888ca44e7b345959d4aad6fe9828de4576e8cdc3b32"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): d2ast/d2ast.go:1331-1344 | d2ast/d2ast.go:1435-1448 \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 \u0060d2ast/d2ast.go:1331\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":"d2ast/d2ast.go"},"region":{"startLine":1331}}}],"partialFingerprints":{"codehealthFindingId/v1":"7dca4fa956c32f2e8cdcba2654cd030f3e3a6a3602a317b36bfea6fa30822a55"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): d2layouts/d2dagrelayout/layout.go:451-464 | d2layouts/d2dagrelayout/layout.go:511-524 \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 \u0060d2layouts/d2dagrelayout/layout.go:451\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":"d2layouts/d2dagrelayout/layout.go"},"region":{"startLine":451}}}],"partialFingerprints":{"codehealthFindingId/v1":"465b960ceb6ddf3d2f01c75eb2659fd46f39afbd0fdbf3f55e117b717b8c992c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): d2oracle/edit.go:1037-1050 | d2oracle/edit.go:1092-1106 \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 \u0060d2oracle/edit.go:1037\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":"d2oracle/edit.go"},"region":{"startLine":1037}}}],"partialFingerprints":{"codehealthFindingId/v1":"c7b7068ad31ac84866a4931dfcad22ec262c703f5f452c44223f72918b79c8e1"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): d2oracle/edit.go:2840-2853 | d2oracle/edit.go:3046-3059 \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 \u0060d2oracle/edit.go:2840\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":"d2oracle/edit.go"},"region":{"startLine":2840}}}],"partialFingerprints":{"codehealthFindingId/v1":"c6ebd6632d9499c536d8eabb63d8ca2789613f4df119f0dda735e1bdc7c188af"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): d2renderers/d2ascii/asciiroute/labels.go:139-152 | d2renderers/d2ascii/asciiroute/labels.go:171-184 \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 \u0060d2renderers/d2ascii/asciiroute/labels.go:139\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. 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":"d2renderers/d2ascii/asciiroute/labels.go"},"region":{"startLine":139}}}],"partialFingerprints":{"codehealthFindingId/v1":"07d1b7898a87a57f0856052a66c9424e0c6b6c2ba3672291f2f7e0020c9e9adf"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): d2renderers/d2sketch/sketch.go:231-244 | d2renderers/d2sketch/sketch.go:308-321 \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 \u0060d2renderers/d2sketch/sketch.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. 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":"d2renderers/d2sketch/sketch.go"},"region":{"startLine":231}}}],"partialFingerprints":{"codehealthFindingId/v1":"d3f1733930e8715fad3d129f6dcd23b5e14d577f86af9f8ff910ff92e715fdbe"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): d2renderers/d2svg/d2svg.go:1222-1235 | d2renderers/d2svg/d2svg.go:2121-2134 \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 \u0060d2renderers/d2svg/d2svg.go:1222\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":"d2renderers/d2svg/d2svg.go"},"region":{"startLine":1222}}}],"partialFingerprints":{"codehealthFindingId/v1":"ffc90a7dcdadead755ff38040239c9f80ee4627ea34ad0360a74364c8f17031b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): lib/font/subsetFont.go:602-615 | lib/font/subsetFont.go:620-633 \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 \u0060lib/font/subsetFont.go:602\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":"lib/font/subsetFont.go"},"region":{"startLine":602}}}],"partialFingerprints":{"codehealthFindingId/v1":"0d40b1f60214c057170d199360411b0cdf629c539ecd1ab84656f40a4b8488b3"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): d2graph/layout.go:442-455 | d2graph/layout.go:473-486 \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 \u0060d2graph/layout.go:442\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":"d2graph/layout.go"},"region":{"startLine":442}}}],"partialFingerprints":{"codehealthFindingId/v1":"940a1d8213f6a588175721a06b98b3a1a6e043706602acd5fda7b9455b299957"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): d2graph/layout.go:524-537 | d2graph/layout.go:556-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 \u0060d2graph/layout.go:524\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":"d2graph/layout.go"},"region":{"startLine":524}}}],"partialFingerprints":{"codehealthFindingId/v1":"5653f03bac6d60c341f45945ab14e4d854402f662e0417aac4d177da9998d0f8"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 3): d2renderers/d2svg/d2svg.go:124-136 | d2renderers/d2svg/d2svg.go:210-224 | d2renderers/d2svg/d2svg.go:2882-2894 \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 \u0060d2renderers/d2svg/d2svg.go:124\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":"d2renderers/d2svg/d2svg.go"},"region":{"startLine":124}}}],"partialFingerprints":{"codehealthFindingId/v1":"12b867e77f7f38f5d01471e44f140f4d13db294da58c62d3c7564d2ed9cc48e0"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): d2ast/d2ast.go:814-826 | d2ast/d2ast.go:896-908 \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 \u0060d2ast/d2ast.go:814\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":"d2ast/d2ast.go"},"region":{"startLine":814}}}],"partialFingerprints":{"codehealthFindingId/v1":"b67152d9d05eb8839860f263982c3f430d97d17024fb1ae3f789faf88aea4fd0"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): d2ir/compile.go:871-883 | d2ir/compile.go:907-919 \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 \u0060d2ir/compile.go:871\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":"d2ir/compile.go"},"region":{"startLine":871}}}],"partialFingerprints":{"codehealthFindingId/v1":"44ee20c1dd52f6d14aea8c19ca2dbca7321a5b47775ff0c550344e75bbbdf58e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): d2ir/d2ir.go:903-915 | d2ir/d2ir.go:927-939 \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 \u0060d2ir/d2ir.go:903\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":"d2ir/d2ir.go"},"region":{"startLine":903}}}],"partialFingerprints":{"codehealthFindingId/v1":"ed37494803efba0b10ff7ad9a6ca5f0123647bcc7724a5c8444c9a0a42f878a0"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): d2layouts/d2dagrelayout/layout.go:1114-1126 | d2layouts/d2dagrelayout/layout.go:1155-1168 \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 \u0060d2layouts/d2dagrelayout/layout.go:1114\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":"d2layouts/d2dagrelayout/layout.go"},"region":{"startLine":1114}}}],"partialFingerprints":{"codehealthFindingId/v1":"e8559362baf4e9aedd6de54abfdbbf8f0efa1a4d42034ef2ed51f0c13a5f764e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): d2renderers/d2sketch/sketch.go:442-454 | d2renderers/d2sketch/sketch.go:584-596 \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":"d2renderers/d2sketch/sketch.go"},"region":{"startLine":442}}}],"partialFingerprints":{"codehealthFindingId/v1":"d54ac6a34cb2f6f76f22f9f28849fc7076fa448c31fbd30adaaa7e1bac8dc47b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): d2renderers/d2svg/d2svg.go:289-301 | d2renderers/d2svg/d2svg.go:336-348 \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":"d2renderers/d2svg/d2svg.go"},"region":{"startLine":289}}}],"partialFingerprints":{"codehealthFindingId/v1":"af58fdf1c585d7c1cce4332685a62ce6cc6e5886fc6d493d733fc708e3f14498"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): d2cli/main.go:1045-1057 | d2cli/main.go:1153-1165 \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 \u0060d2cli/main.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":"d2cli/main.go"},"region":{"startLine":1045}}}],"partialFingerprints":{"codehealthFindingId/v1":"b861aa2f5447a2b7882b61ac3e8e50c549401ca9b4975d01912ea327b29ca5f5"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): d2ast/d2ast.go:1364-1375 | d2ast/d2ast.go:1406-1417 \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":"d2ast/d2ast.go"},"region":{"startLine":1364}}}],"partialFingerprints":{"codehealthFindingId/v1":"91d411c06d5d2b179030e6b5bb4cf425bac99daed107f5015c59ad6b86746c41"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): d2ast/d2ast.go:1400-1411 | d2ast/d2ast.go:1493-1504 \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 \u0060d2ast/d2ast.go:1400\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":"d2ast/d2ast.go"},"region":{"startLine":1400}}}],"partialFingerprints":{"codehealthFindingId/v1":"000be31f838162337165682e524d67769ea2d316bc9c081cf486c093686c8193"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): d2format/format.go:110-121 | d2format/format.go:188-199 \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 \u0060d2format/format.go:110\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2format/format.go"},"region":{"startLine":110}}}],"partialFingerprints":{"codehealthFindingId/v1":"bf0448cd1f64eff692125c0308f8f3c6019b881f8fdd266136d5ed3e9b7c992f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): d2layouts/d2dagrelayout/layout.go:418-429 | d2layouts/d2dagrelayout/layout.go:482-493 \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 \u0060d2layouts/d2dagrelayout/layout.go:418\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":"d2layouts/d2dagrelayout/layout.go"},"region":{"startLine":418}}}],"partialFingerprints":{"codehealthFindingId/v1":"41aa86fc7488a1281e7c945e4179ebdbb0f6cff47a17de91bb2b5042e6ac6f0c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): d2oracle/edit.go:2877-2888 | d2oracle/edit.go:3195-3206 \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":"d2oracle/edit.go"},"region":{"startLine":2877}}}],"partialFingerprints":{"codehealthFindingId/v1":"1e9be174c293765ac356210436f3612c20ab89ff9cfd09f04d895a8728ba741a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): d2renderers/d2ascii/d2ascii.go:167-178 | d2renderers/d2ascii/d2ascii.go:187-198 \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 \u0060d2renderers/d2ascii/d2ascii.go:167\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":"d2renderers/d2ascii/d2ascii.go"},"region":{"startLine":167}}}],"partialFingerprints":{"codehealthFindingId/v1":"30514a008ff83336bb570a3807b023c6ebda2af16f482d1fbd022075e5605eab"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): d2renderers/d2svg/d2svg.go:1858-1869 | d2renderers/d2svg/d2svg.go:1890-1901 \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 \u0060d2renderers/d2svg/d2svg.go:1858\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":"d2renderers/d2svg/d2svg.go"},"region":{"startLine":1858}}}],"partialFingerprints":{"codehealthFindingId/v1":"90ab99a5a271e063623cd32cb0159ee3d8d4d5de04bb4a6d790baadfad1c0423"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): d2cli/main.go:429-440 | d2cli/main.go:454-465 \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 \u0060d2cli/main.go:429\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. 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":"d2cli/main.go"},"region":{"startLine":429}}}],"partialFingerprints":{"codehealthFindingId/v1":"38eeccd901723e98c1eca17774053431f3ef04c1546795dbe14c6cffe30c85da"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): d2graph/layout.go:186-197 | d2graph/layout.go:240-251 \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 \u0060d2graph/layout.go:186\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":"d2graph/layout.go"},"region":{"startLine":186}}}],"partialFingerprints":{"codehealthFindingId/v1":"148687e6bddda276802cb7dfd60be3e53a6f8261c6b05778125fb28076ca83de"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): d2compiler/compile.go:282-292 | d2compiler/compile.go:896-906 \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 \u0060d2compiler/compile.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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2compiler/compile.go"},"region":{"startLine":282}}}],"partialFingerprints":{"codehealthFindingId/v1":"0ff287ee4cf83a5874d31e87611a67da515e9e3b7df17cd2092feb865265f015"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): d2format/format.go:260-270 | d2format/format.go:316-326 \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 \u0060d2format/format.go:260\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":"d2format/format.go"},"region":{"startLine":260}}}],"partialFingerprints":{"codehealthFindingId/v1":"cb992eb56cbf51d0133f41234ab5600d34f9001c5a3ec65b9c5d2ee05464c0ff"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): d2ir/compile.go:893-904 | d2ir/compile.go:931-941 \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 \u0060d2ir/compile.go:893\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":"d2ir/compile.go"},"region":{"startLine":893}}}],"partialFingerprints":{"codehealthFindingId/v1":"4b4c689d4a6afd88ae9513a5140ce132c9e3bbe3dc0f1b5965efc61c4d6f7f8a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): d2oracle/edit.go:2376-2386 | d2oracle/edit.go:2421-2431 \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 \u0060d2oracle/edit.go:2376\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":"d2oracle/edit.go"},"region":{"startLine":2376}}}],"partialFingerprints":{"codehealthFindingId/v1":"6218139c55fc1d33584241f86557720ab9465e11cbdd3330c98949194dda9338"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): d2parser/parse.go:579-589 | d2parser/parse.go:1402-1412 \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 \u0060d2parser/parse.go:579\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":"d2parser/parse.go"},"region":{"startLine":579}}}],"partialFingerprints":{"codehealthFindingId/v1":"a5e3302983e4290e52045e975a683e54980d0684c5f25cb5eff097c33a5673c5"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): d2plugin/exec.go:173-183 | d2plugin/exec.go:249-259 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2plugin/exec.go:173\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":"d2plugin/exec.go"},"region":{"startLine":173}}}],"partialFingerprints":{"codehealthFindingId/v1":"269b84e8ad6e6f29d6bf103b61d0ec48692043db9e2422891500a9504dd0676b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): d2renderers/d2sketch/sketch.go:110-120 | d2renderers/d2sketch/sketch.go:185-195 \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 \u0060d2renderers/d2sketch/sketch.go:110\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":"d2renderers/d2sketch/sketch.go"},"region":{"startLine":110}}}],"partialFingerprints":{"codehealthFindingId/v1":"7fe64913954cc9eaff92529208e8d72a70cda5c79db77ee9dbdee86330fec455"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): d2renderers/d2svg/class.go:154-164 | d2renderers/d2svg/table.go:172-182 \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 \u0060d2renderers/d2svg/class.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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svg/class.go"},"region":{"startLine":154}}}],"partialFingerprints":{"codehealthFindingId/v1":"b5771934d139b977539e22bf7811af8ebb3e79e67dbc39e617c7aa0a8eade3ac"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): d2renderers/d2svg/d2svg.go:1161-1171 | d2renderers/d2svg/d2svg.go:2011-2021 \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 \u0060d2renderers/d2svg/d2svg.go:1161\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":"d2renderers/d2svg/d2svg.go"},"region":{"startLine":1161}}}],"partialFingerprints":{"codehealthFindingId/v1":"640c32ac5c0a7b2435410c723dc6bb224655fa568b1c5895518ef8a5db213e2f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): d2renderers/d2svg/d2svg.go:2023-2033 | d2renderers/d2svg/d2svg.go:2048-2058 \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 \u0060d2renderers/d2svg/d2svg.go:2023\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":"d2renderers/d2svg/d2svg.go"},"region":{"startLine":2023}}}],"partialFingerprints":{"codehealthFindingId/v1":"e7e60ffca574291c10b5810edcf6e8c2b0ed9ab889ea5240bbf2164e13de7520"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): d2cli/main.go:605-615 | d2cli/main.go:689-699 \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 \u0060d2cli/main.go:605\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":"d2cli/main.go"},"region":{"startLine":605}}}],"partialFingerprints":{"codehealthFindingId/v1":"26a05095b03b662e19385582b527b5b7e1ed8653f69c7f057bb9ca57ec45a64f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): d2cli/main.go:719-729 | d2cli/main.go:832-842 \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 \u0060d2cli/main.go:719\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":"d2cli/main.go"},"region":{"startLine":719}}}],"partialFingerprints":{"codehealthFindingId/v1":"48be0f24bd3434354d1636d6d9b7818a0b733d69425d8e8e6f082b5ac2df8706"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): d2ast/d2ast.go:840-849 | d2ast/d2ast.go:932-941 \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 \u0060d2ast/d2ast.go:840\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":"d2ast/d2ast.go"},"region":{"startLine":840}}}],"partialFingerprints":{"codehealthFindingId/v1":"02f370f7adf157565586dc14f0198ffb3a39bec1b1455ca8eaf906ac6d8d8b4d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): d2ir/compile.go:1113-1122 | d2ir/compile.go:1167-1176 \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 \u0060d2ir/compile.go:1113\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":"d2ir/compile.go"},"region":{"startLine":1113}}}],"partialFingerprints":{"codehealthFindingId/v1":"c361daad5e12c597da87e9097f868c0f96d82eb5389550357ea3a99ab9301ca9"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): d2ir/d2ir.go:977-987 | d2ir/d2ir.go:1034-1043 \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 \u0060d2ir/d2ir.go:977\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":"d2ir/d2ir.go"},"region":{"startLine":977}}}],"partialFingerprints":{"codehealthFindingId/v1":"1e02a8b1182024049074a9ec2e3765646644f1a59bbcd9b8904353d1da66b4b5"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): d2ir/d2ir.go:1951-1960 | d2ir/d2ir.go:1962-1971 \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 \u0060d2ir/d2ir.go:1951\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":"d2ir/d2ir.go"},"region":{"startLine":1951}}}],"partialFingerprints":{"codehealthFindingId/v1":"4800c7d71a91625d65bcd21f6746fe4e643f3de340231d543a990d11a73341c9"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): d2oracle/edit.go:2855-2864 | d2oracle/edit.go:3061-3070 \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":"d2oracle/edit.go"},"region":{"startLine":2855}}}],"partialFingerprints":{"codehealthFindingId/v1":"42b46710b9883f18a569014973f86c2b80d0fdad132bfb2bae0a00d805cdbc15"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): d2parser/parse.go:519-528 | d2parser/parse.go:1337-1346 \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 \u0060d2parser/parse.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. 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":"d2parser/parse.go"},"region":{"startLine":519}}}],"partialFingerprints":{"codehealthFindingId/v1":"e2baaa0a5892af3686b63f213748bd5787410ec1705404ed502f6ef796922f4d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): d2parser/parse.go:1727-1736 | d2parser/parse.go:1777-1786 \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 \u0060d2parser/parse.go:1727\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":"d2parser/parse.go"},"region":{"startLine":1727}}}],"partialFingerprints":{"codehealthFindingId/v1":"c607e629b76ab0aca536e9cc932ff4d3434d5d358d0cd343bda8ece2e8291a47"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): d2renderers/d2sketch/sketch.go:153-162 | d2renderers/d2sketch/sketch.go:277-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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2sketch/sketch.go"},"region":{"startLine":153}}}],"partialFingerprints":{"codehealthFindingId/v1":"fe603150a21371d91816c1656f7e9c7e2609cc593792b0b49a5d8e4c6808849e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): d2renderers/d2svg/class.go:20-29 | d2renderers/d2svg/table.go:48-57 \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 \u0060d2renderers/d2svg/class.go:20\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":"d2renderers/d2svg/class.go"},"region":{"startLine":20}}}],"partialFingerprints":{"codehealthFindingId/v1":"486fa7342aaf356080f56d6d7b1ef9a2a0bbe3f381cd2e4f16211ded07fe22db"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): d2renderers/d2svg/d2svg.go:1243-1252 | d2renderers/d2svg/d2svg.go:2155-2164 \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 \u0060d2renderers/d2svg/d2svg.go:1243\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":"d2renderers/d2svg/d2svg.go"},"region":{"startLine":1243}}}],"partialFingerprints":{"codehealthFindingId/v1":"f288870a75aab76c55090cb6befd370ea1940c68d81cb9f19ffce0cf81e73a52"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): d2renderers/d2svg/d2svg.go:1800-1809 | d2renderers/d2svg/d2svg.go:1830-1839 \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":"d2renderers/d2svg/d2svg.go"},"region":{"startLine":1800}}}],"partialFingerprints":{"codehealthFindingId/v1":"88e3d7db0142cdd6361e162f1b5a865a9a9c0c2782c1ae11e24e22dad206d62a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): lib/geo/bezier.go:186-195 | lib/geo/bezier.go:262-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 \u0060lib/geo/bezier.go:186\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":"lib/geo/bezier.go"},"region":{"startLine":186}}}],"partialFingerprints":{"codehealthFindingId/v1":"235e2395f2fbb6d7296473e1fcb75d5482f7fc1a2217e884a2a2bb7c0e4b0640"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): d2renderers/d2ascii/asciiroute/routing.go:197-206 | d2renderers/d2ascii/asciiroute/routing.go:271-280 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2renderers/d2ascii/asciiroute/routing.go:197\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":"d2renderers/d2ascii/asciiroute/routing.go"},"region":{"startLine":197}}}],"partialFingerprints":{"codehealthFindingId/v1":"90047c11e411f1618351c74f9466d6007b9370399801aeefb2e9b4b576b3412f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 3): d2oracle/edit.go:2066-2074 | d2oracle/edit.go:2080-2088 | d2oracle/edit.go:2092-2100 \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. 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":"d2oracle/edit.go"},"region":{"startLine":2066}}}],"partialFingerprints":{"codehealthFindingId/v1":"a02af154ccf94e4d0586007bdfc7282d304d23a2c4c3a77606aee4c5e1844042"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): d2compiler/compile.go:1050-1058 | d2compiler/compile.go:1079-1087 \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 \u0060d2compiler/compile.go:1050\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":"d2compiler/compile.go"},"region":{"startLine":1050}}}],"partialFingerprints":{"codehealthFindingId/v1":"6365d6e7a99709b2522c6b3941e15f38fd905223503a786f67c75d4c595868f4"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): d2ir/d2ir.go:847-855 | d2ir/d2ir.go:1261-1269 \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":"d2ir/d2ir.go"},"region":{"startLine":847}}}],"partialFingerprints":{"codehealthFindingId/v1":"3d623e2379629604df76f2886e60c803aa7952399789a6ccbc28c78a0a1e35c6"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): d2ir/d2ir.go:1201-1209 | d2ir/d2ir.go:1297-1305 \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 \u0060d2ir/d2ir.go:1201\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":"d2ir/d2ir.go"},"region":{"startLine":1201}}}],"partialFingerprints":{"codehealthFindingId/v1":"c37b4b5656d716e18fc6e9bad775951dffc92ccabe4336be9c84f6114154f58e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): d2ir/d2ir.go:1286-1294 | d2ir/d2ir.go:1403-1411 \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 \u0060d2ir/d2ir.go:1286\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":"d2ir/d2ir.go"},"region":{"startLine":1286}}}],"partialFingerprints":{"codehealthFindingId/v1":"22d8e233675c1189c765cb529d9933333a237e0840ad8f4b0cf054332fe9f95a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): d2layouts/d2dagrelayout/layout.go:1182-1190 | d2layouts/d2dagrelayout/layout.go:1193-1202 \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":"d2layouts/d2dagrelayout/layout.go"},"region":{"startLine":1182}}}],"partialFingerprints":{"codehealthFindingId/v1":"861685cca033a3d79c668d6cf7b7c13af4dccef3cef9c623346e52a6141c928f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): d2layouts/d2dagrelayout/layout.go:1682-1690 | d2layouts/d2dagrelayout/layout.go:1776-1784 \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 \u0060d2layouts/d2dagrelayout/layout.go:1682\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":"d2layouts/d2dagrelayout/layout.go"},"region":{"startLine":1682}}}],"partialFingerprints":{"codehealthFindingId/v1":"4dc36adee98710aa19880233fe6caa087794d4463b82a71cdee9e50c986be89d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): d2oracle/edit.go:186-194 | d2oracle/edit.go:2570-2578 \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 \u0060d2oracle/edit.go:186\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":"d2oracle/edit.go"},"region":{"startLine":186}}}],"partialFingerprints":{"codehealthFindingId/v1":"b8756ae0cb27b04689b5ea95e8d86f7665bf6978912581c7f01fb0fb156161d1"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): d2oracle/edit.go:198-206 | d2oracle/edit.go:2583-2591 \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 \u0060d2oracle/edit.go:198\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":"d2oracle/edit.go"},"region":{"startLine":198}}}],"partialFingerprints":{"codehealthFindingId/v1":"3815515077f4cbbcb84618618f156865ac2db05cc202d7bd1927e096f62249f3"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): d2plugin/exec.go:55-63 | d2plugin/exec.go:128-136 \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":"d2plugin/exec.go"},"region":{"startLine":55}}}],"partialFingerprints":{"codehealthFindingId/v1":"d877491d6244ca83150328bbb86a9586f470fde232a9b858578cf0494ae2a2a5"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): d2renderers/d2ascii/d2ascii.go:182-190 | d2renderers/d2ascii/d2ascii.go:202-210 \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 \u0060d2renderers/d2ascii/d2ascii.go:182\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":"d2renderers/d2ascii/d2ascii.go"},"region":{"startLine":182}}}],"partialFingerprints":{"codehealthFindingId/v1":"7c38c452090159e32d60eef5b45e63234616ab60449fe4dd0fbe190b4f28193d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): d2renderers/d2ascii/d2ascii.go:378-386 | d2renderers/d2ascii/d2ascii.go:395-403 \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":"d2renderers/d2ascii/d2ascii.go"},"region":{"startLine":378}}}],"partialFingerprints":{"codehealthFindingId/v1":"f814156dde98e23b008b548e14b8643d8c6c0608bd5689f9826d6a16c10e58bd"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): d2renderers/d2sketch/sketch.go:166-174 | d2renderers/d2sketch/sketch.go:290-298 \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 \u0060d2renderers/d2sketch/sketch.go:166\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":"d2renderers/d2sketch/sketch.go"},"region":{"startLine":166}}}],"partialFingerprints":{"codehealthFindingId/v1":"a3f066d1a0d09b5780347b6f09a3f8588e199d40abc01f0d74bef84339ee452a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): d2renderers/d2svg/class.go:101-109 | d2renderers/d2svg/table.go:120-128 \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 \u0060d2renderers/d2svg/class.go:101\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svg/class.go"},"region":{"startLine":101}}}],"partialFingerprints":{"codehealthFindingId/v1":"e3e812db6c0f38dea1c4ede100aef0f02fefc68af2f8f715f3aee5b25fa3a886"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): d2renderers/d2svg/d2svg.go:1773-1781 | d2renderers/d2svg/d2svg.go:1822-1830 \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 \u0060d2renderers/d2svg/d2svg.go:1773\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":"d2renderers/d2svg/d2svg.go"},"region":{"startLine":1773}}}],"partialFingerprints":{"codehealthFindingId/v1":"fa43a0dc381dbc5ec2ec2803c1872e16026f36ee3de1ef858c31bc5f59ba8f96"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): d2cli/main.go:707-715 | d2cli/main.go:814-822 \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 \u0060d2cli/main.go:707\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":"d2cli/main.go"},"region":{"startLine":707}}}],"partialFingerprints":{"codehealthFindingId/v1":"71eaac31b66502254e7a8cb974b30840490f0047e8f886a12221b4a85861aba9"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): d2cli/main.go:1234-1242 | d2cli/main.go:1246-1254 \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 \u0060d2cli/main.go:1234\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":"d2cli/main.go"},"region":{"startLine":1234}}}],"partialFingerprints":{"codehealthFindingId/v1":"ccd23420bf2abffbdc0a6a56ba7bd7dc8b75fddb59b031b089ee52497fe858d2"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): d2ir/merge.go:8-16 | d2ir/merge.go:38-49 \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 \u0060d2ir/merge.go:8\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":"d2ir/merge.go"},"region":{"startLine":8}}}],"partialFingerprints":{"codehealthFindingId/v1":"a7e74a85517e734d61e3beda5d6823346ac9128f1ec907ad81956aa222b58e9f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): d2renderers/d2ascii/asciishapes/class.go:20-28 | d2renderers/d2ascii/asciishapes/sqltable.go:19-27 \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 \u0060d2renderers/d2ascii/asciishapes/class.go:20\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":"d2renderers/d2ascii/asciishapes/class.go"},"region":{"startLine":20}}}],"partialFingerprints":{"codehealthFindingId/v1":"86d4925937436bde992eb527c32f232bfd78504593fe72cf678088b66b36c692"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 3): d2ir/d2ir.go:1190-1197 | d2ir/d2ir.go:1286-1293 | d2ir/d2ir.go:1403-1410 \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 \u0060d2ir/d2ir.go:1190\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":"d2ir/d2ir.go"},"region":{"startLine":1190}}}],"partialFingerprints":{"codehealthFindingId/v1":"f88be44bfc29e9cf283fbe249de3dcbabba45979c7db2c4e488d77be64aa0867"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): d2compiler/compile.go:456-463 | d2compiler/compile.go:624-631 \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 \u0060d2compiler/compile.go:456\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":"d2compiler/compile.go"},"region":{"startLine":456}}}],"partialFingerprints":{"codehealthFindingId/v1":"cd98f463bdd42741bf6b7896240786b0479907ced7c4eac2b3825bee882efcf6"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): d2graph/d2graph.go:1900-1907 | d2graph/layout.go:298-305 \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 \u0060d2graph/d2graph.go:1900\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":"d2graph/d2graph.go"},"region":{"startLine":1900}}}],"partialFingerprints":{"codehealthFindingId/v1":"e6f79fc97f70df693d8cbfb49176d148039aab43ada2b595b4ee797cf82233ed"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): d2ir/compile.go:1418-1425 | d2ir/compile.go:1435-1442 \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 \u0060d2ir/compile.go:1418\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":"d2ir/compile.go"},"region":{"startLine":1418}}}],"partialFingerprints":{"codehealthFindingId/v1":"763bd2e2c367024b976d5044f37a3d227d467b9505ae78809637d6e436bafadb"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): d2layouts/d2dagrelayout/layout.go:326-333 | d2layouts/d2elklayout/layout.go:619-626 \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 \u0060d2layouts/d2dagrelayout/layout.go:326\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":"d2layouts/d2dagrelayout/layout.go"},"region":{"startLine":326}}}],"partialFingerprints":{"codehealthFindingId/v1":"2505da412f3b3518e88af3580e8465c2eebce540a7375bb3b1f3c33e04eb062d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): d2layouts/d2dagrelayout/layout.go:552-559 | d2layouts/d2elklayout/layout.go:1116-1123 \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 \u0060d2layouts/d2dagrelayout/layout.go:552\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":"d2layouts/d2dagrelayout/layout.go"},"region":{"startLine":552}}}],"partialFingerprints":{"codehealthFindingId/v1":"e69ed048d241fc75dbfea7b7232ce48a40d3498aba38fd69a567fad033aa601b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): d2oracle/edit.go:1238-1246 | d2oracle/edit.go:1257-1264 \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 \u0060d2oracle/edit.go:1238\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":"d2oracle/edit.go"},"region":{"startLine":1238}}}],"partialFingerprints":{"codehealthFindingId/v1":"ce0d99b06550f5c799909e8eec3dcd35d8acec44c77e0cbe8b42d72012910d88"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): d2renderers/d2sketch/sketch.go:398-405 | d2renderers/d2sketch/sketch.go:407-414 \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. 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":"d2renderers/d2sketch/sketch.go"},"region":{"startLine":398}}}],"partialFingerprints":{"codehealthFindingId/v1":"17c3289f5e224fd69f6d62f76588e49d0c846ccc50fe50bd153f662e9e66dc82"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): d2renderers/d2sketch/sketch.go:476-483 | d2renderers/d2sketch/sketch.go:619-626 \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":"d2renderers/d2sketch/sketch.go"},"region":{"startLine":476}}}],"partialFingerprints":{"codehealthFindingId/v1":"9045d6e4c307f26d13c5638211fb6de54ecac582c54d063fc74e5a80bf9be57c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): d2renderers/d2svg/d2svg.go:666-673 | d2renderers/d2svg/d2svg.go:770-777 \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":"d2renderers/d2svg/d2svg.go"},"region":{"startLine":666}}}],"partialFingerprints":{"codehealthFindingId/v1":"c13d15c999a05b640cff85eac8268a1e7ee97a9e36ad782592c378cea004ef23"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): d2renderers/d2svg/d2svg.go:1413-1420 | d2renderers/d2svg/d2svg.go:1522-1529 \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":"d2renderers/d2svg/d2svg.go"},"region":{"startLine":1413}}}],"partialFingerprints":{"codehealthFindingId/v1":"0dcead53a10f953bed805aec9c781efa9c452b35b5e3adce150f206757078257"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): lib/color/gradient.go:135-143 | lib/color/gradient.go:222-229 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060lib/color/gradient.go:135\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":"lib/color/gradient.go"},"region":{"startLine":135}}}],"partialFingerprints":{"codehealthFindingId/v1":"e8fa0a6e4227d3adba39b09019736ba065e547de4d169f3d68531816d9b72b6f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): lib/font/subsetFont.go:778-785 | lib/font/subsetFont.go:792-799 \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 \u0060lib/font/subsetFont.go:778\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":"lib/font/subsetFont.go"},"region":{"startLine":778}}}],"partialFingerprints":{"codehealthFindingId/v1":"7589eb5dfaeb79b545e04c96ee9cb57b243d26e9fae9b5bcfa1bb95eadeb3289"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): d2ir/import.go:21-28 | d2ir/import.go:134-141 \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 \u0060d2ir/import.go:21\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":"d2ir/import.go"},"region":{"startLine":21}}}],"partialFingerprints":{"codehealthFindingId/v1":"0349c049428c7007b4ce8f38c5c15fc932d6201930b7fb39c8cdbf8f1ca98c28"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 3): d2renderers/d2ascii/asciishapes/helpers.go:26-32 | d2renderers/d2ascii/asciishapes/package.go:17-23 | d2renderers/d2ascii/asciishapes/page.go:24-30 \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 \u0060d2renderers/d2ascii/asciishapes/helpers.go:26\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":"d2renderers/d2ascii/asciishapes/helpers.go"},"region":{"startLine":26}}}],"partialFingerprints":{"codehealthFindingId/v1":"081a71f19f6526ccdb036b43657aeb0de2d9254a4b3289ecbefadab6b40d5904"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): d2layouts/d2dagrelayout/layout.go:1097-1103 | d2layouts/d2dagrelayout/layout.go:1139-1145 \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 \u0060d2layouts/d2dagrelayout/layout.go:1097\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":"d2layouts/d2dagrelayout/layout.go"},"region":{"startLine":1097}}}],"partialFingerprints":{"codehealthFindingId/v1":"c27c76562297bbc44b72ad1b19216370a156dda0b8a93effe03d0d0742bc1251"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): d2oracle/edit.go:1836-1843 | d2oracle/edit.go:2795-2801 \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":"d2oracle/edit.go"},"region":{"startLine":1836}}}],"partialFingerprints":{"codehealthFindingId/v1":"cdfd411c3e51a975e625389b8b88df6b91f6c4935d383fe0b0a67dc92fabbae8"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): d2renderers/d2svg/d2svg.go:1429-1436 | d2renderers/d2svg/d2svg.go:1553-1559 \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 \u0060d2renderers/d2svg/d2svg.go:1429\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":"d2renderers/d2svg/d2svg.go"},"region":{"startLine":1429}}}],"partialFingerprints":{"codehealthFindingId/v1":"06dd4389f7de1067b5f1fdd8edfbc828822c29783cbfbe0dbb2b5a33566df226"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): d2renderers/d2svg/d2svg.go:2203-2209 | d2renderers/d2svg/table.go:19-25 \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 \u0060d2renderers/d2svg/d2svg.go:2203\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":"d2renderers/d2svg/d2svg.go"},"region":{"startLine":2203}}}],"partialFingerprints":{"codehealthFindingId/v1":"395335b3f573e77e22d451f0b9f1dad309e7a8bf06966da9ac07908e32f0aa0f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): d2cli/main.go:859-865 | d2cli/main.go:866-872 \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 \u0060d2cli/main.go:859\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":"d2cli/main.go"},"region":{"startLine":859}}}],"partialFingerprints":{"codehealthFindingId/v1":"b5bbbba816d038d6cb1a2ce202b897dd9ba3442cd7b02d8a20d45a0d67921615"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): d2cli/main.go:1096-1102 | d2cli/main.go:1106-1112 \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 \u0060d2cli/main.go:1096\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":"d2cli/main.go"},"region":{"startLine":1096}}}],"partialFingerprints":{"codehealthFindingId/v1":"7194caee7a512810f4a981010f97046abe91261a8001de48c2cc100c84762841"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 3): d2cli/main.go:1063-1068 | d2cli/main.go:1171-1176 | d2cli/main.go:1466-1471 \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 \u0060d2cli/main.go:1063\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":"d2cli/main.go"},"region":{"startLine":1063}}}],"partialFingerprints":{"codehealthFindingId/v1":"f14689eb2313fc4af83de2b812a0c637e37ddc22ab42f04994911bf0fd5410e1"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): d2exporter/export.go:153-158 | d2exporter/export.go:388-394 \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":"d2exporter/export.go"},"region":{"startLine":153}}}],"partialFingerprints":{"codehealthFindingId/v1":"508757f8dfe43fdb6c260284e89940905d8c7ccb6110f57e4c3ec917e06f8910"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): d2graph/d2graph.go:1930-1935 | d2graph/layout.go:341-346 \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 \u0060d2graph/d2graph.go:1930\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":"d2graph/d2graph.go"},"region":{"startLine":1930}}}],"partialFingerprints":{"codehealthFindingId/v1":"636a43cce5a24019e91f2da59ece65f256cb9eb5627baf275bd90689c151ebb1"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): d2layouts/d2elklayout/layout.go:739-744 | d2layouts/d2elklayout/layout.go:842-847 \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":"d2layouts/d2elklayout/layout.go"},"region":{"startLine":739}}}],"partialFingerprints":{"codehealthFindingId/v1":"213e4a80296b0b44ce53066d12eecadff195fb3c1a519cf8210dea7ce36861db"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): d2layouts/d2elklayout/layout.go:846-851 | d2layouts/d2elklayout/layout.go:853-858 \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":"d2layouts/d2elklayout/layout.go"},"region":{"startLine":846}}}],"partialFingerprints":{"codehealthFindingId/v1":"6c8f2fb1132ac0964f63add4e5021d7e46645b011ea54b21a8a125091b5cc1d0"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): d2oracle/edit.go:1193-1198 | d2oracle/edit.go:2042-2047 \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 \u0060d2oracle/edit.go:1193\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":"d2oracle/edit.go"},"region":{"startLine":1193}}}],"partialFingerprints":{"codehealthFindingId/v1":"bf5827de72f4c4a6296b31b73c67bf3d5378edb324c4d0c87ac1bff3f0166615"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): d2oracle/edit.go:1577-1582 | d2oracle/edit.go:1584-1589 \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":"d2oracle/edit.go"},"region":{"startLine":1577}}}],"partialFingerprints":{"codehealthFindingId/v1":"6d45b138fd4f30cabfcfc334f78767c0131d8b3ae6c6dd965eff901bfa2e103f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): d2renderers/d2sketch/sketch.go:606-612 | d2renderers/d2svg/class.go:108-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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2sketch/sketch.go"},"region":{"startLine":606}}}],"partialFingerprints":{"codehealthFindingId/v1":"aebfe32be23ff0dff914a692d66a547510345673abfe54209dc7d8f73715c727"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): d2renderers/d2svg/class.go:134-140 | d2renderers/d2svg/table.go:159-164 \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 \u0060d2renderers/d2svg/class.go:134\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":"d2renderers/d2svg/class.go"},"region":{"startLine":134}}}],"partialFingerprints":{"codehealthFindingId/v1":"f0576955195c20fef590018255ef56c0872a6711937bbd030879ca452badf069"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): d2renderers/d2svg/d2svg.go:1759-1764 | d2renderers/d2svg/d2svg.go:1796-1801 \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 \u0060d2renderers/d2svg/d2svg.go:1759\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":"d2renderers/d2svg/d2svg.go"},"region":{"startLine":1759}}}],"partialFingerprints":{"codehealthFindingId/v1":"9343b19a228d876f844bf9de215b32f0f7d6973aac6606fcde74e63820d6d845"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): lib/shape/shape_circle.go:26-31 | lib/shape/shape_oval.go:28-33 \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":"lib/shape/shape_circle.go"},"region":{"startLine":26}}}],"partialFingerprints":{"codehealthFindingId/v1":"975100ad45796a73b2e0f123d81e6cb7a9ffda7c36aefa6544989445e4f6966a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): d2renderers/d2ascii/asciishapes/class.go:14-19 | d2renderers/d2ascii/asciishapes/sqltable.go:13-18 \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 \u0060d2renderers/d2ascii/asciishapes/class.go:14\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":"d2renderers/d2ascii/asciishapes/class.go"},"region":{"startLine":14}}}],"partialFingerprints":{"codehealthFindingId/v1":"dbf699b66cae180e97245329fb8fe5650f0920befb6799b9a3f767f015e60278"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): d2renderers/d2ascii/asciishapes/helpers.go:58-63 | d2renderers/d2ascii/asciishapes/helpers.go:72-77 \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 \u0060d2renderers/d2ascii/asciishapes/helpers.go:58\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":"d2renderers/d2ascii/asciishapes/helpers.go"},"region":{"startLine":58}}}],"partialFingerprints":{"codehealthFindingId/v1":"c7a02ea76e77f20a81c765efca62adeb1c1991a8f11f28f0e5c04c2db97f6477"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): d2renderers/d2ascii/asciishapes/parallelogram.go:4-9 | d2renderers/d2ascii/asciishapes/queue.go:4-9 \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 \u0060d2renderers/d2ascii/asciishapes/parallelogram.go:4\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":"d2renderers/d2ascii/asciishapes/parallelogram.go"},"region":{"startLine":4}}}],"partialFingerprints":{"codehealthFindingId/v1":"692740fa06af00be074bb4b332784c848195ac3024f8261b14b23c4ae8ca5589"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 3): d2target/d2target.go:254-258 | d2target/d2target.go:261-265 | d2target/d2target.go:268-272 \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":"d2target/d2target.go"},"region":{"startLine":254}}}],"partialFingerprints":{"codehealthFindingId/v1":"048924be0d38164146904d5568870d9efd78c23facd77506ed0b65f5ada04ede"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): d2compiler/compile.go:385-389 | d2compiler/compile.go:601-606 \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 \u0060d2compiler/compile.go:601\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":"d2compiler/compile.go"},"region":{"startLine":385}}}],"partialFingerprints":{"codehealthFindingId/v1":"aeae133c621d17faedc494c0213b65447630e3ba845f4afa9ac70db91c3e008d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): d2graph/d2graph.go:1353-1357 | d2graph/d2graph.go:1367-1371 \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 \u0060d2graph/d2graph.go:1353\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":"d2graph/d2graph.go"},"region":{"startLine":1353}}}],"partialFingerprints":{"codehealthFindingId/v1":"ff1f81d2d65b90115fca97bd64e09c718c5f0a2bfaca400a01f0d3023cde9c90"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): d2layouts/d2dagrelayout/layout.go:547-551 | d2layouts/d2grid/layout.go:192-197 \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 \u0060d2layouts/d2dagrelayout/layout.go:547\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":"d2layouts/d2dagrelayout/layout.go"},"region":{"startLine":547}}}],"partialFingerprints":{"codehealthFindingId/v1":"60738d049e93fa3375c4379ce897444e7b4e1780a6a64e0a3b390718ee803eaf"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): d2layouts/d2grid/layout.go:158-162 | d2layouts/d2layouts.go:351-355 \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 \u0060d2layouts/d2grid/layout.go:158\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":"d2layouts/d2grid/layout.go"},"region":{"startLine":158}}}],"partialFingerprints":{"codehealthFindingId/v1":"b27c61f7e69fe0bfdaa767ca4bd6bc53e6504f562e56096a549e47129ba9d7ee"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): d2renderers/d2svg/d2svg.go:1382-1386 | d2renderers/d2svg/d2svg.go:1478-1482 \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 \u0060d2renderers/d2svg/d2svg.go:1382\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":"d2renderers/d2svg/d2svg.go"},"region":{"startLine":1382}}}],"partialFingerprints":{"codehealthFindingId/v1":"ea4654878e45d970aa6208ae85c0e3bc187ca92a24e8e37769b38b964c1ca658"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: d2cli/main.go: d2cli/main.go changed 3 times in last 90 days, max complexity 89. 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":"d2cli/main.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"314bfa2737e3cd8851bf1af89131f83dcea830feb4c5e75b0b3ab2a14dc24565"}},{"ruleId":"D16","level":"note","message":{"text":"Off-boarding risk: anonymized user #1: If anonymized user #1 becomes unavailable, 19 significant file(s) lose their only recent owner: d2oracle/edit.go, d2ir/compile.go, d2renderers/d2ascii/d2ascii.go, d2lsp/completion.go, d2renderers/d2ascii/asciiroute/routing.go, d2renderers/d2ascii/asciiroute/drawing.go, lib/pptx/validate.go, lib/png/png.go (\u002B11 more). Pair on, review, or document these before any departure."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"9a086412ccee852f8558d9d17b5f31b68ca1b5440b5e8c19b2adb9c80ad5123e"}},{"ruleId":"D16","level":"note","message":{"text":"Further sole-owners (lower concentration): 2 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 (22 single-owned of 82 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 #2 (2 file(s)), anonymized user #3 (1 file(s)) \u2014 spread or document their files in the same way, at lower priority than the named off-boarding risks above."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"6eac528f2429e724e1a97ed868f79eefbcf1888dab4af9a9e673429369bb5b2f"}},{"ruleId":"D19","level":"note","message":{"text":"The library examples directory is referenced but only one example (1-d2lib) is shown with no links to the other two (d2oracle, lowlevel).: Link each of the three examples in this directory so readers can find them without scanning through the README."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/examples/lib/README.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"d95a1f5964c61355f2a9555cd168a9550c9809b02a81e43083aef477abcd68ae"}},{"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":"7ceee73d76663034321cbd3b5bbecae8b673163039b70b12462f979a331e73d3"},"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":"59827f28114b04b486753897f461d483d2f8bf72229b20db4bcb85f5b72e54b7"},"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":"eb56f2e44d0085df25826e32c71a62971b1cb2c7a5b691fdebd076fa9e819c18"},"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":"8eb50784ab958284eb3ecd7050384e4061ddeae0c76cf46d9d242ff3f816fc6b"},"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":"4e5ba20d569d258ae6d0a24953bb1bf2096a834bc4a53403da7c12ca10d2411b"},"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":"02b85025e6350812172698464709bb88e59d888f78f360fd7d515e9b169e055d"},"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":"8245b74c599de94cd012d9f3d61ba2c3895300d0f3e2d40e5bb99a02fef5bdcf"},"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":"c9d2e2e44e0126fbfe4363adac776b3c95b8a286a38e060f8aa99ffc539a3d16"},"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":"a537cb23baf5fe90a79a5533849cdedb68bcacd9706d36b01a2f2b47f9e0c969"},"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":"bc2008f87eb8d5fcb1baf51295065d475c52b4d6ec5cd9f164b81a88bd8b44b2"},"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":"1bd6d29e8d99fd45b9f2a8f1c6baaf39de41bd0076339e025fbb9800d72e4917"},"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":"648636af91a81dd40b6c38cacceea4526231fe8e8c40204099c31aa957c97f4a"},"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":"3c9148d2deade10f60781298593bc4c83aa266f242490c12c0671cb4a0fdb68e"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"a25f63c8c63f77a0c1373d29af3c561d24e4ca61ab37a01b63e70e37a64e792f"},"taxa":[{"id":"CWE-338","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"21566055bff529a2bbdcac87a5acad0ed0d48ff42ba1b5f4b516530b774d780a"},"taxa":[{"id":"CWE-79","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"cbb230bfce47957c76caeaa9d9c6d69fea17c7092f12cf40ddabbf062eb11673"},"taxa":[{"id":"CWE-328","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"f3d30e9fd8a435ba84922693c4122d64fb71693a76d8d47e72cf5c7bac77905b"},"taxa":[{"id":"CWE-400","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":"d18f6cbb81e243b5da20020101b3375e995e269238f7655dbb23ddc4d9a672d4"}},{"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":"e3514b1e02638389ba7b3baab8a2a2897abae608902d525f0c1e73660928253d"}},{"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":"38f81ce3251537dceb88c26a3ac1d94bef1ea4ab675fc1547464cb9edc2dadde"}},{"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":"45c53518c9f463e1ca1de1abe98e0ecff1405b671ca88499d745d44c28abcbc1"}},{"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":"11b2245f2a5b20753b2743d743b81727b6b39ad06d991e65f07ff30d4c5e4eaf"}},{"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":"5d9a3bebb142d353e80e924dd5a7dec84da983b3d9c5da4effadb251191f83a6"}},{"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":"7e6970c21844fbe21ade5bde072043d6ae8e4910744d74533755615dc66da80c"}},{"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":"110684c7f1d2da679ad648efa8d73479708e3c2c1bc7869cc29f5dabcbdba6fc"}},{"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":"776c0646c6093c8b5ae90022982f08c5338a28827795ad99106958da099e7e6d"}},{"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":"b91ead4de1c9e3dd1f7f149c29e78f514ccd31ddeafe2f37c675afeac6ee3be4"}},{"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":"d661b34a74f2a5c2ccb55708870bbc31f67d0ffd8599e0ef2dc17e1791022c1f"}},{"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":"lib/font/subsetFont.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"8c3069c9cef3be9533bed75c1ee6ceb29e66f3b690a492cb73e01a88bcf923bb"}},{"ruleId":"D34","level":"note","message":{"text":"Further orphaned files (smaller): 3 smaller file(s) also have no living knowledge \u2014 folded into the freshness score and metrics rather than listed individually (4 orphaned of 82 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: class.go \u2194 table.go: \u0060d2renderers/d2svg/class.go\u0060 and \u0060d2renderers/d2svg/table.go\u0060 change together 75% of the time (15 of the 20 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":"d2renderers/d2svg/class.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"2ecf8c1db6a211ee20083c4dd52810da68803afc41afcd96863b63ab8387a688"}},{"ruleId":"D36","level":"note","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"eb00976a698a5d68999b7ee6d27206fd374e916853e7ff1ead5eed42386f043f"}},{"ruleId":"D36","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"90f83b4fa27db32740afe9540c905f3c0499caed87f61049a8a903ecc95b41c3"}},{"ruleId":"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":"2e713568f92ceba89e04ad04b5d4791a1fa0236e7a475eb8e0d16f0950ff7d67"}},{"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":"510bb401a969ac852411378ef48f6a3eb103efc6a53c3f02b78552d692165ae7"}},{"ruleId":"D38","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"ba0695644397eab358c67149e6d936cb8b6b648c1f9c8b9bfa34a8138855768a"}},{"ruleId":"D38","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"be217444638ac33aa1bd5044cfc99a2e92b284c1cc1654e8220d2ef2ef47944d"}},{"ruleId":"D38","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"231ad4dc838e4a2768e6f7a1e67ca410b16632a9e046ea516d551978147d4308"}},{"ruleId":"D38","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"626e01eacf94c3b3382809ff8a91277880813d4497b12c2cdcf28b0d8c94458b"}}],"taxonomies":[{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d","organization":"MITRE","informationUri":"https://cwe.mitre.org/","isComprehensive":false,"shortDescription":{"text":"The MITRE Common Weakness Enumeration (CWE)."},"taxa":[{"id":"CWE-1032","guid":"5f21e517-68aa-a650-9a25-5771ef024637","name":"OWASP Top Ten \u2014 Security Misconfiguration category","shortDescription":{"text":"OWASP Top Ten \u2014 Security Misconfiguration category"},"helpUri":"https://cwe.mitre.org/data/definitions/1032.html"},{"id":"CWE-1357","guid":"e4d2e772-757e-0a5c-bd7d-77052949d866","name":"Reliance on Insufficiently Trustworthy Component","shortDescription":{"text":"Reliance on Insufficiently Trustworthy Component"},"helpUri":"https://cwe.mitre.org/data/definitions/1357.html"},{"id":"CWE-1395","guid":"800e09e7-c11a-8654-9fa6-86f398995fed","name":"Dependency on Vulnerable Third-Party Component","shortDescription":{"text":"Dependency on Vulnerable Third-Party Component"},"helpUri":"https://cwe.mitre.org/data/definitions/1395.html"},{"id":"CWE-16","guid":"659db3ea-affc-8453-8add-c1218fbfcb92","name":"Configuration","shortDescription":{"text":"Configuration"},"helpUri":"https://cwe.mitre.org/data/definitions/16.html"},{"id":"CWE-259","guid":"ae9ad959-fbb6-9d5e-892d-3dca66da0b69","name":"Use of Hard-coded Password","shortDescription":{"text":"Use of Hard-coded Password"},"helpUri":"https://cwe.mitre.org/data/definitions/259.html"},{"id":"CWE-328","guid":"f0ffc869-97c3-dc5c-8825-be1159f1fc5f","name":"CWE-328","shortDescription":{"text":"CWE-328"},"helpUri":"https://cwe.mitre.org/data/definitions/328.html"},{"id":"CWE-338","guid":"e89b7604-c3f7-8b53-bc8c-4d4718c28617","name":"CWE-338","shortDescription":{"text":"CWE-338"},"helpUri":"https://cwe.mitre.org/data/definitions/338.html"},{"id":"CWE-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-400","guid":"ca529a89-676d-8857-aac1-84359c77bb6c","name":"CWE-400","shortDescription":{"text":"CWE-400"},"helpUri":"https://cwe.mitre.org/data/definitions/400.html"},{"id":"CWE-494","guid":"b8a65e0d-e459-4a55-a931-fc1136482375","name":"Download of Code Without Integrity Check","shortDescription":{"text":"Download of Code Without Integrity Check"},"helpUri":"https://cwe.mitre.org/data/definitions/494.html"},{"id":"CWE-732","guid":"1da27e8f-b330-7650-ab63-bd61953eae5d","name":"Incorrect Permission Assignment for Critical Resource","shortDescription":{"text":"Incorrect Permission Assignment for Critical Resource"},"helpUri":"https://cwe.mitre.org/data/definitions/732.html"},{"id":"CWE-77","guid":"332c8ade-6612-9f56-a06b-d8d90b1a8750","name":"Command Injection","shortDescription":{"text":"Command Injection"},"helpUri":"https://cwe.mitre.org/data/definitions/77.html"},{"id":"CWE-78","guid":"2e31ceaf-c7ae-2e5e-9661-cfb1362789cf","name":"OS Command Injection","shortDescription":{"text":"OS Command Injection"},"helpUri":"https://cwe.mitre.org/data/definitions/78.html"},{"id":"CWE-79","guid":"fd45580b-e8c4-fc5e-8c2f-aa8fab0b4dbf","name":"Cross-site Scripting (XSS)","shortDescription":{"text":"Cross-site Scripting (XSS)"},"helpUri":"https://cwe.mitre.org/data/definitions/79.html"},{"id":"CWE-798","guid":"5e8f057d-fee3-995a-a0cb-9fc5b0d174d1","name":"Use of Hard-coded Credentials","shortDescription":{"text":"Use of Hard-coded Credentials"},"helpUri":"https://cwe.mitre.org/data/definitions/798.html"},{"id":"CWE-89","guid":"6d08fdad-37eb-c150-bbf0-d7d946863407","name":"SQL Injection","shortDescription":{"text":"SQL Injection"},"helpUri":"https://cwe.mitre.org/data/definitions/89.html"},{"id":"CWE-937","guid":"16f316ae-415c-b354-a59b-1f7905f756e9","name":"Using Components with Known Vulnerabilities","shortDescription":{"text":"Using Components with Known Vulnerabilities"},"helpUri":"https://cwe.mitre.org/data/definitions/937.html"},{"id":"CWE-94","guid":"75e7f50c-6c2f-dd52-bf40-bf6c52b861fd","name":"Code Injection","shortDescription":{"text":"Code Injection"},"helpUri":"https://cwe.mitre.org/data/definitions/94.html"}]}],"properties":{"codehealthPublication":{"public":true,"notice":"This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings \u2014 which rule fired, in which file, on which line, and how to fix it \u2014 are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.","securityFindingsRedacted":36,"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."]}]}