{"$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":"D6","name":"Cohesion (LCOM4)","shortDescription":{"text":"Cohesion (LCOM4)"},"helpUri":"https://codehealth.canine.dev/dimensions/D6"},{"id":"D8","name":"Code Coverage","shortDescription":{"text":"Code Coverage"},"helpUri":"https://codehealth.canine.dev/dimensions/D8"},{"id":"D10","name":"Test Quality","shortDescription":{"text":"Test Quality"},"helpUri":"https://codehealth.canine.dev/dimensions/D10"},{"id":"D11","name":"Test Reliability","shortDescription":{"text":"Test Reliability"},"helpUri":"https://codehealth.canine.dev/dimensions/D11"},{"id":"D12","name":"Dependency Hygiene","shortDescription":{"text":"Dependency Hygiene"},"helpUri":"https://codehealth.canine.dev/dimensions/D12"},{"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"]},{"target":{"id":"A07:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-798","CWE-259"],"owasp":"A07:2025"}},{"id":"D14","name":"License Compliance","shortDescription":{"text":"License Compliance"},"helpUri":"https://codehealth.canine.dev/dimensions/D14"},{"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":"D17","name":"Explicit Debt","shortDescription":{"text":"Explicit Debt"},"helpUri":"https://codehealth.canine.dev/dimensions/D17"},{"id":"D20","name":"ADR Quality","shortDescription":{"text":"ADR Quality"},"helpUri":"https://codehealth.canine.dev/dimensions/D20"},{"id":"D27","name":"Navigability","shortDescription":{"text":"Navigability"},"helpUri":"https://codehealth.canine.dev/dimensions/D27"},{"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"]},{"target":{"id":"A07:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-798","CWE-259"],"owasp":"A07:2025"}},{"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"]},{"target":{"id":"A05:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-79","CWE-89","CWE-78","CWE-94","CWE-77"],"owasp":"A05:2025"}},{"id":"D30","name":"Dependency Vulnerabilities","shortDescription":{"text":"Dependency Vulnerabilities"},"helpUri":"https://codehealth.canine.dev/dimensions/D30","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"]},{"target":{"id":"A03:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-1395","CWE-937"],"owasp":"A03:2025"}},{"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"]},{"target":{"id":"A02:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-1032","CWE-732","CWE-16"],"owasp":"A02:2025"}},{"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"]},{"target":{"id":"A03:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-1357","CWE-494"],"owasp":"A03:2025"}},{"id":"D43","name":"Malicious Dependencies","shortDescription":{"text":"Malicious Dependencies"},"helpUri":"https://codehealth.canine.dev/dimensions/D43","relationships":[{"target":{"id":"CWE-506","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"A08:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-506"],"owasp":"A08:2025"}},{"id":"D44","name":"Platform End-of-Life","shortDescription":{"text":"Platform End-of-Life"},"helpUri":"https://codehealth.canine.dev/dimensions/D44"},{"id":"AC1","name":"Text alternatives","shortDescription":{"text":"Text alternatives"},"helpUri":"https://codehealth.canine.dev/dimensions/AC1"},{"id":"AC2","name":"Forms \u0026 labels","shortDescription":{"text":"Forms \u0026 labels"},"helpUri":"https://codehealth.canine.dev/dimensions/AC2"},{"id":"AC3","name":"Page structure","shortDescription":{"text":"Page structure"},"helpUri":"https://codehealth.canine.dev/dimensions/AC3"},{"id":"AC5","name":"ARIA correctness","shortDescription":{"text":"ARIA correctness"},"helpUri":"https://codehealth.canine.dev/dimensions/AC5"},{"id":"AC6","name":"Visual \u0026 motion safety","shortDescription":{"text":"Visual \u0026 motion safety"},"helpUri":"https://codehealth.canine.dev/dimensions/AC6"},{"id":"AX10","name":"Code composition","shortDescription":{"text":"Code composition"},"helpUri":"https://codehealth.canine.dev/dimensions/AX10"},{"id":"AX2","name":"Stateful singletons","shortDescription":{"text":"Stateful singletons"},"helpUri":"https://codehealth.canine.dev/dimensions/AX2"},{"id":"AX3","name":"Project dependency cycles","shortDescription":{"text":"Project dependency cycles"},"helpUri":"https://codehealth.canine.dev/dimensions/AX3"},{"id":"AX5","name":"Architecture \u0026 structure","shortDescription":{"text":"Architecture \u0026 structure"},"helpUri":"https://codehealth.canine.dev/dimensions/AX5"},{"id":"AXB2","name":"Runtime readiness","shortDescription":{"text":"Runtime readiness"},"helpUri":"https://codehealth.canine.dev/dimensions/AXB2"},{"id":"M1","name":"Documentation (README)","shortDescription":{"text":"Documentation (README)"},"helpUri":"https://codehealth.canine.dev/dimensions/M1"},{"id":"M2","name":"Architecture documentation","shortDescription":{"text":"Architecture documentation"},"helpUri":"https://codehealth.canine.dev/dimensions/M2"},{"id":"M3","name":"Folder \u0026 project structure","shortDescription":{"text":"Folder \u0026 project structure"},"helpUri":"https://codehealth.canine.dev/dimensions/M3"},{"id":"M4","name":"Documentation accuracy","shortDescription":{"text":"Documentation accuracy"},"helpUri":"https://codehealth.canine.dev/dimensions/M4"},{"id":"P1","name":"CI/CD gates","shortDescription":{"text":"CI/CD gates"},"helpUri":"https://codehealth.canine.dev/dimensions/P1"},{"id":"P10","name":"Library API \u0026 versioning","shortDescription":{"text":"Library API \u0026 versioning"},"helpUri":"https://codehealth.canine.dev/dimensions/P10"},{"id":"P12","name":"CI test-gate honesty","shortDescription":{"text":"CI test-gate honesty"},"helpUri":"https://codehealth.canine.dev/dimensions/P12"},{"id":"P2","name":"Observability","shortDescription":{"text":"Observability"},"helpUri":"https://codehealth.canine.dev/dimensions/P2"},{"id":"P3","name":"Security \u0026 performance tooling","shortDescription":{"text":"Security \u0026 performance tooling"},"helpUri":"https://codehealth.canine.dev/dimensions/P3"},{"id":"P4","name":"Deployment \u0026 Rollback","shortDescription":{"text":"Deployment \u0026 Rollback"},"helpUri":"https://codehealth.canine.dev/dimensions/P4"},{"id":"P6","name":"Release Hygiene","shortDescription":{"text":"Release Hygiene"},"helpUri":"https://codehealth.canine.dev/dimensions/P6"},{"id":"PF1","name":"Benchmark discipline","shortDescription":{"text":"Benchmark discipline"},"helpUri":"https://codehealth.canine.dev/dimensions/PF1"},{"id":"SC1","name":"Supply-chain hygiene","shortDescription":{"text":"Supply-chain hygiene"},"helpUri":"https://codehealth.canine.dev/dimensions/SC1"},{"id":"X10","name":"Duplicated predicate","shortDescription":{"text":"Duplicated predicate"},"helpUri":"https://codehealth.canine.dev/dimensions/X10"},{"id":"X13","name":"Undrained process stream","shortDescription":{"text":"Undrained process stream"},"helpUri":"https://codehealth.canine.dev/dimensions/X13"},{"id":"X14","name":"Bypassable address classification","shortDescription":{"text":"Bypassable address classification"},"helpUri":"https://codehealth.canine.dev/dimensions/X14"},{"id":"X15","name":"Unvalidated length from an untrusted reader","shortDescription":{"text":"Unvalidated length from an untrusted reader"},"helpUri":"https://codehealth.canine.dev/dimensions/X15"},{"id":"X16","name":"Unfloored truncation loop","shortDescription":{"text":"Unfloored truncation loop"},"helpUri":"https://codehealth.canine.dev/dimensions/X16"},{"id":"X17","name":"Uncapped recursion over a caller-supplied document","shortDescription":{"text":"Uncapped recursion over a caller-supplied document"},"helpUri":"https://codehealth.canine.dev/dimensions/X17"},{"id":"X18","name":"Disposal-pattern correctness","shortDescription":{"text":"Disposal-pattern correctness"},"helpUri":"https://codehealth.canine.dev/dimensions/X18"},{"id":"X19","name":"Unrestored process-global state","shortDescription":{"text":"Unrestored process-global state"},"helpUri":"https://codehealth.canine.dev/dimensions/X19"},{"id":"X2","name":"Cancellation propagation","shortDescription":{"text":"Cancellation propagation"},"helpUri":"https://codehealth.canine.dev/dimensions/X2"},{"id":"X20","name":"Mistyped argument guard","shortDescription":{"text":"Mistyped argument guard"},"helpUri":"https://codehealth.canine.dev/dimensions/X20"},{"id":"X21","name":"Side-effecting pattern guard","shortDescription":{"text":"Side-effecting pattern guard"},"helpUri":"https://codehealth.canine.dev/dimensions/X21"},{"id":"X22","name":"Contradicted release guard","shortDescription":{"text":"Contradicted release guard"},"helpUri":"https://codehealth.canine.dev/dimensions/X22"},{"id":"X23","name":"Unguarded diagnostic materialisation","shortDescription":{"text":"Unguarded diagnostic materialisation"},"helpUri":"https://codehealth.canine.dev/dimensions/X23"},{"id":"X24","name":"Document value interpolated into markup unescaped","shortDescription":{"text":"Document value interpolated into markup unescaped"},"helpUri":"https://codehealth.canine.dev/dimensions/X24"},{"id":"X25","name":"Inert configuration knob","shortDescription":{"text":"Inert configuration knob"},"helpUri":"https://codehealth.canine.dev/dimensions/X25"},{"id":"X26","name":"Unsynchronised callback handoff","shortDescription":{"text":"Unsynchronised callback handoff"},"helpUri":"https://codehealth.canine.dev/dimensions/X26"},{"id":"X28","name":"Index access outside its own emptiness guard","shortDescription":{"text":"Index access outside its own emptiness guard"},"helpUri":"https://codehealth.canine.dev/dimensions/X28"},{"id":"X29","name":"Per-element action decided by a fixed element","shortDescription":{"text":"Per-element action decided by a fixed element"},"helpUri":"https://codehealth.canine.dev/dimensions/X29"},{"id":"X3","name":"Exception handling","shortDescription":{"text":"Exception handling"},"helpUri":"https://codehealth.canine.dev/dimensions/X3"},{"id":"X30","name":"Support guard that admits what it rejects","shortDescription":{"text":"Support guard that admits what it rejects"},"helpUri":"https://codehealth.canine.dev/dimensions/X30"},{"id":"X32","name":"Type resolved by simple name across every loaded assembly","shortDescription":{"text":"Type resolved by simple name across every loaded assembly"},"helpUri":"https://codehealth.canine.dev/dimensions/X32"},{"id":"X6","name":"Hand-rolled structured-format parsing","shortDescription":{"text":"Hand-rolled structured-format parsing"},"helpUri":"https://codehealth.canine.dev/dimensions/X6"},{"id":"X7","name":"Silent fallback defaults","shortDescription":{"text":"Silent fallback defaults"},"helpUri":"https://codehealth.canine.dev/dimensions/X7"},{"id":"X9","name":"Subsumed condition operand","shortDescription":{"text":"Subsumed condition operand"},"helpUri":"https://codehealth.canine.dev/dimensions/X9"}]}},"results":[{"ruleId":"D1","level":"warning","message":{"text":"placementcost.evaluateNodeEdgeLength (cyclomatic 268): placementcost.evaluateNodeEdgeLength has cyclomatic complexity 268 (threshold 15). Of this number, 189 points are the body\u0027s own statements and 79 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placementcost/edge_length.go"},"region":{"startLine":345}}}],"partialFingerprints":{"codehealthFindingId/v1":"dc4773d7cf895dc1a16d19ac0de6013553105a6baac6ccfa7d80472ae85e443c"}},{"ruleId":"D1","level":"warning","message":{"text":"packing.packGuarded (cyclomatic 250): packing.packGuarded has cyclomatic complexity 250 (threshold 15). Of this number, 237 points are the body\u0027s own statements and 13 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/packing/binpack.go"},"region":{"startLine":65}}}],"partialFingerprints":{"codehealthFindingId/v1":"6ba68577f5a4bc850cb55773827785560a2a218a5be080c3f672e6ed44760fb0"}},{"ruleId":"D1","level":"warning","message":{"text":"ovgEdgeRouter.search (cyclomatic 230): ovgEdgeRouter.search has cyclomatic complexity 230 (threshold 15). Of this number, 216 points are the body\u0027s own statements and 14 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":"d2layouts/d2talalayout/internal/routing/ovg_edge_router.go"},"region":{"startLine":558}}}],"partialFingerprints":{"codehealthFindingId/v1":"d9036221e49b14f8d9f32376533e95482ab5d8ede2819db40e2db55de09d0ccd"}},{"ruleId":"D1","level":"warning","message":{"text":"layoutgraph.validateEngineGraph (cyclomatic 220): layoutgraph.validateEngineGraph has cyclomatic complexity 220 (threshold 15). Of this number, 176 points are the body\u0027s own statements and 44 belong to 11 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/d2talalayout/internal/layoutgraph/topology_preflight.go"},"region":{"startLine":510}}}],"partialFingerprints":{"codehealthFindingId/v1":"8bb38c2835d51c41d1c2a6f97eaefac4ef87b41cf0481bc4b8113bbc41cbb724"}},{"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":"placement.Dejitter (cyclomatic 137): placement.Dejitter has cyclomatic complexity 137 (threshold 15). Of this number, 124 points are the body\u0027s own statements and 13 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/dejitter.go"},"region":{"startLine":16}}}],"partialFingerprints":{"codehealthFindingId/v1":"493dcdb64216859627ba2fd11d2042f1d6335d499de5ab8166c5f403114f7bd6"}},{"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":1765}}}],"partialFingerprints":{"codehealthFindingId/v1":"65464b03aaa628eb8c84d92be11f357d9e7dfd0dbefb5cb1c799749e29553db2"}},{"ruleId":"D1","level":"warning","message":{"text":"Ruler.measureMarkdownNode (cyclomatic 121): Ruler.measureMarkdownNode has cyclomatic complexity 121 (threshold 15). Of this number, 117 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":"lib/textmeasure/markdown.go"},"region":{"startLine":330}}}],"partialFingerprints":{"codehealthFindingId/v1":"4c86513814283cd95349328be02435d190595a9ddeeae39b84db57f6d2df9b4f"}},{"ruleId":"D1","level":"warning","message":{"text":"graphjson.deserializeGraphContext (cyclomatic 114): graphjson.deserializeGraphContext has cyclomatic complexity 114 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own 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/d2talalayout/internal/graphjson/codec.go"},"region":{"startLine":1035}}}],"partialFingerprints":{"codehealthFindingId/v1":"3b8b03b43559d367510e7bed23b25521e8850ffbaa4ca5a0fb897275d40f35bb"}},{"ruleId":"D1","level":"warning","message":{"text":"d2talalayout.translateGraph (cyclomatic 112): d2talalayout.translateGraph has cyclomatic complexity 112 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own 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/d2talalayout/adapter.go"},"region":{"startLine":116}}}],"partialFingerprints":{"codehealthFindingId/v1":"6386369b5959a29f382782320944f56e082bfcb5cf052acccb92bcd066f76e4a"}},{"ruleId":"D1","level":"warning","message":{"text":"routing.balanceRegularEdgesGuarded (cyclomatic 106): routing.balanceRegularEdgesGuarded has cyclomatic complexity 106 (threshold 15). Of this number, 90 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":"d2layouts/d2talalayout/internal/routing/postprocess.go"},"region":{"startLine":70}}}],"partialFingerprints":{"codehealthFindingId/v1":"c3a878aa16f2e1967bf27b43316b0b2ad0d1e6dc0d9f0a3e7ffeaf775abed7ac"}},{"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":1385}}}],"partialFingerprints":{"codehealthFindingId/v1":"043f28a9bca218766fe0d8dfd84b347b8540696ae86f44e7b5003b397f880e27"}},{"ruleId":"D1","level":"warning","message":{"text":"layoutgraph.validateCombineNodeTopology (cyclomatic 103): layoutgraph.validateCombineNodeTopology has cyclomatic complexity 103 (threshold 15). Of this number, 70 points are the body\u0027s own statements and 33 belong to 9 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/d2talalayout/internal/layoutgraph/topology_preflight.go"},"region":{"startLine":129}}}],"partialFingerprints":{"codehealthFindingId/v1":"43648876ceb17dc5e0b717bbed08711bc95078810844130cbd81ebac67333ddc"}},{"ruleId":"D1","level":"warning","message":{"text":"d2cli.Run (cyclomatic 102): d2cli.Run has cyclomatic complexity 102 (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":"d2cli/main.go"},"region":{"startLine":62}}}],"partialFingerprints":{"codehealthFindingId/v1":"0de7628a132e0db0cfd4e141c9f3b5f1570baee9450959a601f51f65ebbf4881"}},{"ruleId":"D1","level":"warning","message":{"text":"d2dagrelayout.shiftReachableDownIndexed (cyclomatic 102): d2dagrelayout.shiftReachableDownIndexed 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":810}}}],"partialFingerprints":{"codehealthFindingId/v1":"eda2882c00bc9c3093eb3b70e05b5f474ccf825aba8da1435afa2a8c5e464143"}},{"ruleId":"D1","level":"warning","message":{"text":"d2svg.drawShape (cyclomatic 102): d2svg.drawShape has cyclomatic complexity 102 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own 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":1688}}}],"partialFingerprints":{"codehealthFindingId/v1":"3aee35e5a82b3608282fa9206470a0571a11262248e9546bc5a2f4058105beb4"}},{"ruleId":"D1","level":"warning","message":{"text":"placement.reduceGapToNeighbors (cyclomatic 101): placement.reduceGapToNeighbors has cyclomatic complexity 101 (threshold 15). Of this number, 84 points are the body\u0027s own statements and 17 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/d2talalayout/internal/placement/gapreduction.go"},"region":{"startLine":273}}}],"partialFingerprints":{"codehealthFindingId/v1":"8bdf1cd7f56507387871483aae5a14ac5ad1fe99f7e61dfee5d4db94317cabb8"}},{"ruleId":"D1","level":"warning","message":{"text":"d2isometricimg.classicInkSegments (cyclomatic 101): d2isometricimg.classicInkSegments has cyclomatic complexity 101 (threshold 15). Of this number, 74 points are the body\u0027s own statements and 27 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/native_edges.go"},"region":{"startLine":102}}}],"partialFingerprints":{"codehealthFindingId/v1":"201dc8c301974ed15d7f3bc94751dad95077795e580841ec90a7a07395d09726"}},{"ruleId":"D1","level":"warning","message":{"text":"grouping.AddClusters (cyclomatic 100): grouping.AddClusters has cyclomatic complexity 100 (threshold 15). Of this number, 67 points are the body\u0027s own statements and 33 belong to 5 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/grouping/clusters.go"},"region":{"startLine":167}}}],"partialFingerprints":{"codehealthFindingId/v1":"6f855e11de267fedc4267200906473396bf5f22d0e89879b487406f5cae29d9f"}},{"ruleId":"D1","level":"warning","message":{"text":"d2elklayout.Layout (cyclomatic 93): d2elklayout.Layout has cyclomatic complexity 93 (threshold 15). Of this number, 70 points are the body\u0027s own statements and 23 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":257}}}],"partialFingerprints":{"codehealthFindingId/v1":"1448fa6e25ec06e61ed503072e0c213dc543e4c35ca3b1b4b33b40ccb432a19c"}},{"ruleId":"D1","level":"warning","message":{"text":"grouping.JoinDistancedClusters (cyclomatic 92): grouping.JoinDistancedClusters has cyclomatic complexity 92 (threshold 15). Of this number, 36 points are the body\u0027s own statements and 56 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/d2talalayout/internal/grouping/join.go"},"region":{"startLine":142}}}],"partialFingerprints":{"codehealthFindingId/v1":"f553b3a7e5d332c07f011a834ec13ff92e82956dffe031f8d7c0a31d610a4bdd"}},{"ruleId":"D1","level":"warning","message":{"text":"d2svg.renderValidated (cyclomatic 89): d2svg.renderValidated has cyclomatic complexity 89 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own 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":2896}}}],"partialFingerprints":{"codehealthFindingId/v1":"2b4d8cddf6b27f5d4a0cfddc080205e30984aa5fb96411110a0196e7ad8db89d"}},{"ruleId":"D1","level":"warning","message":{"text":"Map.ensureField (cyclomatic 87): Map.ensureField has cyclomatic complexity 87 (threshold 15). Of this number, 68 points are the body\u0027s own statements and 19 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ir/d2ir.go"},"region":{"startLine":1216}}}],"partialFingerprints":{"codehealthFindingId/v1":"4cd0a8a13831039151f8b367865a74aa5ca8a14b1763ce9264bd4fb2c9ab2893"}},{"ruleId":"D1","level":"warning","message":{"text":"routing.routeLineChecked (cyclomatic 87): routing.routeLineChecked has cyclomatic complexity 87 (threshold 15). Of this number, 84 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":"d2layouts/d2talalayout/internal/routing/coordinator.go"},"region":{"startLine":844}}}],"partialFingerprints":{"codehealthFindingId/v1":"f16307897109f3d2a0eb32b55b941db87cb8d85408d564bce65d056ee26fb177"}},{"ruleId":"D1","level":"warning","message":{"text":"d2cli.compile (cyclomatic 86): d2cli.compile has cyclomatic complexity 86 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own 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":452}}}],"partialFingerprints":{"codehealthFindingId/v1":"bf18b95f9c4ce0088cb36083819d5068a926f86bb688226140de2b66adcb31e0"}},{"ruleId":"D1","level":"warning","message":{"text":"labeling.place (cyclomatic 86): labeling.place has cyclomatic complexity 86 (threshold 15). Of this number, 84 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/d2talalayout/internal/labeling/placement.go"},"region":{"startLine":28}}}],"partialFingerprints":{"codehealthFindingId/v1":"06da45383f2c14a4ff82c1e9bd38ceb7894e78f33550f0a14b4f5d667960285e"}},{"ruleId":"D1","level":"warning","message":{"text":"layoutgraph.collectRuntimeObjectsContext (cyclomatic 85): layoutgraph.collectRuntimeObjectsContext has cyclomatic complexity 85 (threshold 15). Of this number, 45 points are the body\u0027s own statements and 40 belong to 9 function literals inside it that branch. To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/transaction_snapshot.go"},"region":{"startLine":362}}}],"partialFingerprints":{"codehealthFindingId/v1":"983e1532b7f6dd8b6ba2baec6df60cac5eb4bbf499495efeb7090023c2ec9f33"}},{"ruleId":"D1","level":"warning","message":{"text":"builder.resolveFontFallbacks (cyclomatic 85): builder.resolveFontFallbacks has cyclomatic complexity 85 (threshold 15). Of this number, 83 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own 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/d2scenebuild/font_fallback.go"},"region":{"startLine":131}}}],"partialFingerprints":{"codehealthFindingId/v1":"05f5dc9f9c24dcf6e71b1de22e0bd6e67307e847a224f3ed4c13018baaeee04f"}},{"ruleId":"D1","level":"warning","message":{"text":"placement.equidistanceNodeGuarded (cyclomatic 81): placement.equidistanceNodeGuarded has cyclomatic complexity 81 (threshold 15). Of this number, 73 points are the body\u0027s own statements and 8 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/equidistance.go"},"region":{"startLine":103}}}],"partialFingerprints":{"codehealthFindingId/v1":"63d772e482028ac642ecccd4e0f88a52f82ec06938fd190302d4fba1431d734c"}},{"ruleId":"D1","level":"warning","message":{"text":"compiler.compileReserved (cyclomatic 78): compiler.compileReserved 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":"d2compiler/compile.go"},"region":{"startLine":863}}}],"partialFingerprints":{"codehealthFindingId/v1":"06d57f8d722eca3064d208c33af249de5f18e2c97749ad6f37bd797d4a6421af"}},{"ruleId":"D1","level":"warning","message":{"text":"placement.swapOptimize (cyclomatic 76): placement.swapOptimize has cyclomatic complexity 76 (threshold 15). Of this number, 72 points are the body\u0027s own statements and 4 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/swap.go"},"region":{"startLine":60}}}],"partialFingerprints":{"codehealthFindingId/v1":"79f836ef0d637d047f234ab21041462e055f275f633e8c9cd3bb779ef031dfd8"}},{"ruleId":"D1","level":"warning","message":{"text":"placementcost.nodeSymmetry (cyclomatic 76): placementcost.nodeSymmetry has cyclomatic complexity 76 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placementcost/symmetry.go"},"region":{"startLine":94}}}],"partialFingerprints":{"codehealthFindingId/v1":"16c748288904d8204968ca2a0fdd975e3445e36bb66cba17a40e5a9b24e4d1ef"}},{"ruleId":"D1","level":"warning","message":{"text":"ovgEdgeRouter.findSShapedRoute (cyclomatic 76): ovgEdgeRouter.findSShapedRoute has cyclomatic complexity 76 (threshold 15). Of this number, 73 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":"d2layouts/d2talalayout/internal/routing/slingshot.go"},"region":{"startLine":891}}}],"partialFingerprints":{"codehealthFindingId/v1":"4c802e7762161faf7c5c024cf7db07bd1f506ad52f89d8587d1ec86706f4482c"}},{"ruleId":"D1","level":"warning","message":{"text":"d2isometricimg.svgVisibleFacesWithLimits (cyclomatic 75): d2isometricimg.svgVisibleFacesWithLimits has cyclomatic complexity 75 (threshold 15). Of this number, 60 points are the body\u0027s own statements and 15 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":"d2renderers/d2isometric/d2isometricimg/svg_visibility.go"},"region":{"startLine":343}}}],"partialFingerprints":{"codehealthFindingId/v1":"d401ed90eccb59561aaa784bef41bf95ecde140b40ebf22efacf96cc309ad20b"}},{"ruleId":"D1","level":"warning","message":{"text":"ShapingWorkspace.ShapeTextTransient (cyclomatic 75): ShapingWorkspace.ShapeTextTransient has cyclomatic complexity 75 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/internal/fontface/shaping.go"},"region":{"startLine":111}}}],"partialFingerprints":{"codehealthFindingId/v1":"bf66deaf16164bba6303c8457a83d97d759b6194216aa8c7d5de8230f8a65a96"}},{"ruleId":"D1","level":"warning","message":{"text":"packing.CombineSubgraphs (cyclomatic 74): packing.CombineSubgraphs has cyclomatic complexity 74 (threshold 15). Of this number, 55 points are the body\u0027s own statements and 19 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":"d2layouts/d2talalayout/internal/packing/combine.go"},"region":{"startLine":92}}}],"partialFingerprints":{"codehealthFindingId/v1":"096b132d3a3a31069fe3cd469e9459cd822d4b55822c8a80d34d090f3dca5389"}},{"ruleId":"D1","level":"warning","message":{"text":"graphjson.validateSerializedGraphForDeserialization (cyclomatic 73): graphjson.validateSerializedGraphForDeserialization has cyclomatic complexity 73 (threshold 15). Of this number, 55 points are the body\u0027s own statements and 18 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/d2talalayout/internal/graphjson/preflight.go"},"region":{"startLine":25}}}],"partialFingerprints":{"codehealthFindingId/v1":"dab7296ad1529f480766af9f9f4613e98cdd47beab2c86da0583468a7746332c"}},{"ruleId":"D1","level":"warning","message":{"text":"routing.buildChannelProblem (cyclomatic 73): routing.buildChannelProblem has cyclomatic complexity 73 (threshold 15). Of this number, 71 points are the body\u0027s own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/nudge_channels.go"},"region":{"startLine":200}}}],"partialFingerprints":{"codehealthFindingId/v1":"c1c807c10c598ee541a318780681be4b8cd8fee676b8db1c862b896c89b133cd"}},{"ruleId":"D1","level":"warning","message":{"text":"d2isometricimg.nativeResolveLaneRoutes (cyclomatic 73): d2isometricimg.nativeResolveLaneRoutes has cyclomatic complexity 73 (threshold 15). Of this number, 67 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":"d2renderers/d2isometric/d2isometricimg/route_lanes.go"},"region":{"startLine":63}}}],"partialFingerprints":{"codehealthFindingId/v1":"5c3f76709365733ffb60703eee606fe66a80a677d858dee7be4f0e2fbd1d385b"}},{"ruleId":"D1","level":"warning","message":{"text":"d2isometric.BuildScene (cyclomatic 73): d2isometric.BuildScene has cyclomatic complexity 73 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own 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/d2isometric/scene.go"},"region":{"startLine":129}}}],"partialFingerprints":{"codehealthFindingId/v1":"1396a9574842b95751c71c9e714f013a971a46eca60e839cc86a9f974541df05"}},{"ruleId":"D1","level":"warning","message":{"text":"Style.Apply (cyclomatic 72): Style.Apply 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":"d2graph/d2graph.go"},"region":{"startLine":313}}}],"partialFingerprints":{"codehealthFindingId/v1":"a2a1d6a9eadadf99925ee56c118327fef060d1cbba44b3caa8c020dc4c9c87b3"}},{"ruleId":"D1","level":"warning","message":{"text":"preflight.text (cyclomatic 70): preflight.text has cyclomatic complexity 70 (threshold 15). Of this number, 67 points are the body\u0027s own statements and 3 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own 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/d2raster/text.go"},"region":{"startLine":183}}}],"partialFingerprints":{"codehealthFindingId/v1":"c450bf7c4a25f7978cb0189d13b842ac5ed124689e7bead2828def34b6c26dbc"}},{"ruleId":"D1","level":"warning","message":{"text":"rasterimage.inspectPNG (cyclomatic 70): rasterimage.inspectPNG 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":"internal/rasterimage/firstframe.go"},"region":{"startLine":339}}}],"partialFingerprints":{"codehealthFindingId/v1":"85becbb017d22d4dd3360fedf5e4bcb7817e1f237b51d6cf1582f5af43659f95"}},{"ruleId":"D1","level":"warning","message":{"text":"compiler.resolveSubstitutions (cyclomatic 69): compiler.resolveSubstitutions has cyclomatic complexity 69 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ir/compile.go"},"region":{"startLine":415}}}],"partialFingerprints":{"codehealthFindingId/v1":"53cf825f21fbcfb76a2b0de478fccb7e86d5c80d4c3a2d916427281f8e03e77e"}},{"ruleId":"D1","level":"warning","message":{"text":"textPainter.texture (cyclomatic 69): textPainter.texture has cyclomatic complexity 69 (threshold 15). Of this number, 59 points are the body\u0027s own statements and 10 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/text.go"},"region":{"startLine":145}}}],"partialFingerprints":{"codehealthFindingId/v1":"49c6db73650cf6210f3d3f59605b182c4ded0904158cd2e6b475791aec7d840d"}},{"ruleId":"D1","level":"warning","message":{"text":"svgImporter.computeStyle (cyclomatic 69): svgImporter.computeStyle has cyclomatic complexity 69 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svgimport/style.go"},"region":{"startLine":266}}}],"partialFingerprints":{"codehealthFindingId/v1":"a3a8ff1a9cd5c9211c42a06aa927aa34f27da05cc28741868908b12ad701c045"}},{"ruleId":"D1","level":"warning","message":{"text":"d2wasm.Render (cyclomatic 68): d2wasm.Render has cyclomatic complexity 68 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2js/d2wasm/functions.go"},"region":{"startLine":351}}}],"partialFingerprints":{"codehealthFindingId/v1":"2629f54e26b8663782d0cdac9957f8faa14ef9da455dea75fd81fdce0fe2ee2f"}},{"ruleId":"D1","level":"warning","message":{"text":"graphjson.Serialize (cyclomatic 67): graphjson.Serialize has cyclomatic complexity 67 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own 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/d2talalayout/internal/graphjson/codec.go"},"region":{"startLine":262}}}],"partialFingerprints":{"codehealthFindingId/v1":"031791beee9799c60e9e62a88020d9678294d090296e0f8cc72b785b16e5e895"}},{"ruleId":"D1","level":"warning","message":{"text":"d2dagrelayout.Layout (cyclomatic 66): d2dagrelayout.Layout has cyclomatic complexity 66 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own 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":53}}}],"partialFingerprints":{"codehealthFindingId/v1":"cddc37683773e083b0ae572711f72192fdcc9514b543bbe28b50450860d08c88"}},{"ruleId":"D1","level":"warning","message":{"text":"packing.binPackCanUseRoutedContainerBox (cyclomatic 66): packing.binPackCanUseRoutedContainerBox has cyclomatic complexity 66 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own 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/d2talalayout/internal/packing/routed_container.go"},"region":{"startLine":45}}}],"partialFingerprints":{"codehealthFindingId/v1":"9446ed527603036bb6d8563f76a4e683c9bed516b0178f7e0106db8ae199347f"}},{"ruleId":"D1","level":"warning","message":{"text":"ovgEdgeRouter.findLShapedRoute (cyclomatic 66): ovgEdgeRouter.findLShapedRoute has cyclomatic complexity 66 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own 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/d2talalayout/internal/routing/slingshot.go"},"region":{"startLine":666}}}],"partialFingerprints":{"codehealthFindingId/v1":"eb3af39f72833dd65941f4573f85acb083ab3bf475fd86617c103562c3fddd0e"}},{"ruleId":"D1","level":"warning","message":{"text":"labeling.findBestEdgeLabelPosition (cyclomatic 65): labeling.findBestEdgeLabelPosition has cyclomatic complexity 65 (threshold 15). Of this number, 45 points are the body\u0027s own statements and 20 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/labeling/placement.go"},"region":{"startLine":687}}}],"partialFingerprints":{"codehealthFindingId/v1":"24c6d09b1f7060c273c8ad380bcd6fb2b75364ea541663b18b438cde3fb349f5"}},{"ruleId":"D1","level":"warning","message":{"text":"Transaction.buildPostStateOverlapCandidates (cyclomatic 65): Transaction.buildPostStateOverlapCandidates has cyclomatic complexity 65 (threshold 15). Of this number, 60 points are the body\u0027s own statements and 5 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/transaction.go"},"region":{"startLine":824}}}],"partialFingerprints":{"codehealthFindingId/v1":"800095c6d803ad169967c479f015df7911b288d917a55b7c470b5c30290617a5"}},{"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":1515}}}],"partialFingerprints":{"codehealthFindingId/v1":"d3b71de398dd1b90e3f728d6045b3881cf9f8ca817de6a71f2cb0721866d19de"}},{"ruleId":"D1","level":"warning","message":{"text":"compiler._compileField (cyclomatic 63): compiler._compileField has cyclomatic complexity 63 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own 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":1704}}}],"partialFingerprints":{"codehealthFindingId/v1":"d01c40cb0b778adfa35ef3075172410b7d723e2e5f51399de0e26c74c539c9e1"}},{"ruleId":"D1","level":"warning","message":{"text":"placement.transpose (cyclomatic 63): placement.transpose has cyclomatic complexity 63 (threshold 15). Of this number, 53 points are the body\u0027s own statements and 10 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/transpose.go"},"region":{"startLine":35}}}],"partialFingerprints":{"codehealthFindingId/v1":"b2185ea3c063cdc2cd82a7bdfd5cd073078542c1336607bfb1e3dd79ca0a2ef7"}},{"ruleId":"D1","level":"warning","message":{"text":"builder.buildDocument (cyclomatic 63): builder.buildDocument has cyclomatic complexity 63 (threshold 15). Of this number, 58 points are the body\u0027s own statements and 5 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/build.go"},"region":{"startLine":542}}}],"partialFingerprints":{"codehealthFindingId/v1":"c8ea76476d43fa5e40e0a0e7ebd86cefe4ab0e4c0185776150fb3b4dea5fa308"}},{"ruleId":"D1","level":"warning","message":{"text":"routing.tunnelRangesBetweenChecked (cyclomatic 62): routing.tunnelRangesBetweenChecked has cyclomatic complexity 62 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/tunnel.go"},"region":{"startLine":93}}}],"partialFingerprints":{"codehealthFindingId/v1":"56a87c6a2541809de901f30a2158a9a9a2128bcc5a07de8f2d525b2eb29a7011"}},{"ruleId":"D1","level":"warning","message":{"text":"placement.optimizeClusterWithRollback (cyclomatic 61): placement.optimizeClusterWithRollback has cyclomatic complexity 61 (threshold 15). Of this number, 46 points are the body\u0027s own statements and 15 belong to 5 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/cluster_optimization.go"},"region":{"startLine":148}}}],"partialFingerprints":{"codehealthFindingId/v1":"9b6d360504fe685c9389b5aea87e6caad1332897e856a3dc3e1bc57e8bfabe24"}},{"ruleId":"D1","level":"warning","message":{"text":"routing.fixClusterEdgeBranchingGuarded (cyclomatic 61): routing.fixClusterEdgeBranchingGuarded has cyclomatic complexity 61 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own 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/d2talalayout/internal/routing/postprocess.go"},"region":{"startLine":472}}}],"partialFingerprints":{"codehealthFindingId/v1":"f1106ef94e3f56fafda05bbde761d4cae70781f5967291d7178879480061d81c"}},{"ruleId":"D1","level":"warning","message":{"text":"d2svg.collectFontCorporaAndClasses (cyclomatic 61): d2svg.collectFontCorporaAndClasses has cyclomatic complexity 61 (threshold 15). Of this number, 55 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":"d2renderers/d2svg/font_corpus.go"},"region":{"startLine":79}}}],"partialFingerprints":{"codehealthFindingId/v1":"2bf3e2871d7deedbc77a1c5b0ec58b438a7e336fce55b2802abd823d3fa1b381"}},{"ruleId":"D1","level":"warning","message":{"text":"svgImporter.parse (cyclomatic 61): svgImporter.parse has cyclomatic complexity 61 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own 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/d2svgimport/import.go"},"region":{"startLine":393}}}],"partialFingerprints":{"codehealthFindingId/v1":"3147414de5ce2e8a78310de22b18020dfb5525f1be4e0300583573080556b4a8"}},{"ruleId":"D1","level":"warning","message":{"text":"placement.optimizerAdjacents (cyclomatic 60): placement.optimizerAdjacents has cyclomatic complexity 60 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own 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/d2talalayout/internal/placement/optimization_guard.go"},"region":{"startLine":176}}}],"partialFingerprints":{"codehealthFindingId/v1":"d5fec4c7eceb104e40a6833e2dc31cdc660e11c598a2cc1b5bf16f016c30fa78"}},{"ruleId":"D1","level":"warning","message":{"text":"quality.scoreExistingLabelPlacements (cyclomatic 60): quality.scoreExistingLabelPlacements has cyclomatic complexity 60 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own 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/d2talalayout/internal/quality/labels.go"},"region":{"startLine":16}}}],"partialFingerprints":{"codehealthFindingId/v1":"31251ebf6d5b0b7f792e729a799574c0a78c7434961d36188db5343920a17720"}},{"ruleId":"D1","level":"warning","message":{"text":"d2isometricimg.hierarchyBoardHeaderPlacement (cyclomatic 60): d2isometricimg.hierarchyBoardHeaderPlacement has cyclomatic complexity 60 (threshold 15). Of this number, 50 points are the body\u0027s own statements and 10 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/hierarchy_headers.go"},"region":{"startLine":25}}}],"partialFingerprints":{"codehealthFindingId/v1":"5bb1f9f4d46abad3af14d5e40dca219f01b0f20146b5f94032e2a735449f8077"}},{"ruleId":"D1","level":"warning","message":{"text":"graphjson.newEdgeSerializationIDs (cyclomatic 59): graphjson.newEdgeSerializationIDs has cyclomatic complexity 59 (threshold 15). Of this number, 51 points are the body\u0027s own statements and 8 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/graphjson/codec.go"},"region":{"startLine":50}}}],"partialFingerprints":{"codehealthFindingId/v1":"1fe549b5bfdf47c34687659a85285671ae945c8ecab92fea38504bc83ae549d5"}},{"ruleId":"D1","level":"warning","message":{"text":"meshBuilder.edges (cyclomatic 59): meshBuilder.edges has cyclomatic complexity 59 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/geometry_routes.go"},"region":{"startLine":332}}}],"partialFingerprints":{"codehealthFindingId/v1":"cf13d84800a61b47cbaa8c8b2f0052d4560985483ae48503495f4642d407d73e"}},{"ruleId":"D1","level":"warning","message":{"text":"builder.preflightConnection (cyclomatic 59): builder.preflightConnection has cyclomatic complexity 59 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/build.go"},"region":{"startLine":404}}}],"partialFingerprints":{"codehealthFindingId/v1":"ffedb5e40f9b7866ad72202972d4e5745ce8057f2febe3b14e274e9b7e727be4"}},{"ruleId":"D1","level":"warning","message":{"text":"compiler._compileEdges (cyclomatic 58): compiler._compileEdges 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":"d2ir/compile.go"},"region":{"startLine":2088}}}],"partialFingerprints":{"codehealthFindingId/v1":"40bca2df54ba9fdb3374e2b229602ce44e8866888aeec4df86b0fe9be5bf40c5"}},{"ruleId":"D1","level":"warning","message":{"text":"Route.isOpposingColinear (cyclomatic 58): Route.isOpposingColinear 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":"d2layouts/d2talalayout/internal/routing/route.go"},"region":{"startLine":87}}}],"partialFingerprints":{"codehealthFindingId/v1":"76dbaeb9d3b367928f4a8548f7b533ca519eed062385ebfdacdde3b6027a80f9"}},{"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":1364}}}],"partialFingerprints":{"codehealthFindingId/v1":"a091b29a55e99556ef8ac6e263f89e4f5e9a0ee40c8e5f1821282bf3d88f2e46"}},{"ruleId":"D1","level":"warning","message":{"text":"d2talalayout.validateLayoutResultMetadata (cyclomatic 57): d2talalayout.validateLayoutResultMetadata 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":"d2layouts/d2talalayout/result_validate.go"},"region":{"startLine":129}}}],"partialFingerprints":{"codehealthFindingId/v1":"0c73c8705ee51681cab6915e1ff6a657daf1dacd39ac3baaa48c277c72d663ff"}},{"ruleId":"D1","level":"warning","message":{"text":"hierarchy.newRankProblem (cyclomatic 57): hierarchy.newRankProblem has cyclomatic complexity 57 (threshold 15). Of this number, 52 points are the body\u0027s own statements and 5 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/hierarchy/rank_graph.go"},"region":{"startLine":13}}}],"partialFingerprints":{"codehealthFindingId/v1":"5e4cf775f320a0c0c5e1e7bb0dd2487b59129c9e1e092beea05e8990170db52d"}},{"ruleId":"D1","level":"warning","message":{"text":"placement.orientSourceInterior (cyclomatic 57): placement.orientSourceInterior has cyclomatic complexity 57 (threshold 15). Of this number, 41 points are the body\u0027s own statements and 16 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/d2talalayout/internal/placement/container_orientation.go"},"region":{"startLine":37}}}],"partialFingerprints":{"codehealthFindingId/v1":"edd09a5f7942031bf7b08b534a9ec0d42dfbf4be376d2ae66223cfe7bf0da936"}},{"ruleId":"D1","level":"warning","message":{"text":"routing.RouteGraphWithWorkLimit (cyclomatic 57): routing.RouteGraphWithWorkLimit has cyclomatic complexity 57 (threshold 15). Most of this is not in the body itself: 15 of the 57 points are its own statements and the rest belongs to one function literal inside it that branches (line 101). 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/d2talalayout/internal/routing/graph_stage.go"},"region":{"startLine":44}}}],"partialFingerprints":{"codehealthFindingId/v1":"dee597d3e025e93db852ca00ded58a7c6f2257e8cb6950ec87f031268b408a6e"}},{"ruleId":"D1","level":"warning","message":{"text":"trees.extractTreesInContainer (cyclomatic 57): trees.extractTreesInContainer 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":"d2layouts/d2talalayout/internal/trees/layout.go"},"region":{"startLine":14}}}],"partialFingerprints":{"codehealthFindingId/v1":"1f49b94afc7c7ddf0d306b30cfefde34decdc9a78288b67d92d3616f93904d3b"}},{"ruleId":"D1","level":"warning","message":{"text":"d2isometricimg.nativeResolveBridgeRoutes (cyclomatic 57): d2isometricimg.nativeResolveBridgeRoutes has cyclomatic complexity 57 (threshold 15). Of this number, 53 points are the body\u0027s own statements and 4 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/route_bridges.go"},"region":{"startLine":60}}}],"partialFingerprints":{"codehealthFindingId/v1":"59e25cae9e1571df663b2358eee911694caaa4dfa4db690dca26c93855f941f6"}},{"ruleId":"D1","level":"warning","message":{"text":"d2svg.drawConnection (cyclomatic 57): d2svg.drawConnection 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":"d2renderers/d2svg/d2svg.go"},"region":{"startLine":1079}}}],"partialFingerprints":{"codehealthFindingId/v1":"19b07483faef2c04a8712f476598af4e6ef4a435474b549c1f0e5c4ab12ae119"}},{"ruleId":"D1","level":"warning","message":{"text":"builder.shapeTextRuns (cyclomatic 56): builder.shapeTextRuns has cyclomatic complexity 56 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/font_fallback.go"},"region":{"startLine":432}}}],"partialFingerprints":{"codehealthFindingId/v1":"ca332396f0f6e16511f2ab31d718113959f9c6ac3352424cbdd8273c44a14c5a"}},{"ruleId":"D1","level":"warning","message":{"text":"Transaction.Commit (cyclomatic 54): Transaction.Commit has cyclomatic complexity 54 (threshold 15). Of this number, 52 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/d2talalayout/internal/layoutgraph/transaction.go"},"region":{"startLine":1166}}}],"partialFingerprints":{"codehealthFindingId/v1":"5de1f627cf6b2751920fca54fd372b0cf7dd4aadef4a597bd15a16b4b8d836fc"}},{"ruleId":"D1","level":"warning","message":{"text":"d2isometricimg.newNativeSceneWithOptions (cyclomatic 54): d2isometricimg.newNativeSceneWithOptions has cyclomatic complexity 54 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own 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/d2isometric/d2isometricimg/geometry.go"},"region":{"startLine":431}}}],"partialFingerprints":{"codehealthFindingId/v1":"cf4777a232b32d07380fe886e88e28ee014aef42bca1cf12537401efc98bf8ad"}},{"ruleId":"D1","level":"warning","message":{"text":"d2isometricimg.nativeSceneSVG (cyclomatic 54): d2isometricimg.nativeSceneSVG has cyclomatic complexity 54 (threshold 15). Of this number, 52 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":"d2renderers/d2isometric/d2isometricimg/svg.go"},"region":{"startLine":237}}}],"partialFingerprints":{"codehealthFindingId/v1":"ade0e4121f9cd2b15b5ecfede019fe4db534a045811ac97d66bfb0912ead839e"}},{"ruleId":"D1","level":"warning","message":{"text":"d2layouts.LayoutNested (cyclomatic 53): d2layouts.LayoutNested has cyclomatic complexity 53 (threshold 15). Of this number, 52 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":"preflight.node (cyclomatic 53): preflight.node has cyclomatic complexity 53 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own 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/d2raster/raster.go"},"region":{"startLine":977}}}],"partialFingerprints":{"codehealthFindingId/v1":"6acaf0ec5b44ba1e033bef7e064ecfe5cceecd08fded6e5170d06508b832af6a"}},{"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":1123}}}],"partialFingerprints":{"codehealthFindingId/v1":"263313be6d9ad0889e4bbf519c9e9b7db9941891de7226154b43450fc5e09f0e"}},{"ruleId":"D1","level":"warning","message":{"text":"OVG.halfwayPoints (cyclomatic 52): OVG.halfwayPoints 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/d2talalayout/internal/routing/ovg.go"},"region":{"startLine":561}}}],"partialFingerprints":{"codehealthFindingId/v1":"91c9e40dec578e7db01f30f8235fe9c3f7aeb6fe03694ff02edd328ea920bf15"}},{"ruleId":"D1","level":"warning","message":{"text":"Rasterizer.DrawRGBA (cyclomatic 52): Rasterizer.DrawRGBA has cyclomatic complexity 52 (threshold 15). Most of this is not in the body itself: 12 of the 52 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 507, 613, 576, \u2026). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals\u0027 work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/internal/scanline/rasterizer.go"},"region":{"startLine":491}}}],"partialFingerprints":{"codehealthFindingId/v1":"ce5739f54de29b49964c13c9cda2dee1ffcf32301a823a54b46c6e690c8fdedf"}},{"ruleId":"D1","level":"warning","message":{"text":"d2raster.planNodeResources (cyclomatic 51): d2raster.planNodeResources has cyclomatic complexity 51 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/effects.go"},"region":{"startLine":322}}}],"partialFingerprints":{"codehealthFindingId/v1":"93fb6b81c11ef005b291ba1949fe9466b76d76916843fac50e89a04831110f60"}},{"ruleId":"D1","level":"warning","message":{"text":"pathParser.parseGroup (cyclomatic 51): pathParser.parseGroup has cyclomatic complexity 51 (threshold 15). Of this number, 50 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":"d2renderers/d2svgimport/path.go"},"region":{"startLine":131}}}],"partialFingerprints":{"codehealthFindingId/v1":"841dd8198060dc8c6e6c0b8db6fee348ac06181ae2e928e90a2778a0cd1ef930"}},{"ruleId":"D1","level":"warning","message":{"text":"ThemableElement.Render (cyclomatic 51): ThemableElement.Render has cyclomatic complexity 51 (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":138}}}],"partialFingerprints":{"codehealthFindingId/v1":"2c48fbd2da713382c84115da44ebd1376d1b41398527c9144a6e2420461f48c9"}},{"ruleId":"D1","level":"warning","message":{"text":"Node.deltaToGuarded (cyclomatic 50): Node.deltaToGuarded has cyclomatic complexity 50 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/node.go"},"region":{"startLine":788}}}],"partialFingerprints":{"codehealthFindingId/v1":"4430a428ad760b97d3c91ee1713743c024c9127ecc43fb94d73bd261b694da8a"}},{"ruleId":"D1","level":"warning","message":{"text":"quality.measureLabels (cyclomatic 50): quality.measureLabels has cyclomatic complexity 50 (threshold 15). Of this number, 48 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own 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/d2talalayout/internal/quality/inspection_labels.go"},"region":{"startLine":19}}}],"partialFingerprints":{"codehealthFindingId/v1":"df7d51241b41025aa1a66423d99a1341b55cf6963b87e9efb422693b220b57b0"}},{"ruleId":"D1","level":"warning","message":{"text":"grouping.AddSequences (cyclomatic 49): grouping.AddSequences has cyclomatic complexity 49 (threshold 15). Of this number, 48 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/grouping/sequences.go"},"region":{"startLine":206}}}],"partialFingerprints":{"codehealthFindingId/v1":"b7065b38c2f8562f0b768367a8085007790ec98150b89a65d756875497dfff3a"}},{"ruleId":"D1","level":"warning","message":{"text":"placementcost.prepareNodeEdgeLength (cyclomatic 49): placementcost.prepareNodeEdgeLength 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":"d2layouts/d2talalayout/internal/placementcost/edge_length.go"},"region":{"startLine":142}}}],"partialFingerprints":{"codehealthFindingId/v1":"ac9c5a93b5c7bc3aec679530fa598ad9131dd9b54208ea411a3eaf2805613260"}},{"ruleId":"D1","level":"warning","message":{"text":"proximity.assignNearsWithWorkLimit (cyclomatic 49): proximity.assignNearsWithWorkLimit has cyclomatic complexity 49 (threshold 15). Of this number, 37 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":"d2layouts/d2talalayout/internal/proximity/nears.go"},"region":{"startLine":18}}}],"partialFingerprints":{"codehealthFindingId/v1":"5332141d4301d6a67bda1cf7b0eae7a2c426898fa4ce3c3e9d3b1b5fff5d577f"}},{"ruleId":"D1","level":"warning","message":{"text":"hierarchy.PlaceCompound (cyclomatic 48): hierarchy.PlaceCompound has cyclomatic complexity 48 (threshold 15). Of this number, 47 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/hierarchy/compound.go"},"region":{"startLine":39}}}],"partialFingerprints":{"codehealthFindingId/v1":"2cae05987457f6a901e40a10d7bf76e18c5f448ddc59eda87f89a9ef38f9de3d"}},{"ruleId":"D1","level":"warning","message":{"text":"Nodes.clustersWithWorkGuard (cyclomatic 48): Nodes.clustersWithWorkGuard has cyclomatic complexity 48 (threshold 15). Of this number, 32 points are the body\u0027s own statements and 16 belong to 6 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/node.go"},"region":{"startLine":300}}}],"partialFingerprints":{"codehealthFindingId/v1":"da6e07decc19c3884a1d55fb48a419ae4de7a6165882fb0afda94507e2ea5ed5"}},{"ruleId":"D1","level":"warning","message":{"text":"ovgEdgeSet.intersectsWithChecked (cyclomatic 48): ovgEdgeSet.intersectsWithChecked has cyclomatic complexity 48 (threshold 15). Of this number, 47 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/ovg_edge_set.go"},"region":{"startLine":128}}}],"partialFingerprints":{"codehealthFindingId/v1":"6ecdbce2bfdd74a942425863c5f2a70637807a9ce8b5b4c58b205f6876df7c26"}},{"ruleId":"D1","level":"warning","message":{"text":"trees.placeAtOrientationGuarded (cyclomatic 48): trees.placeAtOrientationGuarded has cyclomatic complexity 48 (threshold 15). Of this number, 36 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":"d2layouts/d2talalayout/internal/trees/layout.go"},"region":{"startLine":399}}}],"partialFingerprints":{"codehealthFindingId/v1":"531aed9cdcfa64cc6b3c001269ca0d85876bf6e197108166f82b49ca10ee412a"}},{"ruleId":"D1","level":"warning","message":{"text":"d2isometricimg.nativeLaneJoinCorners (cyclomatic 48): d2isometricimg.nativeLaneJoinCorners has cyclomatic complexity 48 (threshold 15). Of this number, 43 points are the body\u0027s own statements and 5 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own 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/d2isometric/d2isometricimg/route_lanes.go"},"region":{"startLine":435}}}],"partialFingerprints":{"codehealthFindingId/v1":"bf9eaff6b73dcc5730293807a3bbd8c359d21180026227bdd73c748f2b3937f0"}},{"ruleId":"D1","level":"warning","message":{"text":"svgImporter.declarationsFor (cyclomatic 48): svgImporter.declarationsFor has cyclomatic complexity 48 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svgimport/style.go"},"region":{"startLine":63}}}],"partialFingerprints":{"codehealthFindingId/v1":"40315463ce0a5ae99aa7f1e547522e45a43720647fe43ab172ea90623ba45bc2"}},{"ruleId":"D1","level":"warning","message":{"text":"d2wasm.Compile (cyclomatic 48): d2wasm.Compile has cyclomatic complexity 48 (threshold 15). Of this number, 44 points are the body\u0027s own statements and 4 belong to 2 function literals inside it that branch. To reduce it, 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":"d2js/d2wasm/functions.go"},"region":{"startLine":196}}}],"partialFingerprints":{"codehealthFindingId/v1":"cb94bd99e2f2e78ce3bc0c49e15309be775b0acb4fed6a85a3e8c60093e11a6f"}},{"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":231}}}],"partialFingerprints":{"codehealthFindingId/v1":"8e36947aa647f2f731e5e61650b85b5df7aa5fb608c54b31132535fddee8a2c7"}},{"ruleId":"D1","level":"warning","message":{"text":"placement.placeNodes (cyclomatic 47): placement.placeNodes has cyclomatic complexity 47 (threshold 15). Of this number, 44 points are the body\u0027s own statements and 3 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/node_placement.go"},"region":{"startLine":21}}}],"partialFingerprints":{"codehealthFindingId/v1":"7e21be53ad08e9a63edaeaecdc09bdcb47db450e4754908025d4a7e5177a4a3f"}},{"ruleId":"D1","level":"warning","message":{"text":"placement.newSizedOptimizer (cyclomatic 47): placement.newSizedOptimizer has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/sized_optimizer.go"},"region":{"startLine":106}}}],"partialFingerprints":{"codehealthFindingId/v1":"f8f6936647b3b1c93686c87487385d09da1ff5c3c249116b7f93ae746de9673c"}},{"ruleId":"D1","level":"warning","message":{"text":"GraphState.updateContext (cyclomatic 46): GraphState.updateContext has cyclomatic complexity 46 (threshold 15). Of this number, 36 points are the body\u0027s own statements and 10 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/transaction.go"},"region":{"startLine":167}}}],"partialFingerprints":{"codehealthFindingId/v1":"a4092f644c01964add4ca05741e124365fe3c9b004b8cb891a5330d6125c45aa"}},{"ruleId":"D1","level":"warning","message":{"text":"routing.reorderDuplicatesInEdgesGuarded (cyclomatic 46): routing.reorderDuplicatesInEdgesGuarded 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":"d2layouts/d2talalayout/internal/routing/standalone_route_guard.go"},"region":{"startLine":323}}}],"partialFingerprints":{"codehealthFindingId/v1":"e1cccde911d08793f088b38eda7b46d3a69a38d6a3036496908f10ee9f8ddd18"}},{"ruleId":"D1","level":"warning","message":{"text":"d2isometricimg.svgOrderPaintUnitsWithLimits (cyclomatic 46): d2isometricimg.svgOrderPaintUnitsWithLimits has cyclomatic complexity 46 (threshold 15). Of this number, 36 points are the body\u0027s own statements and 10 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/svg_order.go"},"region":{"startLine":29}}}],"partialFingerprints":{"codehealthFindingId/v1":"0ca5e53b9d7d2c0d62a402f5525dafe7ff941360997fb87268608af3ca303eb9"}},{"ruleId":"D1","level":"warning","message":{"text":"d2raster.prepareWithSessionBands (cyclomatic 46): d2raster.prepareWithSessionBands has cyclomatic complexity 46 (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/d2raster/raster.go"},"region":{"startLine":615}}}],"partialFingerprints":{"codehealthFindingId/v1":"b1b88349f16c14e89ce67db3ff5baef3f9ad7b3c009dd84a930858f16681259c"}},{"ruleId":"D1","level":"warning","message":{"text":"prepare.main (cyclomatic 46): prepare.main has cyclomatic complexity 46 (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":"ci/release/prepare.py"},"region":{"startLine":27}}}],"partialFingerprints":{"codehealthFindingId/v1":"dcc24c4c106eeb38ca581a9c88d7a3e1dac4269e12f08e65ec26f2b6280555e6"}},{"ruleId":"D1","level":"warning","message":{"text":"main.verifyArchive (cyclomatic 45): main.verifyArchive 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":"ci/release/releasetool/main.go"},"region":{"startLine":669}}}],"partialFingerprints":{"codehealthFindingId/v1":"257dab31e891dffea2432ddf69f2fda29759784d6d73a962e8de417161335061"}},{"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":"Map.createEdge (cyclomatic 45): Map.createEdge 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":"d2ir/d2ir.go"},"region":{"startLine":1717}}}],"partialFingerprints":{"codehealthFindingId/v1":"1b19959cef8f046872a29373a8f2e50598b2c43de7c37204c56af2fa0d5cf945"}},{"ruleId":"D1","level":"warning","message":{"text":"sizedOptimizer.optimizeGuarded (cyclomatic 45): sizedOptimizer.optimizeGuarded has cyclomatic complexity 45 (threshold 15). Of this number, 41 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":"d2layouts/d2talalayout/internal/placement/sized_optimizer.go"},"region":{"startLine":279}}}],"partialFingerprints":{"codehealthFindingId/v1":"bdbb545a776feb42d976afcce51a26e53e4b03d9869384be45c4b4e64df7f5b9"}},{"ruleId":"D1","level":"warning","message":{"text":"routing.balanceReversalRemovesCrossings (cyclomatic 45): routing.balanceReversalRemovesCrossings 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":"d2layouts/d2talalayout/internal/routing/balance_crossings.go"},"region":{"startLine":17}}}],"partialFingerprints":{"codehealthFindingId/v1":"cab51217cc6f3300f382d20317902a37f5a2367c9923a51f9fcb1c7e54f89639"}},{"ruleId":"D1","level":"warning","message":{"text":"routing.reorderDuplicatesInEdges (cyclomatic 45): routing.reorderDuplicatesInEdges has cyclomatic complexity 45 (threshold 15). Of this number, 42 points are the body\u0027s own statements and 3 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/coordinator.go"},"region":{"startLine":1633}}}],"partialFingerprints":{"codehealthFindingId/v1":"72778afa240fba331eae8eef8a5762d6b3502cee80bdbabc43cf8116de24c116"}},{"ruleId":"D1","level":"warning","message":{"text":"routing.simplifyPoints (cyclomatic 45): routing.simplifyPoints 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":"d2layouts/d2talalayout/internal/routing/edge_simplify.go"},"region":{"startLine":37}}}],"partialFingerprints":{"codehealthFindingId/v1":"c03f04756b5fd3ba36071d19dc3e729c582ae1ad6041555062b7e67c444d7db6"}},{"ruleId":"D1","level":"warning","message":{"text":"routing.routeEdgesWithBudgets (cyclomatic 45): routing.routeEdgesWithBudgets has cyclomatic complexity 45 (threshold 15). Of this number, 26 points are the body\u0027s own statements and 19 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/d2talalayout/internal/routing/standalone_router.go"},"region":{"startLine":27}}}],"partialFingerprints":{"codehealthFindingId/v1":"9007a158f7394b691e98725b321b1057f20368bd611f89c9dbaa6f20cc055301"}},{"ruleId":"D1","level":"warning","message":{"text":"d2raster.maskRenderBounds (cyclomatic 45): d2raster.maskRenderBounds has cyclomatic complexity 45 (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/d2raster/mask_regions.go"},"region":{"startLine":21}}}],"partialFingerprints":{"codehealthFindingId/v1":"41e31b7152b1b46c0677011ccc04a1dd46f2bac8fd834136390f06382bc71771"}},{"ruleId":"D1","level":"warning","message":{"text":"routing.channelProposalSafe (cyclomatic 44): routing.channelProposalSafe 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":"d2layouts/d2talalayout/internal/routing/nudge_channels.go"},"region":{"startLine":602}}}],"partialFingerprints":{"codehealthFindingId/v1":"927694a2ba69cb278b72cde00c92744baf9730750976b08f5ea2f5e32eb44991"}},{"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":"parser.parseUnquotedString (cyclomatic 44): parser.parseUnquotedString has cyclomatic complexity 44 (threshold 15). Of this number, 39 points are the body\u0027s own statements and 5 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2parser/parse.go"},"region":{"startLine":1129}}}],"partialFingerprints":{"codehealthFindingId/v1":"079d354b927509204a55023b56a5204e9702a03047391a68d33789d312385c25"}},{"ruleId":"D1","level":"warning","message":{"text":"main.writeArchive (cyclomatic 43): main.writeArchive has cyclomatic complexity 43 (threshold 15). Of this number, 34 points are the body\u0027s own statements and 9 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"ci/release/releasetool/main.go"},"region":{"startLine":158}}}],"partialFingerprints":{"codehealthFindingId/v1":"6f456c2ae149f9fa9248bd3e7bcd1a1344c2e0d69c9e1144859ce465c692d4a3"}},{"ruleId":"D1","level":"warning","message":{"text":"placement.initializeByGraphDistance (cyclomatic 43): placement.initializeByGraphDistance has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/stress_initialize.go"},"region":{"startLine":16}}}],"partialFingerprints":{"codehealthFindingId/v1":"47f3756933ecbaa01eef76b5ae7412b845cb9daf879063c74e92f43d6c188fd2"}},{"ruleId":"D1","level":"warning","message":{"text":"sizedOptimizer.fillPlacementPointsGuarded (cyclomatic 43): sizedOptimizer.fillPlacementPointsGuarded has cyclomatic complexity 43 (threshold 15). Of this number, 36 points are the body\u0027s own statements and 7 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/sized_optimizer.go"},"region":{"startLine":715}}}],"partialFingerprints":{"codehealthFindingId/v1":"b269bf155d0e4786c1beb9b9888acd27ae7eb35068fe55d19c2570d70f2228ff"}},{"ruleId":"D1","level":"warning","message":{"text":"proximity.AssignHerds (cyclomatic 43): proximity.AssignHerds has cyclomatic complexity 43 (threshold 15). Of this number, 41 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own 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/d2talalayout/internal/proximity/herding.go"},"region":{"startLine":16}}}],"partialFingerprints":{"codehealthFindingId/v1":"b578b9a7acaf200da6a255eacf1663f33a65160d5e8084339c929d941f7e7163"}},{"ruleId":"D1","level":"warning","message":{"text":"routing.shortcutRoutesGuarded (cyclomatic 43): routing.shortcutRoutesGuarded has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/shortcut_routes.go"},"region":{"startLine":69}}}],"partialFingerprints":{"codehealthFindingId/v1":"081d34a41d41c60a34d3734e8c450c615fa27c9edcec382c9ac48e8f79e8fa53"}},{"ruleId":"D1","level":"warning","message":{"text":"SystemFallbackResolver.ResolveFallbacks (cyclomatic 43): SystemFallbackResolver.ResolveFallbacks has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2fonts/fallback.go"},"region":{"startLine":121}}}],"partialFingerprints":{"codehealthFindingId/v1":"16cb2b0e0b4ccaaea330c1c3220e49d209c4ac90d0b367ae2d28d2033e8832fd"}},{"ruleId":"D1","level":"warning","message":{"text":"svgImporter.compileGeometry (cyclomatic 43): svgImporter.compileGeometry has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svgimport/geometry.go"},"region":{"startLine":33}}}],"partialFingerprints":{"codehealthFindingId/v1":"eca9cf261d76013c59f0714118ed3289283439278e92faddfec604048e2e1a05"}},{"ruleId":"D1","level":"warning","message":{"text":"grouping.ResetClusters (cyclomatic 42): grouping.ResetClusters has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/grouping/lifecycle.go"},"region":{"startLine":7}}}],"partialFingerprints":{"codehealthFindingId/v1":"4f5758c3b20ee0c4118c6289e0b55a151fc997ec42cc397145d746bd94995cdf"}},{"ruleId":"D1","level":"warning","message":{"text":"hierarchy.findCycleEdges (cyclomatic 42): hierarchy.findCycleEdges has cyclomatic complexity 42 (threshold 15). Of this number, 33 points are the body\u0027s own statements and 9 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own 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/d2talalayout/internal/hierarchy/discovery.go"},"region":{"startLine":579}}}],"partialFingerprints":{"codehealthFindingId/v1":"fb7d28bab0da696936541d62c24942f69554c016fa52a4c726153e057c534201"}},{"ruleId":"D1","level":"warning","message":{"text":"labeling.placeNewEdges (cyclomatic 42): labeling.placeNewEdges has cyclomatic complexity 42 (threshold 15). Of this number, 40 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/d2talalayout/internal/labeling/placement.go"},"region":{"startLine":462}}}],"partialFingerprints":{"codehealthFindingId/v1":"672a02fadb1e7190bb623308010506f478587a45b52cf2fc7cf59ffde38eb104"}},{"ruleId":"D1","level":"warning","message":{"text":"packing.allEdgesHaveCompleteRoutesGuarded (cyclomatic 42): packing.allEdgesHaveCompleteRoutesGuarded has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/packing/guard.go"},"region":{"startLine":471}}}],"partialFingerprints":{"codehealthFindingId/v1":"9ec2f9ace592861bb2d66b843ec1c831224fcbe2d9f602b93c39557a6a08a509"}},{"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":2972}}}],"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":215}}}],"partialFingerprints":{"codehealthFindingId/v1":"ee30699888f54f8df17f328ee603925285abe34e776049a6b1d2a5951cc36a8d"}},{"ruleId":"D1","level":"warning","message":{"text":"svgImporter.instantiate (cyclomatic 42): svgImporter.instantiate has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svgimport/compile.go"},"region":{"startLine":386}}}],"partialFingerprints":{"codehealthFindingId/v1":"71bf22d356099bc042b4309848deee9fa51f611d2a284e57fd76c90bb03c2170"}},{"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.renderIsometricImages (cyclomatic 41): d2cli.renderIsometricImages has cyclomatic complexity 41 (threshold 15). Of this number, 31 points are the body\u0027s own statements and 10 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2cli/isometric_image.go"},"region":{"startLine":120}}}],"partialFingerprints":{"codehealthFindingId/v1":"12093cfed593dccca9aedf2cd48b4f046a5ed2cdfecb3853066299630bb33084"}},{"ruleId":"D1","level":"warning","message":{"text":"compiler.compileField (cyclomatic 41): compiler.compileField 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":"d2compiler/compile.go"},"region":{"startLine":651}}}],"partialFingerprints":{"codehealthFindingId/v1":"9921a92d2d4e7607e8f46588919f8735d2cdfa9ce4150fab59483c4115caed66"}},{"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":"compiler.compileMap (cyclomatic 41): compiler.compileMap 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":"d2ir/compile.go"},"region":{"startLine":971}}}],"partialFingerprints":{"codehealthFindingId/v1":"bc359e4851893055ed977982a3e0d25f4cc8b155b6c138de0d4a5c98af97e984"}},{"ruleId":"D1","level":"warning","message":{"text":"d2elklayout.deleteBends (cyclomatic 41): d2elklayout.deleteBends 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/d2elklayout/layout.go"},"region":{"startLine":770}}}],"partialFingerprints":{"codehealthFindingId/v1":"463222d1417af988e05bd9f313c69e161a98a0ac253cad9c7359130d5dd0abbe"}},{"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":23}}}],"partialFingerprints":{"codehealthFindingId/v1":"710b322479dd4506a8ac7afa717c347bda489dc891eaf807d507c07f5c8ca5ef"}},{"ruleId":"D1","level":"warning","message":{"text":"Node.reachableNodesGuarded (cyclomatic 41): Node.reachableNodesGuarded has cyclomatic complexity 41 (threshold 15). Of this number, 38 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":"d2layouts/d2talalayout/internal/layoutgraph/node.go"},"region":{"startLine":1670}}}],"partialFingerprints":{"codehealthFindingId/v1":"50a517dfa2e667be97e2db0e71677c8d1ead5d44c4adaf235e5f5cd2e2fdd24e"}},{"ruleId":"D1","level":"warning","message":{"text":"placement.shiftSubgraphs (cyclomatic 41): placement.shiftSubgraphs has cyclomatic complexity 41 (threshold 15). Of this number, 38 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":"d2layouts/d2talalayout/internal/placement/compaction.go"},"region":{"startLine":145}}}],"partialFingerprints":{"codehealthFindingId/v1":"387c10bbeedc243d82a0d15f3a1e8e8d31dc956ab72a12add8918af9d382f523"}},{"ruleId":"D1","level":"warning","message":{"text":"sizedOptimizer.bestSwapCandidateGuarded (cyclomatic 41): sizedOptimizer.bestSwapCandidateGuarded has cyclomatic complexity 41 (threshold 15). Of this number, 28 points are the body\u0027s own statements and 13 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/d2talalayout/internal/placement/sized_optimizer.go"},"region":{"startLine":1027}}}],"partialFingerprints":{"codehealthFindingId/v1":"f19aac48cee067ba15ae6acfccc01c07288fb9e0958c6e2b5885bbaeecf460bb"}},{"ruleId":"D1","level":"warning","message":{"text":"routing.edgeCanOverlapEdges (cyclomatic 41): routing.edgeCanOverlapEdges 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/d2talalayout/internal/routing/coordinator.go"},"region":{"startLine":1208}}}],"partialFingerprints":{"codehealthFindingId/v1":"cca2b2d521b2524ae897a65be1838832947b4c59ff0092d500052ac15b5ba369"}},{"ruleId":"D1","level":"warning","message":{"text":"routing.overshot (cyclomatic 41): routing.overshot 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/d2talalayout/internal/routing/slingshot.go"},"region":{"startLine":219}}}],"partialFingerprints":{"codehealthFindingId/v1":"138715fe66bab579f5aad72e369761966ce86eabbdcb906953e71f18a886caac"}},{"ruleId":"D1","level":"warning","message":{"text":"OVG.connectNodesOnSameLine (cyclomatic 41): OVG.connectNodesOnSameLine has cyclomatic complexity 41 (threshold 15). Of this number, 37 points are the body\u0027s own statements and 4 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/ovg.go"},"region":{"startLine":1223}}}],"partialFingerprints":{"codehealthFindingId/v1":"9c9e2ae004e88aca08c703dd5cc70a8e271b6597e8394984f2b99d6a13949f12"}},{"ruleId":"D1","level":"warning","message":{"text":"d2isometricimg.rasterValidate (cyclomatic 41): d2isometricimg.rasterValidate 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":"d2renderers/d2isometric/d2isometricimg/raster.go"},"region":{"startLine":475}}}],"partialFingerprints":{"codehealthFindingId/v1":"cc69361230b452d2d474f2c600147e5962c3c00e0dd74d089c9aa266f5cb95a0"}},{"ruleId":"D1","level":"warning","message":{"text":"builder.buildShape (cyclomatic 41): builder.buildShape 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":"d2renderers/d2scenebuild/build.go"},"region":{"startLine":828}}}],"partialFingerprints":{"codehealthFindingId/v1":"161d3f7647789b94c402ce9302693717789c370078d3d46b448810468b524190"}},{"ruleId":"D1","level":"warning","message":{"text":"svgImporter.validateXMLDeclaration (cyclomatic 41): svgImporter.validateXMLDeclaration has cyclomatic complexity 41 (threshold 15). Of this number, 37 points are the body\u0027s own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own 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/d2svgimport/import.go"},"region":{"startLine":604}}}],"partialFingerprints":{"codehealthFindingId/v1":"0f0484ac73ef3e78eedd45c3f028d5892ee89f687e09af80fdeeff403bbf3ab2"}},{"ruleId":"D1","level":"warning","message":{"text":"imageasset.validateSVGWithLimits (cyclomatic 41): imageasset.validateSVGWithLimits 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":"lib/imageasset/probe.go"},"region":{"startLine":457}}}],"partialFingerprints":{"codehealthFindingId/v1":"e675e46c35d4bca43f4361405d2e21ad49006d5e3c3fe311e96d2aa048a6907e"}},{"ruleId":"D1","level":"warning","message":{"text":"d2elklayout.ConvertGraph (cyclomatic 40): d2elklayout.ConvertGraph has cyclomatic complexity 40 (threshold 15). Of this number, 19 points are the body\u0027s own statements and 21 belong to 2 function literals inside it that branch. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2elklayout/wasm.go"},"region":{"startLine":23}}}],"partialFingerprints":{"codehealthFindingId/v1":"b9622301a521bdec8bdb994d22f33df9f95b235d0ef7d4b7eecb44fa359217fb"}},{"ruleId":"D1","level":"warning","message":{"text":"Graph.abductEdges (cyclomatic 40): Graph.abductEdges 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":"d2layouts/d2talalayout/internal/layoutgraph/layout.go"},"region":{"startLine":163}}}],"partialFingerprints":{"codehealthFindingId/v1":"a5690404f589f07c3dec481ff5b53f1b9c4f3661dcbcb4a2a978757c9d70cd54"}},{"ruleId":"D1","level":"warning","message":{"text":"placement.captureOptimizerMutationStateInto (cyclomatic 40): placement.captureOptimizerMutationStateInto has cyclomatic complexity 40 (threshold 15). Of this number, 36 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":"d2layouts/d2talalayout/internal/placement/optimization_guard.go"},"region":{"startLine":814}}}],"partialFingerprints":{"codehealthFindingId/v1":"cc0a4b90642a1b8c27e6565f06f997f74fdd4decd3e886516b5bda64a20026c9"}},{"ruleId":"D1","level":"warning","message":{"text":"d2lsp.getKeywordContext (cyclomatic 40): d2lsp.getKeywordContext 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":"d2lsp/completion.go"},"region":{"startLine":120}}}],"partialFingerprints":{"codehealthFindingId/v1":"c730347af6a4adfb8952867df7a073050105081da4f3acf1fb4b8ff597fcb3fc"}},{"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":937}}}],"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":2778}}}],"partialFingerprints":{"codehealthFindingId/v1":"7c2f953e8f5414e7daa6572f605ab01dc56118e3f38943c2424217d2b3e4c5e2"}},{"ruleId":"D1","level":"warning","message":{"text":"d2isometricimg.richLabelDocumentWithResources (cyclomatic 40): d2isometricimg.richLabelDocumentWithResources 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":"d2renderers/d2isometric/d2isometricimg/rich_labels.go"},"region":{"startLine":222}}}],"partialFingerprints":{"codehealthFindingId/v1":"53735d644ec00d37cadca33eeacdb344ee4257761ac9deac0eb67480241e7a01"}},{"ruleId":"D1","level":"warning","message":{"text":"Raster.drawPrepared (cyclomatic 40): Raster.drawPrepared 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":"d2renderers/d2isometric/d2isometricimg/raster.go"},"region":{"startLine":928}}}],"partialFingerprints":{"codehealthFindingId/v1":"05d637a54bde9bd17507f59a630d5100915a59de3f3846a3edc9caef8d1ce45d"}},{"ruleId":"D1","level":"warning","message":{"text":"d2raster.compositeLayerOver (cyclomatic 40): d2raster.compositeLayerOver 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":"d2renderers/d2raster/effects.go"},"region":{"startLine":1760}}}],"partialFingerprints":{"codehealthFindingId/v1":"80b04985a0da9d530a5784be9f0f83e59ca0316e9c2cd8d739d691a769e07b92"}},{"ruleId":"D1","level":"warning","message":{"text":"d2raster.makeStrokeRuns (cyclomatic 40): d2raster.makeStrokeRuns 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":"d2renderers/d2raster/geometry.go"},"region":{"startLine":529}}}],"partialFingerprints":{"codehealthFindingId/v1":"462106d9acd9b86b1e9ee8d8c0a6389534c8a288a0883982e0150d92203783de"}},{"ruleId":"D1","level":"warning","message":{"text":"svgImporter.compileElement (cyclomatic 40): svgImporter.compileElement 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":"d2renderers/d2svgimport/compile.go"},"region":{"startLine":242}}}],"partialFingerprints":{"codehealthFindingId/v1":"3aa6d0d497819af989a73148d8803e15660328f1ef3eb3c4780d90ef1b81f777"}},{"ruleId":"D1","level":"warning","message":{"text":"d2talalayout.validateD2Edges (cyclomatic 39): d2talalayout.validateD2Edges has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/adapter_validate.go"},"region":{"startLine":383}}}],"partialFingerprints":{"codehealthFindingId/v1":"d2dfdeff0248e8fefae0de3a36dc2c491ea37cc86306b2bc293c151326bf1520"}},{"ruleId":"D1","level":"warning","message":{"text":"placement.placeNodesOrthogonally (cyclomatic 39): placement.placeNodesOrthogonally has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/node_placement.go"},"region":{"startLine":246}}}],"partialFingerprints":{"codehealthFindingId/v1":"ddf15c3bb4a86b7dc1ceac317eb5162715a223dce956b36d907a9cc6ad002c27"}},{"ruleId":"D1","level":"warning","message":{"text":"d2isometricimg.rasterBuildShadow (cyclomatic 39): d2isometricimg.rasterBuildShadow has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/raster.go"},"region":{"startLine":691}}}],"partialFingerprints":{"codehealthFindingId/v1":"9f20b26985e14ceced163ac7b86ec9fdb154b12cf60aa9ec669ba8114293b761"}},{"ruleId":"D1","level":"warning","message":{"text":"meshBuilder.sequenceEdge (cyclomatic 39): meshBuilder.sequenceEdge has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/sequence_routes.go"},"region":{"startLine":175}}}],"partialFingerprints":{"codehealthFindingId/v1":"c38ca6b1ae3ef0283c877fa94681e32cdc49e7362863d54d2b65bde0939f1bcb"}},{"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":510}}}],"partialFingerprints":{"codehealthFindingId/v1":"d55a5d72a945264cd125983e1a7f8e719b3f447f953c0416a99d24cb28ab7fa3"}},{"ruleId":"D1","level":"warning","message":{"text":"ovgEdgeRouter.addRoute (cyclomatic 38): ovgEdgeRouter.addRoute 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":"d2layouts/d2talalayout/internal/routing/ovg_edge_router.go"},"region":{"startLine":1659}}}],"partialFingerprints":{"codehealthFindingId/v1":"a6a7ade3d36d580431698a5083ad1b609fc0a13c32c1f721ee520b9975e1b993"}},{"ruleId":"D1","level":"warning","message":{"text":"BundledFallbackResolver.resolve (cyclomatic 38): BundledFallbackResolver.resolve 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":"d2renderers/d2fonts/bundled_fallback.go"},"region":{"startLine":94}}}],"partialFingerprints":{"codehealthFindingId/v1":"316e4dfd1e26e8ffa3d28c619b18acb1ded12c98081ce07eb66822f511e968cb"}},{"ruleId":"D1","level":"warning","message":{"text":"d2isometric.classifySequence (cyclomatic 38): d2isometric.classifySequence has cyclomatic complexity 38 (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/d2isometric/sequence.go"},"region":{"startLine":15}}}],"partialFingerprints":{"codehealthFindingId/v1":"0d2731bc1dce17a0ddd6847a91ca9c423ce5f8e735cd45c30639ea6a93f047f0"}},{"ruleId":"D1","level":"warning","message":{"text":"preflight.positionGlyphs (cyclomatic 38): preflight.positionGlyphs 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":"d2renderers/d2raster/text.go"},"region":{"startLine":456}}}],"partialFingerprints":{"codehealthFindingId/v1":"058658f9ebc6bdb602e00ee745a9fafe78b7ae174f96d95ef988d5d7d0440395"}},{"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":"layoutgraph.ValidatePositionedGraphSelection (cyclomatic 37): layoutgraph.ValidatePositionedGraphSelection has cyclomatic complexity 37 (threshold 15). Of this number, 21 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":"d2layouts/d2talalayout/internal/layoutgraph/positioned_validation.go"},"region":{"startLine":16}}}],"partialFingerprints":{"codehealthFindingId/v1":"e78cf9a12f888e2e6c44fa975acc65fc3e1522c65d397eba29011fff8c06557d"}},{"ruleId":"D1","level":"warning","message":{"text":"sizedOptimizer.moveNodeToBestGuarded (cyclomatic 37): sizedOptimizer.moveNodeToBestGuarded has cyclomatic complexity 37 (threshold 15). Of this number, 36 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own 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/d2talalayout/internal/placement/sized_optimizer.go"},"region":{"startLine":887}}}],"partialFingerprints":{"codehealthFindingId/v1":"b8af165d51642238e75b8c8bc47537c404d0631bd8576ea5dd6f6ae9c9fc00ed"}},{"ruleId":"D1","level":"warning","message":{"text":"routing.shortcutContactsPreserved (cyclomatic 37): routing.shortcutContactsPreserved 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/d2talalayout/internal/routing/shortcut_routes.go"},"region":{"startLine":300}}}],"partialFingerprints":{"codehealthFindingId/v1":"21aa0d5b0f3fa043e8877e0ed5f178dd5ded0a58c9154b1eb394153e5aa89299"}},{"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":2328}}}],"partialFingerprints":{"codehealthFindingId/v1":"961e51bc05f3823e1f0604d91fbaf9a11f9103d964d778ad24c2962def18c962"}},{"ruleId":"D1","level":"warning","message":{"text":"d2raster.flattenScenePath (cyclomatic 37): d2raster.flattenScenePath has cyclomatic complexity 37 (threshold 15). Of this number, 29 points are the body\u0027s own statements and 8 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/geometry.go"},"region":{"startLine":60}}}],"partialFingerprints":{"codehealthFindingId/v1":"73beaddc01cd32807c63bcf3851693815fb3a270a31cc245fa1e4fe41cfbca7f"}},{"ruleId":"D1","level":"warning","message":{"text":"builder.measureLegend (cyclomatic 37): builder.measureLegend has cyclomatic complexity 37 (threshold 15). Of this number, 32 points are the body\u0027s own statements and 5 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/legend.go"},"region":{"startLine":147}}}],"partialFingerprints":{"codehealthFindingId/v1":"e749f4570c0c0598bbf741ee465d87c39063f4b09294bf66666558cb454e3db1"}},{"ruleId":"D1","level":"warning","message":{"text":"d2svgimport.inspectEmbeddedJPEG (cyclomatic 37): d2svgimport.inspectEmbeddedJPEG 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":"d2renderers/d2svgimport/image.go"},"region":{"startLine":377}}}],"partialFingerprints":{"codehealthFindingId/v1":"c6796d22e4ff185f9d44db912300b811716b842d384dfee5a59851853e40cd1c"}},{"ruleId":"D1","level":"warning","message":{"text":"Graph.splitSubgraphsWithOwnership (cyclomatic 36): Graph.splitSubgraphsWithOwnership has cyclomatic complexity 36 (threshold 15). Of this number, 26 points are the body\u0027s own statements and 10 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/graph.go"},"region":{"startLine":674}}}],"partialFingerprints":{"codehealthFindingId/v1":"8b733c2c28082311140a88fda9dc351620083e744290d0c3c786f49830a4902b"}},{"ruleId":"D1","level":"warning","message":{"text":"Node.ConnectedNodeSet (cyclomatic 36): Node.ConnectedNodeSet has cyclomatic complexity 36 (threshold 15). Of this number, 35 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the 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":"d2layouts/d2talalayout/internal/layoutgraph/connected_set.go"},"region":{"startLine":25}}}],"partialFingerprints":{"codehealthFindingId/v1":"81d982d31601f8d39314a5274796af18fe116fa58ab682047437b4305e67d039"}},{"ruleId":"D1","level":"warning","message":{"text":"placement.alignAxes (cyclomatic 36): placement.alignAxes has cyclomatic complexity 36 (threshold 15). Of this number, 35 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/alignment.go"},"region":{"startLine":26}}}],"partialFingerprints":{"codehealthFindingId/v1":"77c177d040450c0f9c71b6fdbec6c72a85e51faee2b678bc17f8a93471f1da06"}},{"ruleId":"D1","level":"warning","message":{"text":"routing.validateRouteStageGeometry (cyclomatic 36): routing.validateRouteStageGeometry has cyclomatic complexity 36 (threshold 15). Most of this is not in the body itself: 11 of the 36 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 312, 287, 282). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals\u0027 work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/route_stage_guard.go"},"region":{"startLine":278}}}],"partialFingerprints":{"codehealthFindingId/v1":"34c8e147be8813fed7bd9daaef6df11f642c9f3655269cd6757fa4c35478eccb"}},{"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":"d2isometricimg.RenderTimeline (cyclomatic 36): d2isometricimg.RenderTimeline 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/d2isometric/d2isometricimg/timeline.go"},"region":{"startLine":26}}}],"partialFingerprints":{"codehealthFindingId/v1":"7b0c1caf31be4e28d04f0bc727e65eee5de888f20380ec80fdb1666daa2784ba"}},{"ruleId":"D1","level":"warning","message":{"text":"d2raster.boxBlurAlphaPixelsGeneral (cyclomatic 36): d2raster.boxBlurAlphaPixelsGeneral 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/d2raster/filter.go"},"region":{"startLine":838}}}],"partialFingerprints":{"codehealthFindingId/v1":"a25060521077e8e8b8b9f8a092a373b1df704fb9cf6afd26dac9b5fcc09219bb"}},{"ruleId":"D1","level":"warning","message":{"text":"d2raster.rgbaToNRGBAInPlaceBounds (cyclomatic 36): d2raster.rgbaToNRGBAInPlaceBounds 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/d2raster/raster.go"},"region":{"startLine":462}}}],"partialFingerprints":{"codehealthFindingId/v1":"45a9a34fad5de793d0222b5b95b6b9cc26e5b0d343c3472537b93c2917cd3120"}},{"ruleId":"D1","level":"warning","message":{"text":"builder.preflightShape (cyclomatic 36): builder.preflightShape 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/d2scenebuild/build.go"},"region":{"startLine":324}}}],"partialFingerprints":{"codehealthFindingId/v1":"d896e59e2f1076815e410da670e3f74f2d41f4ecc82d98a64b1d02eec157bf47"}},{"ruleId":"D1","level":"warning","message":{"text":"svgImporter.validateFrozenMathJaxTextElement (cyclomatic 36): svgImporter.validateFrozenMathJaxTextElement has cyclomatic complexity 36 (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/d2svgimport/mathjax_text.go"},"region":{"startLine":57}}}],"partialFingerprints":{"codehealthFindingId/v1":"b4c1379707615126045a5001a180b008440bcd2078cf1ea9b963da6c69450ff9"}},{"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":1103}}}],"partialFingerprints":{"codehealthFindingId/v1":"343272c339fc4d325a0d2ea42aeb047925c151b22910d47cda654df3d7738265"}},{"ruleId":"D1","level":"warning","message":{"text":"d2talalayout.validateD2Objects (cyclomatic 35): d2talalayout.validateD2Objects 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":"d2layouts/d2talalayout/adapter_validate.go"},"region":{"startLine":100}}}],"partialFingerprints":{"codehealthFindingId/v1":"43ade65612e0e9ab3e23b9bc7f9b943bcba5b037d17debb09e1c4b9d87743592"}},{"ruleId":"D1","level":"warning","message":{"text":"graphCloneState.copy (cyclomatic 35): graphCloneState.copy 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":"d2layouts/d2talalayout/internal/layoutgraph/clone.go"},"region":{"startLine":86}}}],"partialFingerprints":{"codehealthFindingId/v1":"8dfadf84a5da51cc15ea7c6220b096adb7caff198515a92c0c95c23b43c425eb"}},{"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":1313}}}],"partialFingerprints":{"codehealthFindingId/v1":"1a4b0a8fa73cf5bcbb53780c34d785008c12dc00c5c249c618678e9bd408ed9e"}},{"ruleId":"D1","level":"warning","message":{"text":"retainedVectorValidator.node (cyclomatic 35): retainedVectorValidator.node 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":"d2renderers/d2raster/vector_validation.go"},"region":{"startLine":127}}}],"partialFingerprints":{"codehealthFindingId/v1":"c69f7ba4919916166bee13c52950a153fdd1e929cd401ee93fba7c6571207cb7"}},{"ruleId":"D1","level":"warning","message":{"text":"pathParser.number (cyclomatic 35): pathParser.number 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":"d2renderers/d2svgimport/path.go"},"region":{"startLine":324}}}],"partialFingerprints":{"codehealthFindingId/v1":"f4b9a2fe8152f4bb16f7024ca971282c64c7bc19aafc5858956d696afc38954c"}},{"ruleId":"D1","level":"warning","message":{"text":"rasterimage.buildFramePNG (cyclomatic 35): rasterimage.buildFramePNG 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":"internal/rasterimage/firstframe.go"},"region":{"startLine":524}}}],"partialFingerprints":{"codehealthFindingId/v1":"6818aa80398b8cd8d9e4f56c2b61003b879f4fdf15529915e1f777624dd10640"}},{"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":"rankSimplex.feasibleTree (cyclomatic 34): rankSimplex.feasibleTree has cyclomatic complexity 34 (threshold 15). Of this number, 26 points are the body\u0027s own statements and 8 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/hierarchy/rank_simplex.go"},"region":{"startLine":136}}}],"partialFingerprints":{"codehealthFindingId/v1":"1d0252060cc21876df01697ecbcc4f5cf7bd4834ab5c880124e9a5610693e8be"}},{"ruleId":"D1","level":"warning","message":{"text":"labeling.findSharedSegmentsChecked (cyclomatic 34): labeling.findSharedSegmentsChecked has cyclomatic complexity 34 (threshold 15). Of this number, 17 points are the body\u0027s own statements and 17 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/d2talalayout/internal/labeling/placement.go"},"region":{"startLine":1024}}}],"partialFingerprints":{"codehealthFindingId/v1":"8b86277383f6006b754e710034f55524e4c5574161a488007a3e69529a1a165c"}},{"ruleId":"D1","level":"warning","message":{"text":"routing.captureRouteMutations (cyclomatic 34): routing.captureRouteMutations has cyclomatic complexity 34 (threshold 15). Of this number, 25 points are the body\u0027s own statements and 9 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/route_stage_guard.go"},"region":{"startLine":147}}}],"partialFingerprints":{"codehealthFindingId/v1":"c74c6bd23662bba9bb2e486d18aa5e3fbf5c769a4f07336dc6cf269fcdb1f22a"}},{"ruleId":"D1","level":"warning","message":{"text":"trees.layoutTree (cyclomatic 34): trees.layoutTree has cyclomatic complexity 34 (threshold 15). Of this number, 31 points are the body\u0027s own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own 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/d2talalayout/internal/trees/geometry.go"},"region":{"startLine":113}}}],"partialFingerprints":{"codehealthFindingId/v1":"85835c362584f94238673bd63e30a2f5e22f1a233034a03995fb8626ecad6df8"}},{"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":1162}}}],"partialFingerprints":{"codehealthFindingId/v1":"258c90c17fe2ddf01e4f0bf72fc537efdfd7b35d7e8dbcff677ff6db3dca7011"}},{"ruleId":"D1","level":"warning","message":{"text":"d2isometricimg.surfaceIconLayout (cyclomatic 34): d2isometricimg.surfaceIconLayout 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":"d2renderers/d2isometric/d2isometricimg/surface_icons.go"},"region":{"startLine":306}}}],"partialFingerprints":{"codehealthFindingId/v1":"ca5806bb208204cac7aac7df5817e6a74fc4365586ceac36d89a9226e1ea9684"}},{"ruleId":"D1","level":"warning","message":{"text":"nativeSurfaceSVGWriter.text (cyclomatic 34): nativeSurfaceSVGWriter.text 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":"d2renderers/d2isometric/d2isometricimg/vector_surface_text.go"},"region":{"startLine":49}}}],"partialFingerprints":{"codehealthFindingId/v1":"41c95536e9d3d98ed7611e9b4c1b42fdc1c9b753abf252112c035bcecdce0c84"}},{"ruleId":"D1","level":"warning","message":{"text":"builder.arrowhead (cyclomatic 34): builder.arrowhead has cyclomatic complexity 34 (threshold 15). Of this number, 32 points are the body\u0027s own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/connection.go"},"region":{"startLine":430}}}],"partialFingerprints":{"codehealthFindingId/v1":"873b8152cb2acbfa63a661e0fbf621d80442b6f124bcbb1409936f3ab6486e3f"}},{"ruleId":"D1","level":"warning","message":{"text":"builder.compileLinkRegions (cyclomatic 34): builder.compileLinkRegions has cyclomatic complexity 34 (threshold 15). Of this number, 33 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own 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/d2scenebuild/metadata.go"},"region":{"startLine":16}}}],"partialFingerprints":{"codehealthFindingId/v1":"e3c83c8cf6918631490516730daff3245d636063ffc7ac7b370b006b922173de"}},{"ruleId":"D1","level":"warning","message":{"text":"markdownPainter.wrapInlineTokens (cyclomatic 34): markdownPainter.wrapInlineTokens 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":"lib/textmeasure/markdown_svg.go"},"region":{"startLine":983}}}],"partialFingerprints":{"codehealthFindingId/v1":"297bf5b3c589a1a607173d4fbd38d460fbbd7860b7434f0305fbe11c42f52a2c"}},{"ruleId":"D1","level":"warning","message":{"text":"xgif.validatePalettedImage (cyclomatic 34): xgif.validatePalettedImage 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":"lib/xgif/xgif.go"},"region":{"startLine":1341}}}],"partialFingerprints":{"codehealthFindingId/v1":"4eb2fe9077ba4295c7886cb2951f501efc03d7d8fd0dc06e74f91c85f4fb8749"}},{"ruleId":"D1","level":"warning","message":{"text":"d2cli.mapPagedLinks (cyclomatic 33): d2cli.mapPagedLinks has cyclomatic complexity 33 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2cli/paged.go"},"region":{"startLine":273}}}],"partialFingerprints":{"codehealthFindingId/v1":"f31113b17f939763543d78d19b364836c3a3774316e735930a9618d9c6e10746"}},{"ruleId":"D1","level":"warning","message":{"text":"compiler.compileMap (cyclomatic 33): compiler.compileMap 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":"d2compiler/compile.go"},"region":{"startLine":453}}}],"partialFingerprints":{"codehealthFindingId/v1":"5f861480c78d31b4f3255cf418d9dcffbc7c02df5113f2edc1f3274593063001"}},{"ruleId":"D1","level":"warning","message":{"text":"grouping.buildClusterDiscoveryIndex (cyclomatic 33): grouping.buildClusterDiscoveryIndex has cyclomatic complexity 33 (threshold 15). Of this number, 29 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":"d2layouts/d2talalayout/internal/grouping/cluster_discovery.go"},"region":{"startLine":265}}}],"partialFingerprints":{"codehealthFindingId/v1":"0268731ee30e0e1bdd7706cad3e11f20a7dbefddd007b83b564541805f8fd797"}},{"ruleId":"D1","level":"warning","message":{"text":"Node.connectedNodes (cyclomatic 33): Node.connectedNodes 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":"d2layouts/d2talalayout/internal/layoutgraph/node.go"},"region":{"startLine":1847}}}],"partialFingerprints":{"codehealthFindingId/v1":"cfa4aca5e2490b67cca42eecac0889fdf742d5a94976346d51f10c7f62d11c37"}},{"ruleId":"D1","level":"warning","message":{"text":"placement.moveNodeToBest (cyclomatic 33): placement.moveNodeToBest 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":"d2layouts/d2talalayout/internal/placement/moves.go"},"region":{"startLine":16}}}],"partialFingerprints":{"codehealthFindingId/v1":"2e409c73949d7c19b8e7c4fd5d5d19fa4ca804010ced264ededc379acb0133b9"}},{"ruleId":"D1","level":"warning","message":{"text":"routing.applyChannelProblem (cyclomatic 33): routing.applyChannelProblem 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":"d2layouts/d2talalayout/internal/routing/nudge_channels.go"},"region":{"startLine":441}}}],"partialFingerprints":{"codehealthFindingId/v1":"1b60d5232b844fea3dd1c4ed84fcbfca625b260222a0be4b15edeb8e3facafc0"}},{"ruleId":"D1","level":"warning","message":{"text":"ovgEdgeRouter.bestRoute (cyclomatic 33): ovgEdgeRouter.bestRoute 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":"d2layouts/d2talalayout/internal/routing/ovg_edge_router.go"},"region":{"startLine":1490}}}],"partialFingerprints":{"codehealthFindingId/v1":"b809bb155457b0678377b040e12f880ee4e3ed9127981e835b8adfd3ea09d393"}},{"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":1523}}}],"partialFingerprints":{"codehealthFindingId/v1":"3130b4c1e6c97595e921ad97fdb0522969935c23e757488de843e9439ee011e6"}},{"ruleId":"D1","level":"warning","message":{"text":"d2oracle.ReconnectEdgeIDDeltas (cyclomatic 33): d2oracle.ReconnectEdgeIDDeltas 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":"d2oracle/edit.go"},"region":{"startLine":2500}}}],"partialFingerprints":{"codehealthFindingId/v1":"b450aef83fca620b018245d4fd9d964a2a776000ccadac4937e6c40518d7dc80"}},{"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":531}}}],"partialFingerprints":{"codehealthFindingId/v1":"032196fc7041dd83d806887697b820777aa1b936dd2f6e4546b619abf357fb9c"}},{"ruleId":"D1","level":"warning","message":{"text":"main.discoverTests (cyclomatic 33): main.discoverTests has cyclomatic complexity 33 (threshold 15). Of this number, 17 points are the body\u0027s own statements and 16 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"e2etests/report/main.go"},"region":{"startLine":46}}}],"partialFingerprints":{"codehealthFindingId/v1":"7f50f6600cc70ec68d7c8ea97e7bbe703f6776ef99dca8fcafbf10328c0837d1"}},{"ruleId":"D1","level":"warning","message":{"text":"markdownSubstitutionMatcher.replaceBounded (cyclomatic 33): markdownSubstitutionMatcher.replaceBounded 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":"lib/textmeasure/substitutions.go"},"region":{"startLine":214}}}],"partialFingerprints":{"codehealthFindingId/v1":"d46dfe5f6ab6a7c4785a0f43bece89c5c4c945d7a6e4de6c750abb12f382cb3e"}},{"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":337}}}],"partialFingerprints":{"codehealthFindingId/v1":"ee64304f52262dcf24cc67c00501c3e7efc89bba5b9144f6acd28a1da385b4b4"}},{"ruleId":"D1","level":"warning","message":{"text":"placement.adjacents (cyclomatic 32): placement.adjacents 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":"d2layouts/d2talalayout/internal/placement/metrics.go"},"region":{"startLine":105}}}],"partialFingerprints":{"codehealthFindingId/v1":"91da0afaa5de33960886c88c41389d68fa183297e8f6f79dc51691f479210bf5"}},{"ruleId":"D1","level":"warning","message":{"text":"placementcost.flowContinuityCost (cyclomatic 32): placementcost.flowContinuityCost 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":"d2layouts/d2talalayout/internal/placementcost/flow_continuity.go"},"region":{"startLine":19}}}],"partialFingerprints":{"codehealthFindingId/v1":"cd57c3ece5d471211b1458b34157e1740ae0f92a1312d36478ce838c3ade5ca0"}},{"ruleId":"D1","level":"warning","message":{"text":"d2isometricimg.newRaster (cyclomatic 32): d2isometricimg.newRaster 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":"d2renderers/d2isometric/d2isometricimg/raster.go"},"region":{"startLine":165}}}],"partialFingerprints":{"codehealthFindingId/v1":"f72049d93c65296d26451f2d1af1788f83833a410865cfd2c642f28fbf14cee7"}},{"ruleId":"D1","level":"warning","message":{"text":"d2raster.boxBlurRGBAGeneral (cyclomatic 32): d2raster.boxBlurRGBAGeneral 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":"d2renderers/d2raster/filter.go"},"region":{"startLine":653}}}],"partialFingerprints":{"codehealthFindingId/v1":"e0b8744e1ff48fe6489de69a197735db62263d98256444f5e40a365bf30328dd"}},{"ruleId":"D1","level":"warning","message":{"text":"svgImporter.parseEmbeddedRasterDataURI (cyclomatic 32): svgImporter.parseEmbeddedRasterDataURI 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":"d2renderers/d2svgimport/image.go"},"region":{"startLine":199}}}],"partialFingerprints":{"codehealthFindingId/v1":"90071bed4376d5c5b7e13cc7892bd72562348b5088ec3006fee5dc145cbed601"}},{"ruleId":"D1","level":"warning","message":{"text":"d2cli.renderGIFWithSession (cyclomatic 31): d2cli.renderGIFWithSession has cyclomatic complexity 31 (threshold 15). Of this number, 26 points are the body\u0027s own statements and 5 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2cli/raster.go"},"region":{"startLine":555}}}],"partialFingerprints":{"codehealthFindingId/v1":"373aad8e6084197d4f08a9a74cd2570055726dcd90ce8301e6d1b939fae1c67a"}},{"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":1510}}}],"partialFingerprints":{"codehealthFindingId/v1":"635cc53641aed4858afcd07fb9a25b397b041905778dde64f09052bb959d0b46"}},{"ruleId":"D1","level":"warning","message":{"text":"compiler.compileSubstitutionsWalk (cyclomatic 31): compiler.compileSubstitutionsWalk 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":270}}}],"partialFingerprints":{"codehealthFindingId/v1":"239d6f5e5fd4e9c2362e2f09a007020fbb024d917b9960584ee7c719de12a98e"}},{"ruleId":"D1","level":"warning","message":{"text":"hierarchy.is1N1 (cyclomatic 31): hierarchy.is1N1 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":"d2layouts/d2talalayout/internal/hierarchy/discovery.go"},"region":{"startLine":367}}}],"partialFingerprints":{"codehealthFindingId/v1":"0c98de95bc22a810b19e306e057a6f557a088eaddcef1a08385c088892a2a3b0"}},{"ruleId":"D1","level":"warning","message":{"text":"placement.candidateMoves (cyclomatic 31): placement.candidateMoves 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":"d2layouts/d2talalayout/internal/placement/compaction.go"},"region":{"startLine":577}}}],"partialFingerprints":{"codehealthFindingId/v1":"79d00838de39b1949d8a2631e1d9049631c144537d9b19c28a2039f4baa11384"}},{"ruleId":"D1","level":"warning","message":{"text":"placement.PlaceChildrenOrder (cyclomatic 31): placement.PlaceChildrenOrder 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":"d2layouts/d2talalayout/internal/placement/node_placement.go"},"region":{"startLine":461}}}],"partialFingerprints":{"codehealthFindingId/v1":"6bf18ffc4e76822da9d0113c529d5b9b8d753fb6657afcb10f6eec8bd0d9b8e2"}},{"ruleId":"D1","level":"warning","message":{"text":"optimizerSpatialIndex.doesOverlap (cyclomatic 31): optimizerSpatialIndex.doesOverlap 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":"d2layouts/d2talalayout/internal/placement/optimizer_spatial_index.go"},"region":{"startLine":281}}}],"partialFingerprints":{"codehealthFindingId/v1":"86437b009ee7c37d8197db55bc3676de16b417796e7122fc25e7244cfd095e81"}},{"ruleId":"D1","level":"warning","message":{"text":"routing.finalizeSelectedRoutes (cyclomatic 31): routing.finalizeSelectedRoutes has cyclomatic complexity 31 (threshold 15). Of this number, 30 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own 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/d2talalayout/internal/routing/coordinator.go"},"region":{"startLine":205}}}],"partialFingerprints":{"codehealthFindingId/v1":"6cad9b063da2152dc22c9d0181b2264960f09eb393c94567c91091ecdee4c7c7"}},{"ruleId":"D1","level":"warning","message":{"text":"routing.routeInSShape (cyclomatic 31): routing.routeInSShape has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 11 of the 31 points are its own statements and the rest belongs to one function literal inside it that branches (line 741). 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/d2talalayout/internal/routing/coordinator.go"},"region":{"startLine":725}}}],"partialFingerprints":{"codehealthFindingId/v1":"396e4ba78e39b05aa1532038d9a7c20dc6d3187bffa8ef76078b1524fe2150d3"}},{"ruleId":"D1","level":"warning","message":{"text":"meshBuilder.arrowWithOpacity (cyclomatic 31): meshBuilder.arrowWithOpacity has cyclomatic complexity 31 (threshold 15). Of this number, 24 points are the body\u0027s own statements and 7 belong to 4 function literals inside it that branch. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/geometry_routes.go"},"region":{"startLine":171}}}],"partialFingerprints":{"codehealthFindingId/v1":"cfa0841d708e76bba9cd9ace7909a7f9dc0e6e98ec8d63fb500dee9575b57c6b"}},{"ruleId":"D1","level":"warning","message":{"text":"meshBuilder.classicInkEdges (cyclomatic 31): meshBuilder.classicInkEdges has cyclomatic complexity 31 (threshold 15). Of this number, 28 points are the body\u0027s own statements and 3 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/native_edges.go"},"region":{"startLine":429}}}],"partialFingerprints":{"codehealthFindingId/v1":"c45eae86b7f955db0eac494cf8f826738a36078f5b6647c62063022d2d1d52cd"}},{"ruleId":"D1","level":"warning","message":{"text":"meshBuilder.rootDecorations (cyclomatic 31): meshBuilder.rootDecorations 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":"d2renderers/d2isometric/d2isometricimg/source_panels.go"},"region":{"startLine":128}}}],"partialFingerprints":{"codehealthFindingId/v1":"b24a360065669bfbbbe1e28adb4d51c104a0f460b86750eb83be3ed76ebc5ead"}},{"ruleId":"D1","level":"warning","message":{"text":"d2raster.compositeBlendLayerOpaquePrefix (cyclomatic 31): d2raster.compositeBlendLayerOpaquePrefix 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":"d2renderers/d2raster/effects.go"},"region":{"startLine":1516}}}],"partialFingerprints":{"codehealthFindingId/v1":"d833eb4812c6d3cc60ab595d695d13e1dccbe0538a6f40da857dba01616cdd21"}},{"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":1710}}}],"partialFingerprints":{"codehealthFindingId/v1":"c72daec7eb6808db826cfea787f687d32e6d65b64aa7c037f3986977ac36f146"}},{"ruleId":"D1","level":"warning","message":{"text":"Map.getEdges (cyclomatic 30): Map.getEdges 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":"d2ir/d2ir.go"},"region":{"startLine":1593}}}],"partialFingerprints":{"codehealthFindingId/v1":"05633efe4a004c5c304ecd72e0285aca03ed0dc4ae85020c5b1d3016b81895df"}},{"ruleId":"D1","level":"warning","message":{"text":"d2layouts.extractSubgraphs (cyclomatic 30): d2layouts.extractSubgraphs has cyclomatic complexity 30 (threshold 15). Of this number, 25 points are the body\u0027s own statements and 5 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2layouts.go"},"region":{"startLine":456}}}],"partialFingerprints":{"codehealthFindingId/v1":"9497a22518e30cb7d204276ca02911dfe897611cf5d289a255f8ca7c59ec409f"}},{"ruleId":"D1","level":"warning","message":{"text":"d2talalayout.validateTopology (cyclomatic 30): d2talalayout.validateTopology 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":"d2layouts/d2talalayout/result_validate.go"},"region":{"startLine":37}}}],"partialFingerprints":{"codehealthFindingId/v1":"0c07758cc62e5b703fbc2d1655bc6a913deadfa383f0f9d5b68f6988f1299136"}},{"ruleId":"D1","level":"warning","message":{"text":"routing.reorderSelectedRoutes (cyclomatic 30): routing.reorderSelectedRoutes has cyclomatic complexity 30 (threshold 15). Of this number, 25 points are the body\u0027s own statements and 5 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/coordinator.go"},"region":{"startLine":305}}}],"partialFingerprints":{"codehealthFindingId/v1":"ad5b42423f916228499ce7e771910e4f8a6d46ffd0ad0ea4c2d7242051af664f"}},{"ruleId":"D1","level":"warning","message":{"text":"routing.buildOVGFromGraphWithGuard (cyclomatic 30): routing.buildOVGFromGraphWithGuard 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":"d2layouts/d2talalayout/internal/routing/ovg.go"},"region":{"startLine":130}}}],"partialFingerprints":{"codehealthFindingId/v1":"7b16a7e70172b973950dd5343680655644be4312928c0dc08f926b978b5e5fca"}},{"ruleId":"D1","level":"warning","message":{"text":"routing.newOVGPortIndex (cyclomatic 30): routing.newOVGPortIndex 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":"d2layouts/d2talalayout/internal/routing/ovg_resource.go"},"region":{"startLine":690}}}],"partialFingerprints":{"codehealthFindingId/v1":"cc2d75dfd82ba33ca327c401780ffe9df38b19e3b0b60080aa4346c552f66ba8"}},{"ruleId":"D1","level":"warning","message":{"text":"routing.shortcutCandidateSafe (cyclomatic 30): routing.shortcutCandidateSafe 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":"d2layouts/d2talalayout/internal/routing/shortcut_routes.go"},"region":{"startLine":227}}}],"partialFingerprints":{"codehealthFindingId/v1":"db3200551eb05804f0de73bc418299f32a58386b0c201fd64dc811f070c59b6d"}},{"ruleId":"D1","level":"warning","message":{"text":"meshBuilder.hierarchyBoard (cyclomatic 30): meshBuilder.hierarchyBoard 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":"d2renderers/d2isometric/d2isometricimg/hierarchy_boards.go"},"region":{"startLine":296}}}],"partialFingerprints":{"codehealthFindingId/v1":"7d8cf38d4d93d5a9493710c1531f4d2a20492065e21e2dcbb33d6544b8ee4e6e"}},{"ruleId":"D1","level":"warning","message":{"text":"richLabelPainter.texture (cyclomatic 30): richLabelPainter.texture has cyclomatic complexity 30 (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/d2isometric/d2isometricimg/rich_labels.go"},"region":{"startLine":78}}}],"partialFingerprints":{"codehealthFindingId/v1":"8a11ef745159424c1c45656cb7bc05328518ecefaa200d33b6534cb697ef05fb"}},{"ruleId":"D1","level":"warning","message":{"text":"d2sketch.ConnectionDrawable (cyclomatic 30): d2sketch.ConnectionDrawable 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":"d2renderers/d2sketch/scene_connection.go"},"region":{"startLine":25}}}],"partialFingerprints":{"codehealthFindingId/v1":"6547e449bad66ddd6434dd6fdae1706e12cd2cb3b1078e3e38e9fed3a8f8b646"}},{"ruleId":"D1","level":"warning","message":{"text":"svgImporter.validateNonRenderingTree (cyclomatic 30): svgImporter.validateNonRenderingTree 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":"d2renderers/d2svgimport/boilerplate.go"},"region":{"startLine":63}}}],"partialFingerprints":{"codehealthFindingId/v1":"74c66e3f1256f18ce6c72583f9359103141749d886849d117766c775bf8ada5e"}},{"ruleId":"D1","level":"warning","message":{"text":"transformParser.number (cyclomatic 30): transformParser.number 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":"d2renderers/d2svgimport/transform.go"},"region":{"startLine":142}}}],"partialFingerprints":{"codehealthFindingId/v1":"48dacda33b08eaa761b489109fc75e8c6480b62b1bad01b1f1545c11cdb39b5e"}},{"ruleId":"D1","level":"warning","message":{"text":"colrv1Builder.paint (cyclomatic 30): colrv1Builder.paint 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":"d2renderers/internal/fontface/colrv1.go"},"region":{"startLine":223}}}],"partialFingerprints":{"codehealthFindingId/v1":"cc80295e6a72d5bcda68f7d27d89a85aec85f0688aee46e22fcb738835c450fe"}},{"ruleId":"D1","level":"warning","message":{"text":"rasterimage.inspectWebP (cyclomatic 30): rasterimage.inspectWebP 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":"internal/rasterimage/firstframe.go"},"region":{"startLine":752}}}],"partialFingerprints":{"codehealthFindingId/v1":"908486f5d40e44b46f3c1dd3c4a5f97e683c67f7e8a08f46f3c25cac1fadbd91"}},{"ruleId":"D1","level":"warning","message":{"text":"layoutgraph.segmentIntersectsBox (cyclomatic 29): layoutgraph.segmentIntersectsBox has cyclomatic complexity 29 (threshold 15). Of this number, 23 points are the body\u0027s own statements and 6 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/node.go"},"region":{"startLine":1408}}}],"partialFingerprints":{"codehealthFindingId/v1":"21bb6e460c51944b96562fdac0e4f91e32254b67ee1bfee7bb46532048b1bcdc"}},{"ruleId":"D1","level":"warning","message":{"text":"layoutgraph.buildTransactionOverlapsWithReferenceLimit (cyclomatic 29): layoutgraph.buildTransactionOverlapsWithReferenceLimit has cyclomatic complexity 29 (threshold 15). Of this number, 21 points are the body\u0027s own statements and 8 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/transaction.go"},"region":{"startLine":509}}}],"partialFingerprints":{"codehealthFindingId/v1":"4cb23968b017dcd45943db676bf2c3a47a83dabade0d372b8ec67378f60df09a"}},{"ruleId":"D1","level":"warning","message":{"text":"placement.mirrorAxes (cyclomatic 29): placement.mirrorAxes has cyclomatic complexity 29 (threshold 15). Of this number, 15 points are the body\u0027s own statements and 14 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":"d2layouts/d2talalayout/internal/placement/direct.go"},"region":{"startLine":167}}}],"partialFingerprints":{"codehealthFindingId/v1":"acfe48499e842749e8105f5d2b2f53ebddce84796d351ab4ed7006db29c462a3"}},{"ruleId":"D1","level":"warning","message":{"text":"placement.optimizerMedian (cyclomatic 29): placement.optimizerMedian has cyclomatic complexity 29 (threshold 15). Of this number, 25 points are the body\u0027s own statements and 4 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/optimization_guard.go"},"region":{"startLine":332}}}],"partialFingerprints":{"codehealthFindingId/v1":"8fcaf089e7398ce01e64bb29d0ce083fff976fc669a2e4639418981d910a1b9c"}},{"ruleId":"D1","level":"warning","message":{"text":"placementcost.AxisScore (cyclomatic 29): placementcost.AxisScore 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":"d2layouts/d2talalayout/internal/placementcost/axis.go"},"region":{"startLine":11}}}],"partialFingerprints":{"codehealthFindingId/v1":"db305dad88d8b9291f0f19c0399f1970a445d9c4d378fa349c3c27cdcefa5dd3"}},{"ruleId":"D1","level":"warning","message":{"text":"proximity.GroupSheep (cyclomatic 29): proximity.GroupSheep 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":"d2layouts/d2talalayout/internal/proximity/herding.go"},"region":{"startLine":237}}}],"partialFingerprints":{"codehealthFindingId/v1":"6fc9cfb55cab8066f5da2b96586db3b2e3aa0be869d46363c769e9ec0bdcaa56"}},{"ruleId":"D1","level":"warning","message":{"text":"routing.sortEdges (cyclomatic 29): routing.sortEdges has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 4 of the 29 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 219, 277, 193, \u2026). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals\u0027 work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/ovg_edge_router.go"},"region":{"startLine":190}}}],"partialFingerprints":{"codehealthFindingId/v1":"e6ee7b9507f5066ff40ad30651528a068f12683c2770a8c43bcda97ebe7154cc"}},{"ruleId":"D1","level":"warning","message":{"text":"routing.isOnFlightPlan (cyclomatic 29): routing.isOnFlightPlan has cyclomatic complexity 29 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/slingshot.go"},"region":{"startLine":289}}}],"partialFingerprints":{"codehealthFindingId/v1":"00cd43431aca1da4dd36ed334e9b1b6a503e80bd519a06dcc4dacb64c4d56b67"}},{"ruleId":"D1","level":"warning","message":{"text":"routing.traceToShapeBorder (cyclomatic 29): routing.traceToShapeBorder has cyclomatic complexity 29 (threshold 15). Of this number, 27 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/d2talalayout/internal/routing/trace.go"},"region":{"startLine":27}}}],"partialFingerprints":{"codehealthFindingId/v1":"62d02e0ee2eccdad9a0a87673a9e2ebfbe2a13aa67fc6355475d2ec23a035c1d"}},{"ruleId":"D1","level":"warning","message":{"text":"Route.canSwapEdgesGuarded (cyclomatic 29): Route.canSwapEdgesGuarded 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":"d2layouts/d2talalayout/internal/routing/route.go"},"region":{"startLine":202}}}],"partialFingerprints":{"codehealthFindingId/v1":"b974fe6b8e1f1d378c69c3d41376ae590b60aaf9ba13573d75f8156defbbb4ee"}},{"ruleId":"D1","level":"warning","message":{"text":"d2lib.compileBoard (cyclomatic 29): d2lib.compileBoard 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":"d2lib/d2.go"},"region":{"startLine":184}}}],"partialFingerprints":{"codehealthFindingId/v1":"b64ad55fedc3efa8d043092ba3cbc30820b0e3816c14d0372d53eca4add6d72d"}},{"ruleId":"D1","level":"warning","message":{"text":"routeCaptionPlacer.Place (cyclomatic 29): routeCaptionPlacer.Place has cyclomatic complexity 29 (threshold 15). Of this number, 28 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/route_labels.go"},"region":{"startLine":58}}}],"partialFingerprints":{"codehealthFindingId/v1":"fb5a0ef949b2022b7e3a7c16ee9265618383ef20153b2bcae4c7b4e41e895a8f"}},{"ruleId":"D1","level":"warning","message":{"text":"d2raster.flattenGlyph (cyclomatic 29): d2raster.flattenGlyph has cyclomatic complexity 29 (threshold 15). Of this number, 22 points are the body\u0027s own statements and 7 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/text.go"},"region":{"startLine":626}}}],"partialFingerprints":{"codehealthFindingId/v1":"54ff3cecde7102a9c9f139f69e285a8ffc5221851082a5625cb13feab331f6b0"}},{"ruleId":"D1","level":"warning","message":{"text":"builder.preflightLegend (cyclomatic 29): builder.preflightLegend 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":"d2renderers/d2scenebuild/legend.go"},"region":{"startLine":47}}}],"partialFingerprints":{"codehealthFindingId/v1":"75fb18544d62d55e9ac4a33571fc53ee91515a190a0383e32586c07f07d9e250"}},{"ruleId":"D1","level":"warning","message":{"text":"d2svg.wrapIsometricSVG (cyclomatic 29): d2svg.wrapIsometricSVG has cyclomatic complexity 29 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svg/isometric.go"},"region":{"startLine":104}}}],"partialFingerprints":{"codehealthFindingId/v1":"e5b5a59f1ad03066521446c0e9e7d32969771b647e45ab2f12864e460939b0e3"}},{"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":450}}}],"partialFingerprints":{"codehealthFindingId/v1":"588eca2be78c9c6ad469e49c009c8c4dc8121feb658447d00310e049defb48cd"}},{"ruleId":"D1","level":"warning","message":{"text":"MarkdownLayout.SVG (cyclomatic 29): MarkdownLayout.SVG 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":"lib/textmeasure/markdown_svg.go"},"region":{"startLine":219}}}],"partialFingerprints":{"codehealthFindingId/v1":"7a7d7eb6b870af94e4c5c8aff5f8be99480a1ab9c3628758fbb2f0458be44c90"}},{"ruleId":"D1","level":"warning","message":{"text":"markdownPainter.markdownInlineLineHeight (cyclomatic 29): markdownPainter.markdownInlineLineHeight 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":"lib/textmeasure/markdown_svg.go"},"region":{"startLine":875}}}],"partialFingerprints":{"codehealthFindingId/v1":"b41db14a9d512c84b60c601a9eb6e53be659f1d4290089392bbb5fa6465e3e9a"}},{"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":"placement.initializeNodes (cyclomatic 28): placement.initializeNodes has cyclomatic complexity 28 (threshold 15). Of this number, 19 points are the body\u0027s own statements and 9 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/initialize.go"},"region":{"startLine":14}}}],"partialFingerprints":{"codehealthFindingId/v1":"b1fdb531385964bb8100d54e75af7d799c52639831f3b6f2fef700f90ddbcc8a"}},{"ruleId":"D1","level":"warning","message":{"text":"placement.BalanceSymmetry (cyclomatic 28): placement.BalanceSymmetry has cyclomatic complexity 28 (threshold 15). Of this number, 25 points are the body\u0027s own statements and 3 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/symmetry.go"},"region":{"startLine":12}}}],"partialFingerprints":{"codehealthFindingId/v1":"a7900ced7717d44c1fa7c830f9d4805da5bbbe17bf1eec3fa09c04db28344193"}},{"ruleId":"D1","level":"warning","message":{"text":"d2fonts.probeFontFileCoverage (cyclomatic 28): d2fonts.probeFontFileCoverage 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":"d2renderers/d2fonts/fallback.go"},"region":{"startLine":483}}}],"partialFingerprints":{"codehealthFindingId/v1":"0e09305c7eb7418a4ce970bfae74da74bfd9fcb774018467572fd46453cd8b5e"}},{"ruleId":"D1","level":"warning","message":{"text":"d2isometricimg.nativeDocumentGlyphCoverage (cyclomatic 28): d2isometricimg.nativeDocumentGlyphCoverage has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 5 of the 28 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 131, 91). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals\u0027 work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/surface_fonts.go"},"region":{"startLine":83}}}],"partialFingerprints":{"codehealthFindingId/v1":"7370458aee9458fa0dbecd5305ed448e4192dee7df3a1b66c88a66ebc4d408be"}},{"ruleId":"D1","level":"warning","message":{"text":"d2raster.multiplyLayerByRGBALuminance (cyclomatic 28): d2raster.multiplyLayerByRGBALuminance 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":"d2renderers/d2raster/effects.go"},"region":{"startLine":1117}}}],"partialFingerprints":{"codehealthFindingId/v1":"79b17ddbafb92995dc1a661af1655efc2c815fc3774116bd509f3a3a46e7f60b"}},{"ruleId":"D1","level":"warning","message":{"text":"d2raster.multiplyLayerByRGBAAlpha (cyclomatic 28): d2raster.multiplyLayerByRGBAAlpha 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":"d2renderers/d2raster/effects.go"},"region":{"startLine":1237}}}],"partialFingerprints":{"codehealthFindingId/v1":"4d95fa7b6bd47ab8e3319c7ddec21ad1820a4c94db5c333d336252c72621f216"}},{"ruleId":"D1","level":"warning","message":{"text":"preflight.finishPrimitive (cyclomatic 28): preflight.finishPrimitive 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":"d2renderers/d2raster/raster.go"},"region":{"startLine":1327}}}],"partialFingerprints":{"codehealthFindingId/v1":"1be58f2f31384ae70c1632ebf839570c1d1cb94d1a4961c943e4a28ade8bdd04"}},{"ruleId":"D1","level":"warning","message":{"text":"d2svgimport.parseSVGNumber (cyclomatic 28): d2svgimport.parseSVGNumber has cyclomatic complexity 28 (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/d2svgimport/style.go"},"region":{"startLine":648}}}],"partialFingerprints":{"codehealthFindingId/v1":"660b4f398584adc36cdec8c1838d0e2b1a3d5439fa1f3ff21b3437acaccab07c"}},{"ruleId":"D1","level":"warning","message":{"text":"d2target.validateRenderConnection (cyclomatic 28): d2target.validateRenderConnection 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":"d2target/render_validation.go"},"region":{"startLine":166}}}],"partialFingerprints":{"codehealthFindingId/v1":"60e1df5b4f8e5fbfb5f1d96ff3e480dda21e3044d9f591b8504d81f18ccca570"}},{"ruleId":"D1","level":"warning","message":{"text":"main.verifyStripped (cyclomatic 27): main.verifyStripped 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":"ci/release/releasetool/main.go"},"region":{"startLine":612}}}],"partialFingerprints":{"codehealthFindingId/v1":"a2e88ef24febbf29959f181d9aee3a8823b4c48204d68a4e469524e3235b1af5"}},{"ruleId":"D1","level":"warning","message":{"text":"engine.compoundEnclosedRoute (cyclomatic 27): engine.compoundEnclosedRoute has cyclomatic complexity 27 (threshold 15). Of this number, 17 points are the body\u0027s own statements and 10 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/engine/compound_routes.go"},"region":{"startLine":108}}}],"partialFingerprints":{"codehealthFindingId/v1":"142e9cf631b53c0cd7ab9531f80f7ebddfaf5f15452582b543887060456f4e47"}},{"ruleId":"D1","level":"warning","message":{"text":"grouping.isValidRememberedSequence (cyclomatic 27): grouping.isValidRememberedSequence 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":"d2layouts/d2talalayout/internal/grouping/sequences.go"},"region":{"startLine":128}}}],"partialFingerprints":{"codehealthFindingId/v1":"2eb4251c77fbdfa013680d7344a0f1cceabd5630ef590f81d64029ac700db499"}},{"ruleId":"D1","level":"warning","message":{"text":"Transaction.hasBadPostStateOverlap (cyclomatic 27): Transaction.hasBadPostStateOverlap 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":"d2layouts/d2talalayout/internal/layoutgraph/transaction.go"},"region":{"startLine":1103}}}],"partialFingerprints":{"codehealthFindingId/v1":"4eaf551cc6ddb68f1674d858433ea4b17cbc63ed293a0b763774ff4ae7776466"}},{"ruleId":"D1","level":"warning","message":{"text":"quality.measureGeometry (cyclomatic 27): quality.measureGeometry 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":"d2layouts/d2talalayout/internal/quality/inspection_geometry.go"},"region":{"startLine":15}}}],"partialFingerprints":{"codehealthFindingId/v1":"4fd11f2976f48b1dacd026dc72211e6797c918fcc8caf58a0f73df954b9a9aeb"}},{"ruleId":"D1","level":"warning","message":{"text":"routing.routeAdditionalEdgesWithResourceLimits (cyclomatic 27): routing.routeAdditionalEdgesWithResourceLimits has cyclomatic complexity 27 (threshold 15). Of this number, 20 points are the body\u0027s own statements and 7 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own 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/d2talalayout/internal/routing/coordinator.go"},"region":{"startLine":531}}}],"partialFingerprints":{"codehealthFindingId/v1":"6a2dec39c72cee2643fd15afc333c5dec222beb3e978491acdebbf4762e31006"}},{"ruleId":"D1","level":"warning","message":{"text":"routing.newOVGForHierarchy (cyclomatic 27): routing.newOVGForHierarchy has cyclomatic complexity 27 (threshold 15). Of this number, 25 points are the body\u0027s own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own 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/d2talalayout/internal/routing/ovg_hierarchy.go"},"region":{"startLine":15}}}],"partialFingerprints":{"codehealthFindingId/v1":"f662256096dad892a54d8e068e1bf944d31d072c8c478600a93f04425a791b8d"}},{"ruleId":"D1","level":"warning","message":{"text":"OVG.addPortConnectionNodesAtBoundaries (cyclomatic 27): OVG.addPortConnectionNodesAtBoundaries has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 12 of the 27 points are its own statements and the rest belongs to one function literal inside it that branches (line 900). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal\u0027s work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/ovg.go"},"region":{"startLine":874}}}],"partialFingerprints":{"codehealthFindingId/v1":"294156ac68be6cbf19cc079b2748c58fcf21b8058dfcfc0caad57d9505085fcd"}},{"ruleId":"D1","level":"warning","message":{"text":"OVGNode.hasUnobstructedLineToPorts (cyclomatic 27): OVGNode.hasUnobstructedLineToPorts 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":"d2layouts/d2talalayout/internal/routing/ovg_node.go"},"region":{"startLine":184}}}],"partialFingerprints":{"codehealthFindingId/v1":"ab92c434f4b27e0b6c1269b9c9df0e68caee82820ebf927fb9158e99dc2b4ecc"}},{"ruleId":"D1","level":"warning","message":{"text":"trees.placeTree (cyclomatic 27): trees.placeTree 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":"d2layouts/d2talalayout/internal/trees/layout.go"},"region":{"startLine":750}}}],"partialFingerprints":{"codehealthFindingId/v1":"3f6940b9f431cd8374608763d1994d02c298183590fee3ee004220a924f32644"}},{"ruleId":"D1","level":"warning","message":{"text":"trees.buildPlacementTrees (cyclomatic 27): trees.buildPlacementTrees 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":"d2layouts/d2talalayout/internal/trees/layout.go"},"region":{"startLine":1021}}}],"partialFingerprints":{"codehealthFindingId/v1":"4cf867fbae7d61fc7726211ef7ad16550dbb026aa83e31d490b09702ea319e73"}},{"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":"meshBuilder.extrudedProfile (cyclomatic 27): meshBuilder.extrudedProfile has cyclomatic complexity 27 (threshold 15). Of this number, 26 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own 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/d2isometric/d2isometricimg/native_shapes.go"},"region":{"startLine":651}}}],"partialFingerprints":{"codehealthFindingId/v1":"707ef7cdf67406e39726a86aae4db19d9c0935ac7387f596c202fb7dfa430854"}},{"ruleId":"D1","level":"warning","message":{"text":"Raster.renderStrips (cyclomatic 27): Raster.renderStrips 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/d2isometric/d2isometricimg/raster.go"},"region":{"startLine":396}}}],"partialFingerprints":{"codehealthFindingId/v1":"9dfb092cafa9c669057f487428a8291f20538d35e1df3fa4d6c32553869391d2"}},{"ruleId":"D1","level":"warning","message":{"text":"Rasterizer.WriteAlpha (cyclomatic 27): Rasterizer.WriteAlpha has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 9 of the 27 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 737, 781). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals\u0027 work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/internal/scanline/rasterizer.go"},"region":{"startLine":724}}}],"partialFingerprints":{"codehealthFindingId/v1":"f839711b8adbdb24adabb2cd6a48196213c2d588b444b84068bbd349a51f7361"}},{"ruleId":"D1","level":"warning","message":{"text":"retainedVectorValidator.path (cyclomatic 27): retainedVectorValidator.path 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/d2raster/vector_validation.go"},"region":{"startLine":519}}}],"partialFingerprints":{"codehealthFindingId/v1":"ea146307483c7f259b9aa6061726df196f3e5f82d781d35c23133ea14b323681"}},{"ruleId":"D1","level":"warning","message":{"text":"builder.preflightAssets (cyclomatic 27): builder.preflightAssets 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/d2scenebuild/assets.go"},"region":{"startLine":27}}}],"partialFingerprints":{"codehealthFindingId/v1":"4da6039e2931de7de472b365089715380f5bbac96bd84d50b009782ab897d230"}},{"ruleId":"D1","level":"warning","message":{"text":"builder.buildConnection (cyclomatic 27): builder.buildConnection 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/d2scenebuild/connection.go"},"region":{"startLine":28}}}],"partialFingerprints":{"codehealthFindingId/v1":"8dde9ac4255f7b9d558e48d2ccedfac07bfa5d4d8082fecfb68fed0a68e3256b"}},{"ruleId":"D1","level":"warning","message":{"text":"svgImporter.validateDegenerateStrokeCaps (cyclomatic 27): svgImporter.validateDegenerateStrokeCaps has cyclomatic complexity 27 (threshold 15). Of this number, 24 points are the body\u0027s own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the 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/d2svgimport/compile.go"},"region":{"startLine":193}}}],"partialFingerprints":{"codehealthFindingId/v1":"2b1414d8af29051d4a56a35a0e1c797e29d3bb75cfa8b950275b61132b17686d"}},{"ruleId":"D1","level":"warning","message":{"text":"rasterimage.DecodeFirst (cyclomatic 27): rasterimage.DecodeFirst 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":"internal/rasterimage/firstframe.go"},"region":{"startLine":87}}}],"partialFingerprints":{"codehealthFindingId/v1":"f89495eed9c2744c0b919625f928037fe2039f38139472335dbadc1442fddcde"}},{"ruleId":"D1","level":"warning","message":{"text":"xgif.NormalizePalettedImage (cyclomatic 27): xgif.NormalizePalettedImage 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":"lib/xgif/xgif.go"},"region":{"startLine":1069}}}],"partialFingerprints":{"codehealthFindingId/v1":"b80381de00ada2830dcf61a7dfcf0ccda24c7a1ded7aa2026ae072dad96bf63a"}},{"ruleId":"D1","level":"warning","message":{"text":"d2cli.bundleRasterPreview (cyclomatic 26): d2cli.bundleRasterPreview 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":"d2cli/raster.go"},"region":{"startLine":756}}}],"partialFingerprints":{"codehealthFindingId/v1":"b1e9deb19d95e58492fa969d62f12cc70a9ca7b573c6b7c279f7a7a1c8a66aaf"}},{"ruleId":"D1","level":"warning","message":{"text":"d2ir.walkVariableExpansion (cyclomatic 26): d2ir.walkVariableExpansion 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":"d2ir/expansion.go"},"region":{"startLine":193}}}],"partialFingerprints":{"codehealthFindingId/v1":"f2a6a420099aad3330cecfa407d76729ca68208c044232490e00cd97c41f34d5"}},{"ruleId":"D1","level":"warning","message":{"text":"d2grid.newGridDiagram (cyclomatic 26): d2grid.newGridDiagram 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":"d2layouts/d2grid/grid_diagram.go"},"region":{"startLine":28}}}],"partialFingerprints":{"codehealthFindingId/v1":"431a7ce3bb46e50cad8e4f2e424b130cf386ce82e291057bcd2f62ef9cd7ba63"}},{"ruleId":"D1","level":"warning","message":{"text":"gridDiagram.getBestLayout (cyclomatic 26): gridDiagram.getBestLayout has cyclomatic complexity 26 (threshold 15). Of this number, 14 points are the body\u0027s own statements and 12 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":563}}}],"partialFingerprints":{"codehealthFindingId/v1":"fb9f2b9b7aff6165abffacbb1df74b258b020ae8d1817b05717f90669a0ac111"}},{"ruleId":"D1","level":"warning","message":{"text":"Graph.isStructurallyBadStateWithFixedOriginContext (cyclomatic 26): Graph.isStructurallyBadStateWithFixedOriginContext 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":"d2layouts/d2talalayout/internal/layoutgraph/graph.go"},"region":{"startLine":128}}}],"partialFingerprints":{"codehealthFindingId/v1":"96ea33cb41daae218b401b1463a7431a79b388449bbfea5967205743a147fb7f"}},{"ruleId":"D1","level":"warning","message":{"text":"placement.optimizerDescendants (cyclomatic 26): placement.optimizerDescendants has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 7 of the 26 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 629, 612). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals\u0027 work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/optimization_guard.go"},"region":{"startLine":602}}}],"partialFingerprints":{"codehealthFindingId/v1":"325fb06b58db76a93e75e339a69e8021e9f59290be9f2bd5e8bc3dd2bee48e11"}},{"ruleId":"D1","level":"warning","message":{"text":"placement.captureOptimizerNodePositions (cyclomatic 26): placement.captureOptimizerNodePositions 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":"d2layouts/d2talalayout/internal/placement/optimization_guard.go"},"region":{"startLine":962}}}],"partialFingerprints":{"codehealthFindingId/v1":"12e9eb2cac3bab2cea6c86dbe9897692c349b639475cc7bcbe976ad7bc1b169f"}},{"ruleId":"D1","level":"warning","message":{"text":"sizelessOptimizer.placementPointsGuarded (cyclomatic 26): sizelessOptimizer.placementPointsGuarded has cyclomatic complexity 26 (threshold 15). Of this number, 24 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/sizeless_optimizer.go"},"region":{"startLine":350}}}],"partialFingerprints":{"codehealthFindingId/v1":"add514c5e631eb52dfa8e8e727e0e290a94f229fb3f302e0f38e60c31ac506e4"}},{"ruleId":"D1","level":"warning","message":{"text":"placementcost.EdgeLength (cyclomatic 26): placementcost.EdgeLength has cyclomatic complexity 26 (threshold 15). Of this number, 19 points are the body\u0027s own statements and 7 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placementcost/graph.go"},"region":{"startLine":111}}}],"partialFingerprints":{"codehealthFindingId/v1":"e08836d66428633dd34fa0d2c1f94c9d6a8a925498423168b8d5937eceb78a75"}},{"ruleId":"D1","level":"warning","message":{"text":"routing.buildTunnelsBetween (cyclomatic 26): routing.buildTunnelsBetween 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":"d2layouts/d2talalayout/internal/routing/tunnel.go"},"region":{"startLine":263}}}],"partialFingerprints":{"codehealthFindingId/v1":"91a0faaa4429af9273c8c9628e3279fdbe23a8985f63a08e1b8e803fa61a8227"}},{"ruleId":"D1","level":"warning","message":{"text":"OVG.addIntersections (cyclomatic 26): OVG.addIntersections 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":"d2layouts/d2talalayout/internal/routing/ovg.go"},"region":{"startLine":330}}}],"partialFingerprints":{"codehealthFindingId/v1":"97c8c2b243b8f705b301a7c6b01544ad2311196fd98d8e1978c385827ded21de"}},{"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":"d2isometricimg.nativeShapeProfile (cyclomatic 26): d2isometricimg.nativeShapeProfile has cyclomatic complexity 26 (threshold 15). Of this number, 23 points are the body\u0027s own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own 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/d2isometric/d2isometricimg/native_shapes.go"},"region":{"startLine":510}}}],"partialFingerprints":{"codehealthFindingId/v1":"8bb2e5a439541f30187e967a390e05d5ef8c49ff673bbc9ff2c3ed1e3edd87ab"}},{"ruleId":"D1","level":"warning","message":{"text":"d2isometricimg.writeSVGGroundShadow (cyclomatic 26): d2isometricimg.writeSVGGroundShadow has cyclomatic complexity 26 (threshold 15). Of this number, 25 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own 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/d2isometric/d2isometricimg/svg_lighting.go"},"region":{"startLine":274}}}],"partialFingerprints":{"codehealthFindingId/v1":"dd75a4e93c2eb550d7212b3ce89c3f3e6407146e2e514ab6e67a90b98955d11b"}},{"ruleId":"D1","level":"warning","message":{"text":"d2scene.EndpointArcToCenter (cyclomatic 26): d2scene.EndpointArcToCenter has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scene/path.go"},"region":{"startLine":356}}}],"partialFingerprints":{"codehealthFindingId/v1":"606c6a755f88a4439877b54f70a4cf77ffdd622537ec62788be825674a2cf085"}},{"ruleId":"D1","level":"warning","message":{"text":"d2scenebuild.parsePaperPatternSource (cyclomatic 26): d2scenebuild.parsePaperPatternSource 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/d2scenebuild/pattern_sources.go"},"region":{"startLine":139}}}],"partialFingerprints":{"codehealthFindingId/v1":"32fea84bd7ad3b6a50615ff33f354f1d9ae698b92cf8f7c3656c4becda6ba4cc"}},{"ruleId":"D1","level":"warning","message":{"text":"svgImporter.parseStylesheet (cyclomatic 26): svgImporter.parseStylesheet 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/d2svgimport/stylesheet.go"},"region":{"startLine":66}}}],"partialFingerprints":{"codehealthFindingId/v1":"89b4e88cec7457ffa684c74501c7a0f74be91442115c5697e7ee6e47af83a582"}},{"ruleId":"D1","level":"warning","message":{"text":"svgImporter.stylesheetDeclarations (cyclomatic 26): svgImporter.stylesheetDeclarations 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/d2svgimport/stylesheet.go"},"region":{"startLine":185}}}],"partialFingerprints":{"codehealthFindingId/v1":"4d7815f1753bab2617360922c28a9a907e70a0c333b3df8f6e950d3d83e029df"}},{"ruleId":"D1","level":"warning","message":{"text":"imagediff.CompareImages (cyclomatic 26): imagediff.CompareImages 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":"internal/testutil/imagediff/imagediff.go"},"region":{"startLine":118}}}],"partialFingerprints":{"codehealthFindingId/v1":"7e1e514f1a4f1383dc6c63ecb18ea9509f295433b2ae5a40f13f76f2f279efda"}},{"ruleId":"D1","level":"warning","message":{"text":"imageasset.probeResource (cyclomatic 26): imageasset.probeResource 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":"lib/imageasset/probe.go"},"region":{"startLine":40}}}],"partialFingerprints":{"codehealthFindingId/v1":"4c87e2d8159826bd77ea4cf44038c534d80ffad7276837d1f013d2e360b102bf"}},{"ruleId":"D1","level":"warning","message":{"text":"Resolver.validateCached (cyclomatic 26): Resolver.validateCached 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":"lib/imageasset/resolve.go"},"region":{"startLine":633}}}],"partialFingerprints":{"codehealthFindingId/v1":"39197e09919a17831c88c6cff36c078b8a9b33cb01be83fd13b5131616a1e377"}},{"ruleId":"D1","level":"warning","message":{"text":"d2cli.renderWithPNGEncoderToPaths (cyclomatic 25): d2cli.renderWithPNGEncoderToPaths has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2cli/main.go"},"region":{"startLine":894}}}],"partialFingerprints":{"codehealthFindingId/v1":"aa89f376008856e4d7226935635c9b0db96694806f3264709b4f42038c5b4dc9"}},{"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":1914}}}],"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 1713). 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":1712}}}],"partialFingerprints":{"codehealthFindingId/v1":"09f7f1712b747c7ea45a0bee0a4437a6dc787840e2212ff414e1dd77c03342a0"}},{"ruleId":"D1","level":"warning","message":{"text":"graphbounds.NodeBoundingBox (cyclomatic 25): graphbounds.NodeBoundingBox has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/graphbounds/bounds.go"},"region":{"startLine":45}}}],"partialFingerprints":{"codehealthFindingId/v1":"f48ec42557b6a74da9a214a0e34639d61c193c6f859aa0dfb7b18b1a9ea480d2"}},{"ruleId":"D1","level":"warning","message":{"text":"rankSimplex.computeCutValues (cyclomatic 25): rankSimplex.computeCutValues has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/hierarchy/rank_simplex.go"},"region":{"startLine":354}}}],"partialFingerprints":{"codehealthFindingId/v1":"b27e076db2936481ed2723579f4707ef4d8b86ab3e87d7d8e2454ca8335a9322"}},{"ruleId":"D1","level":"warning","message":{"text":"labeling.isClusterPathSharedChecked (cyclomatic 25): labeling.isClusterPathSharedChecked has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/labeling/placement.go"},"region":{"startLine":1189}}}],"partialFingerprints":{"codehealthFindingId/v1":"a2771c339a31d4b9e3a42619a3a41d5ec7ee1e163ee43b15e65650eb244cc52c"}},{"ruleId":"D1","level":"warning","message":{"text":"Graph.doesOverlapWithDimensionsContext (cyclomatic 25): Graph.doesOverlapWithDimensionsContext has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/graph.go"},"region":{"startLine":338}}}],"partialFingerprints":{"codehealthFindingId/v1":"281d4ab71b4393fbe476c6f06cb383e2570ddebadf77fa0c55ee68afcd1cd12b"}},{"ruleId":"D1","level":"warning","message":{"text":"Transaction.markDescendantOverlapExceptions (cyclomatic 25): Transaction.markDescendantOverlapExceptions has cyclomatic complexity 25 (threshold 15). Of this number, 13 points are the body\u0027s own statements and 12 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own 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/d2talalayout/internal/layoutgraph/transaction.go"},"region":{"startLine":1021}}}],"partialFingerprints":{"codehealthFindingId/v1":"a8575aacc3ba00bfca48ab66845e210a92fe52533546988758aa2d967731fa87"}},{"ruleId":"D1","level":"warning","message":{"text":"placement.Equidistance (cyclomatic 25): placement.Equidistance has cyclomatic complexity 25 (threshold 15). Of this number, 24 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/equidistance.go"},"region":{"startLine":18}}}],"partialFingerprints":{"codehealthFindingId/v1":"025f84496c7e1c7405299219e08486db7e840f73c90fcc77f4e26a491f3744fb"}},{"ruleId":"D1","level":"warning","message":{"text":"placement.chargeOptimizerTranspose (cyclomatic 25): placement.chargeOptimizerTranspose has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/optimization_guard.go"},"region":{"startLine":549}}}],"partialFingerprints":{"codehealthFindingId/v1":"750b5e36cd9e499891cd0634e5b152f79bad75d26d4f6badbb4457723b8e71b7"}},{"ruleId":"D1","level":"warning","message":{"text":"sizedOptimizer.findClosestUnoccupiedDistanceGuarded (cyclomatic 25): sizedOptimizer.findClosestUnoccupiedDistanceGuarded has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/sized_optimizer.go"},"region":{"startLine":528}}}],"partialFingerprints":{"codehealthFindingId/v1":"a607ecac3dc9abbb497708459cfbcd6a05bf582f19a9ee1231abb00171602087"}},{"ruleId":"D1","level":"warning","message":{"text":"placementcost.computeSymmetryScoreInto (cyclomatic 25): placementcost.computeSymmetryScoreInto has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placementcost/symmetry.go"},"region":{"startLine":397}}}],"partialFingerprints":{"codehealthFindingId/v1":"18e4470484a1f865ddca35581798492dd78b2ad432272d191eb3ce7a779aab6b"}},{"ruleId":"D1","level":"warning","message":{"text":"quality.findSharedSegments (cyclomatic 25): quality.findSharedSegments 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 448). 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/d2talalayout/internal/quality/labels.go"},"region":{"startLine":418}}}],"partialFingerprints":{"codehealthFindingId/v1":"1773671e8a5d0f111d6159a7a773069d066ba5affd9ff5a12d8758db9c5075bd"}},{"ruleId":"D1","level":"warning","message":{"text":"ovgEdgeRouter.usedPorts (cyclomatic 25): ovgEdgeRouter.usedPorts has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/ovg_edge_router.go"},"region":{"startLine":465}}}],"partialFingerprints":{"codehealthFindingId/v1":"565fa5d181d3488ba116a21d5b1a1ad37b57c6f3dd7f540f9de5342e67642297"}},{"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":"d2isometricimg.nativeLaneClear (cyclomatic 25): d2isometricimg.nativeLaneClear has cyclomatic complexity 25 (threshold 15). Of this number, 22 points are the body\u0027s own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/route_lanes.go"},"region":{"startLine":373}}}],"partialFingerprints":{"codehealthFindingId/v1":"0b1bd39738693bc6aabdb1ba0f5666294131c35933023d424130c83a8573d51f"}},{"ruleId":"D1","level":"warning","message":{"text":"meshBuilder.arrowRetreat (cyclomatic 25): meshBuilder.arrowRetreat has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/arrow_visibility.go"},"region":{"startLine":328}}}],"partialFingerprints":{"codehealthFindingId/v1":"5c5ee94cdc0e873412988bf7f923a9498ad96f85523c43d771a81d7314a51146"}},{"ruleId":"D1","level":"warning","message":{"text":"d2raster.applyNonZeroClip (cyclomatic 25): d2raster.applyNonZeroClip has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 10 of the 25 points are its own statements and the rest belongs to one function literal inside it that branches (line 815). 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":"d2renderers/d2raster/effects.go"},"region":{"startLine":791}}}],"partialFingerprints":{"codehealthFindingId/v1":"397b5c0a7ff918c60d110fd493ca8a0b8c52deeaa1d9788d8e4c14c3f7bc0819"}},{"ruleId":"D1","level":"warning","message":{"text":"d2raster.paintDropShadowInteger (cyclomatic 25): d2raster.paintDropShadowInteger has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/filter.go"},"region":{"startLine":955}}}],"partialFingerprints":{"codehealthFindingId/v1":"53095070caa1c141cb41c6200bac1f8957bf87828e91e5b8fd850f50a19a60d2"}},{"ruleId":"D1","level":"warning","message":{"text":"d2raster.addStrokeRun (cyclomatic 25): d2raster.addStrokeRun has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/geometry.go"},"region":{"startLine":677}}}],"partialFingerprints":{"codehealthFindingId/v1":"ff587f23c2340d578a0c6c8acb36dbf51c9755658c95015a6eac0e8df9417a2d"}},{"ruleId":"D1","level":"warning","message":{"text":"d2raster.render (cyclomatic 25): d2raster.render has cyclomatic complexity 25 (threshold 15). Of this number, 24 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, 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/d2raster/raster.go"},"region":{"startLine":341}}}],"partialFingerprints":{"codehealthFindingId/v1":"20a89f2ce84f9c6e96f4a3b64ac59755ddeac26def75e2a9548522fc4baf2301"}},{"ruleId":"D1","level":"warning","message":{"text":"preflight.animationValueAt (cyclomatic 25): preflight.animationValueAt has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/animation_value.go"},"region":{"startLine":15}}}],"partialFingerprints":{"codehealthFindingId/v1":"2aed9941a34186869ea6c0e8d93250dd0664089f1a06d2b2097de73b971bd379"}},{"ruleId":"D1","level":"warning","message":{"text":"d2scenebuild.flattenSketchPath (cyclomatic 25): d2scenebuild.flattenSketchPath has cyclomatic complexity 25 (threshold 15). Of this number, 19 points are the body\u0027s own statements and 6 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/sketch_shapes.go"},"region":{"startLine":318}}}],"partialFingerprints":{"codehealthFindingId/v1":"707c0971c89ac462e2c1cc9a93a06e37a9bb49f372c39413ffcf68b68f7c576f"}},{"ruleId":"D1","level":"warning","message":{"text":"builder.splitAnimatedConnectionPath (cyclomatic 25): builder.splitAnimatedConnectionPath has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/connection.go"},"region":{"startLine":218}}}],"partialFingerprints":{"codehealthFindingId/v1":"7709b91e83b840b162c1cd84f0215169806c5742ed789a5b1271c2b0dcf2020c"}},{"ruleId":"D1","level":"warning","message":{"text":"builder.buildMarkdownLabel (cyclomatic 25): builder.buildMarkdownLabel has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/markdown.go"},"region":{"startLine":101}}}],"partialFingerprints":{"codehealthFindingId/v1":"1f64d8c7f9f1a5628fbd4bad5952ba0a96457543513bc8c1c50e886d275162ee"}},{"ruleId":"D1","level":"warning","message":{"text":"builder.buildSketchStructuredShape (cyclomatic 25): builder.buildSketchStructuredShape has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/sketch_shapes.go"},"region":{"startLine":592}}}],"partialFingerprints":{"codehealthFindingId/v1":"5855cfe5eb7e0bdb3a136cb7d3ef743a3332aef6769c79ff393689ff989fbe2b"}},{"ruleId":"D1","level":"warning","message":{"text":"svgImporter.compileLinearGradient (cyclomatic 25): svgImporter.compileLinearGradient has cyclomatic complexity 25 (threshold 15). Of this number, 24 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svgimport/gradient.go"},"region":{"startLine":90}}}],"partialFingerprints":{"codehealthFindingId/v1":"16f0174a11c75dae3118859d379e03d1f8f915563ccc137b7868d4f281c98cd5"}},{"ruleId":"D1","level":"warning","message":{"text":"svgImporter.resolveEmbeddedRaster (cyclomatic 25): svgImporter.resolveEmbeddedRaster has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svgimport/image.go"},"region":{"startLine":72}}}],"partialFingerprints":{"codehealthFindingId/v1":"e1924591546091b51297448015035f97e896c65bf71d3414d2292847a842814b"}},{"ruleId":"D1","level":"warning","message":{"text":"d2layoutfeatures.Check (cyclomatic 25): d2layoutfeatures.Check has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/d2layoutfeatures/features.go"},"region":{"startLine":21}}}],"partialFingerprints":{"codehealthFindingId/v1":"6942a3579fc25f91d6b9b802c1929a55d1491ca5f86a483791e32d1d2fce37b2"}},{"ruleId":"D1","level":"warning","message":{"text":"markdownPainter.paintInlineNodes (cyclomatic 25): markdownPainter.paintInlineNodes has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/textmeasure/markdown_svg.go"},"region":{"startLine":753}}}],"partialFingerprints":{"codehealthFindingId/v1":"e07e1621f14c4c691f45ea2ab3bb5aa0bf0b72256b9e68d455942672824bbaa2"}},{"ruleId":"D1","level":"warning","message":{"text":"isometricPagedRenderer.admitPage (cyclomatic 24): isometricPagedRenderer.admitPage 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":"d2cli/isometric_paged.go"},"region":{"startLine":135}}}],"partialFingerprints":{"codehealthFindingId/v1":"c8bcd82019190edabe640fb78efce9cf8444b6d6f586a5a311f3ce85b7c1a784"}},{"ruleId":"D1","level":"warning","message":{"text":"compiler.validateNear (cyclomatic 24): compiler.validateNear 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":1585}}}],"partialFingerprints":{"codehealthFindingId/v1":"71db3fe4a6445d60255190d85d8a080634c96c30508b9f3527e63a8cb8d01edd"}},{"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":996}}}],"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":1898}}}],"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":1928}}}],"partialFingerprints":{"codehealthFindingId/v1":"60a31fc6ce426e4193ccbd8540bf97246d6f01401ff1801b59f78f0fac1277f6"}},{"ruleId":"D1","level":"warning","message":{"text":"compiler.compileArray (cyclomatic 24): compiler.compileArray 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":2285}}}],"partialFingerprints":{"codehealthFindingId/v1":"593531a1a886f92f927ec8fb1ac82c00869fc54190af1f0450d99715daa87592"}},{"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. This shape REPEATS in the file: one other method here (d2dagrelayout.shiftUp) has the same decision points, in the same order, at the same nesting depths \u2014 so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2dagrelayout/layout.go"},"region":{"startLine":664}}}],"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. This shape REPEATS in the file: one other method here (d2dagrelayout.shiftDown) has the same decision points, in the same order, at the same nesting depths \u2014 so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2dagrelayout/layout.go"},"region":{"startLine":728}}}],"partialFingerprints":{"codehealthFindingId/v1":"f913a80e9ecd8f8dd4c50848e3adce85ce9bcf41a656334bc1f4f6bcd3131bb7"}},{"ruleId":"D1","level":"warning","message":{"text":"placement.optimizerDoesOverlap (cyclomatic 24): placement.optimizerDoesOverlap 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/d2talalayout/internal/placement/optimization_guard.go"},"region":{"startLine":439}}}],"partialFingerprints":{"codehealthFindingId/v1":"03dc21ff3f84534e07150db1e40fc8c3f5ab4d5de701768de00f1c15fda390f7"}},{"ruleId":"D1","level":"warning","message":{"text":"placement.scaleBasedOnEdges (cyclomatic 24): placement.scaleBasedOnEdges 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/d2talalayout/internal/placement/stages.go"},"region":{"startLine":26}}}],"partialFingerprints":{"codehealthFindingId/v1":"e9ba9a50deaeb0caed860a7881be5ccc536d553d078bee35eb7f09372a7fb2ca"}},{"ruleId":"D1","level":"warning","message":{"text":"OVG.addPorts (cyclomatic 24): OVG.addPorts 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/d2talalayout/internal/routing/ovg.go"},"region":{"startLine":233}}}],"partialFingerprints":{"codehealthFindingId/v1":"a3a3148cdc69c5516db0229d2a3e05b9520f38b584daca94ca5b780e7b0410f9"}},{"ruleId":"D1","level":"warning","message":{"text":"trees.candidateTreeRoots (cyclomatic 24): trees.candidateTreeRoots has cyclomatic complexity 24 (threshold 15). Of this number, 22 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/trees/preprocess_helpers.go"},"region":{"startLine":220}}}],"partialFingerprints":{"codehealthFindingId/v1":"7ab10ff0c1ae7462a373d709b71c856c5524dc265e49485d96ae5c61d3e70b12"}},{"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":"d2isometricimg.nativeGIFLoopScene (cyclomatic 24): d2isometricimg.nativeGIFLoopScene has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 9 of the 24 points are its own statements and the rest belongs to one function literal inside it that branches (line 26). 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":"d2renderers/d2isometric/d2isometricimg/gif_loop.go"},"region":{"startLine":16}}}],"partialFingerprints":{"codehealthFindingId/v1":"8a676de620e093170b172cf18efb0dfa16007a0df3e9446f2b5d133a14f4e839"}},{"ruleId":"D1","level":"warning","message":{"text":"d2isometricimg.hierarchyTerraces (cyclomatic 24): d2isometricimg.hierarchyTerraces has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 10 of the 24 points are its own statements and the rest belongs to one function literal inside it that branches (line 192). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal\u0027s work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/hierarchy_boards.go"},"region":{"startLine":164}}}],"partialFingerprints":{"codehealthFindingId/v1":"b0f51b37840583d4ece61ddee0432e92fb1739c7b8e0aee7da543b02fad1799d"}},{"ruleId":"D1","level":"warning","message":{"text":"d2isometricimg.hierarchyStrongTerraces (cyclomatic 24): d2isometricimg.hierarchyStrongTerraces has cyclomatic complexity 24 (threshold 15). Of this number, 14 points are the body\u0027s own statements and 10 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/hierarchy_support.go"},"region":{"startLine":20}}}],"partialFingerprints":{"codehealthFindingId/v1":"caf5c36f5c5d02f4f6a45c9643f7b12d8ca5ac5f5eb9293082b04392428af8a5"}},{"ruleId":"D1","level":"warning","message":{"text":"d2isometricimg.preflightPageMetadata (cyclomatic 24): d2isometricimg.preflightPageMetadata has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 10 of the 24 points are its own statements and the rest belongs to one function literal inside it that branches (line 71). 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":"d2renderers/d2isometric/d2isometricimg/page.go"},"region":{"startLine":66}}}],"partialFingerprints":{"codehealthFindingId/v1":"fe0756e54d89aaf22bf423b9551331de19d657a09d749f4720645984c1ed67a4"}},{"ruleId":"D1","level":"warning","message":{"text":"d2isometricimg.normalize (cyclomatic 24): d2isometricimg.normalize 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/d2isometric/d2isometricimg/render.go"},"region":{"startLine":56}}}],"partialFingerprints":{"codehealthFindingId/v1":"47fa464a44441bcdb815c3647cf1ee139531549ba5a161dec44edf42159930c8"}},{"ruleId":"D1","level":"warning","message":{"text":"meshBuilder.canonicalNode (cyclomatic 24): meshBuilder.canonicalNode 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/d2isometric/d2isometricimg/native_shapes.go"},"region":{"startLine":313}}}],"partialFingerprints":{"codehealthFindingId/v1":"767106dc7e769aee0cc9825dbd85b792f3bf8977ba95b20ee6c83db6787b95d7"}},{"ruleId":"D1","level":"warning","message":{"text":"surfaceIconPainter.texture (cyclomatic 24): surfaceIconPainter.texture has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/surface_icons.go"},"region":{"startLine":130}}}],"partialFingerprints":{"codehealthFindingId/v1":"e1068a85ea709e4d76d35a39f7342ce1eadfecba20b69583e3f1f5a7d0bfa646"}},{"ruleId":"D1","level":"warning","message":{"text":"nativeSurfaceSVGWriter.primitive (cyclomatic 24): nativeSurfaceSVGWriter.primitive 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/d2isometric/d2isometricimg/vector_surface_svg.go"},"region":{"startLine":371}}}],"partialFingerprints":{"codehealthFindingId/v1":"cb5bbaece572f4ba26de5fbefd1821f2f515b348ac70c51301346ecfc33f5970"}},{"ruleId":"D1","level":"warning","message":{"text":"d2raster.renderBands (cyclomatic 24): d2raster.renderBands 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/d2raster/bands.go"},"region":{"startLine":38}}}],"partialFingerprints":{"codehealthFindingId/v1":"3805040c02c743ac3915c934975747e5de013652fd1d41dfea762b60540a4725"}},{"ruleId":"D1","level":"warning","message":{"text":"Rasterizer.accumulateEdgeRow (cyclomatic 24): Rasterizer.accumulateEdgeRow 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/d2raster/internal/scanline/rasterizer.go"},"region":{"startLine":1169}}}],"partialFingerprints":{"codehealthFindingId/v1":"7855f65b6e675501c1f95d70f3920d26159d5d4d18e55b06b3e42b1166f7cd91"}},{"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":259}}}],"partialFingerprints":{"codehealthFindingId/v1":"c77c4df87824d3a71253f4c98bad085cfa88be482635a5dcb5090ee01bdc3ade"}},{"ruleId":"D1","level":"warning","message":{"text":"svgGeometry.primitive (cyclomatic 24): svgGeometry.primitive has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svgimport/compile.go"},"region":{"startLine":597}}}],"partialFingerprints":{"codehealthFindingId/v1":"626db483bddfde45042de4311e2af0fdae1ef34bc35604d81e9b9a672733a0a6"}},{"ruleId":"D1","level":"warning","message":{"text":"testutil.parsePDFLiteralString (cyclomatic 24): testutil.parsePDFLiteralString has cyclomatic complexity 24 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/testutil/pdf.go"},"region":{"startLine":545}}}],"partialFingerprints":{"codehealthFindingId/v1":"c15e136c1b88bdfcce4777ff9ff7626c6c2a4727ef09bf663bf43965d2009980"}},{"ruleId":"D1","level":"warning","message":{"text":"d2cli.validateBoardOutputManifest (cyclomatic 23): d2cli.validateBoardOutputManifest has cyclomatic complexity 23 (threshold 15). Of this number, 13 points are the body\u0027s own statements and 10 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own 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/board_output_publish.go"},"region":{"startLine":272}}}],"partialFingerprints":{"codehealthFindingId/v1":"d15a124e717f5f1145e3343a4ff22fd9a2944ec60752bee207f7582866c2337f"}},{"ruleId":"D1","level":"warning","message":{"text":"compiler.__import (cyclomatic 23): compiler.__import 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":"d2ir/import.go"},"region":{"startLine":86}}}],"partialFingerprints":{"codehealthFindingId/v1":"17ad6afde1b3b98090c901f4237c209b20d3dd439d060f9fdebf5cfd376bc291"}},{"ruleId":"D1","level":"warning","message":{"text":"hierarchy.isValid (cyclomatic 23): hierarchy.isValid 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":"d2layouts/d2talalayout/internal/hierarchy/discovery.go"},"region":{"startLine":249}}}],"partialFingerprints":{"codehealthFindingId/v1":"87b093eec8d9bb9305911b1cb2b1ebb1871b273cbe7725ee3122e5214cece534"}},{"ruleId":"D1","level":"warning","message":{"text":"rankSimplex.optimize (cyclomatic 23): rankSimplex.optimize 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":"d2layouts/d2talalayout/internal/hierarchy/rank_simplex.go"},"region":{"startLine":281}}}],"partialFingerprints":{"codehealthFindingId/v1":"394dd7c1fb29a60f9b8db83d3ac5190d7ae40b81ceaf0edb27432be6eb338adf"}},{"ruleId":"D1","level":"warning","message":{"text":"labeling.clusterNodeBoundingBoxPlacement (cyclomatic 23): labeling.clusterNodeBoundingBoxPlacement 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":"d2layouts/d2talalayout/internal/labeling/guard.go"},"region":{"startLine":325}}}],"partialFingerprints":{"codehealthFindingId/v1":"555361a080ec327f3208a51bf4809e38eb0d216340e90ea3d61374b4232ea7ae"}},{"ruleId":"D1","level":"warning","message":{"text":"layoutgraph.transactionSweepPadding (cyclomatic 23): layoutgraph.transactionSweepPadding 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":"d2layouts/d2talalayout/internal/layoutgraph/transaction.go"},"region":{"startLine":407}}}],"partialFingerprints":{"codehealthFindingId/v1":"1c39eaafcbb2df69fb2c0a851a7dfa512183635e790060e10c36fcff17311bd3"}},{"ruleId":"D1","level":"warning","message":{"text":"Node.boundingBoxValues (cyclomatic 23): Node.boundingBoxValues 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":"d2layouts/d2talalayout/internal/layoutgraph/node.go"},"region":{"startLine":93}}}],"partialFingerprints":{"codehealthFindingId/v1":"9896aaa7be40e6ba4439c70cdfdc464175becc8bfe830d972d084e4e99884125"}},{"ruleId":"D1","level":"warning","message":{"text":"Node.UpdateSpacing (cyclomatic 23): Node.UpdateSpacing has cyclomatic complexity 23 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform \u2014 the same kind of value, with no behaviour of its own \u2014 a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/node.go"},"region":{"startLine":927}}}],"partialFingerprints":{"codehealthFindingId/v1":"431eba3995a8d8fe400056638e7420de1068135da5f653d3e0eb0aee2fe58d1f"}},{"ruleId":"D1","level":"warning","message":{"text":"Node.IsBlocked (cyclomatic 23): Node.IsBlocked 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":"d2layouts/d2talalayout/internal/layoutgraph/node.go"},"region":{"startLine":1172}}}],"partialFingerprints":{"codehealthFindingId/v1":"74e024680d95bfe7e3606ea1ac051796f76faca68c0081b2fbc69eb8c55c0f31"}},{"ruleId":"D1","level":"warning","message":{"text":"optimizerSpatialIndex.rebuild (cyclomatic 23): optimizerSpatialIndex.rebuild has cyclomatic complexity 23 (threshold 15). Of this number, 20 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":"d2layouts/d2talalayout/internal/placement/optimizer_spatial_index.go"},"region":{"startLine":103}}}],"partialFingerprints":{"codehealthFindingId/v1":"62dd0c115653dc143918b3a4e98575b936824ee597977e52ae10109b3508baa2"}},{"ruleId":"D1","level":"warning","message":{"text":"routing.routeStageGraphBoundingBox (cyclomatic 23): routing.routeStageGraphBoundingBox has cyclomatic complexity 23 (threshold 15). Of this number, 21 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own 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/d2talalayout/internal/routing/route_stage_guard.go"},"region":{"startLine":400}}}],"partialFingerprints":{"codehealthFindingId/v1":"4df10aa1044133d3299bf905d05ced00bb1f755bb18318e41a067beb06ebf359"}},{"ruleId":"D1","level":"warning","message":{"text":"routing.swapEdgesOnAdjacentSides (cyclomatic 23): routing.swapEdgesOnAdjacentSides 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":"d2layouts/d2talalayout/internal/routing/swap_ports.go"},"region":{"startLine":541}}}],"partialFingerprints":{"codehealthFindingId/v1":"294f5ba56c1a2b291f51743ec6ac6e36637de084f899581b09184465e470357f"}},{"ruleId":"D1","level":"warning","message":{"text":"trees.putBackNonBranchingTrees (cyclomatic 23): trees.putBackNonBranchingTrees 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":"d2layouts/d2talalayout/internal/trees/layout.go"},"region":{"startLine":573}}}],"partialFingerprints":{"codehealthFindingId/v1":"336fcbb86523f4ce9d01fe5afbbefc55f9194d65282766d10a38140796632e6e"}},{"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":133}}}],"partialFingerprints":{"codehealthFindingId/v1":"11f76e026caaeeda6b7a8b60a7e49f747b7b3c34cd59c412ab7eb07c24970efa"}},{"ruleId":"D1","level":"warning","message":{"text":"d2isometricimg.nativeConnectionCaptionSurface (cyclomatic 23): d2isometricimg.nativeConnectionCaptionSurface 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":"d2renderers/d2isometric/d2isometricimg/route_caption_style.go"},"region":{"startLine":57}}}],"partialFingerprints":{"codehealthFindingId/v1":"3bc698cb88a91d5addcaee66a82402401996686b968fcbc83ccad5db0d358878"}},{"ruleId":"D1","level":"warning","message":{"text":"d2isometricimg.nativeFallbackTextTexture (cyclomatic 23): d2isometricimg.nativeFallbackTextTexture has cyclomatic complexity 23 (threshold 15). Of this number, 15 points are the body\u0027s own statements and 8 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/surface_fonts.go"},"region":{"startLine":206}}}],"partialFingerprints":{"codehealthFindingId/v1":"0f4909aaca59139e1ec407257d56993a50abc6fe068dcf09e969ff0f626cdeea"}},{"ruleId":"D1","level":"warning","message":{"text":"d2isometricimg.nativeSurfaceSVG (cyclomatic 23): d2isometricimg.nativeSurfaceSVG has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/vector_surface_svg.go"},"region":{"startLine":36}}}],"partialFingerprints":{"codehealthFindingId/v1":"7a3741185774aa2a78b4682c07b492ba539f05ba6fc6c63494f40bf0f63a5dd7"}},{"ruleId":"D1","level":"warning","message":{"text":"preflight.assets (cyclomatic 23): preflight.assets 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/d2raster/raster.go"},"region":{"startLine":837}}}],"partialFingerprints":{"codehealthFindingId/v1":"8947d2e6d6943e6260e8691ab0c5b36014534da4cb6905eb8b596bc0e38884cb"}},{"ruleId":"D1","level":"warning","message":{"text":"d2svgimport.validatePrimitiveBounds (cyclomatic 23): d2svgimport.validatePrimitiveBounds has cyclomatic complexity 23 (threshold 15). Of this number, 20 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":"d2renderers/d2svgimport/import.go"},"region":{"startLine":242}}}],"partialFingerprints":{"codehealthFindingId/v1":"56e7e0c98199304d0ef69238510cc7e2eadd2170e82dfc669e3274534e38ed06"}},{"ruleId":"D1","level":"warning","message":{"text":"svgImporter.attributes (cyclomatic 23): svgImporter.attributes 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/d2svgimport/import.go"},"region":{"startLine":770}}}],"partialFingerprints":{"codehealthFindingId/v1":"c485d820b1247b68a94a65e211989fe69d14b7674e1397882d9c1b1754371d89"}},{"ruleId":"D1","level":"warning","message":{"text":"d2target.stabilizeHashURLs (cyclomatic 23): d2target.stabilizeHashURLs has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 2 of the 23 points are its own statements and the rest belongs to one function literal inside it that branches (line 256). 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":"d2target/d2target.go"},"region":{"startLine":250}}}],"partialFingerprints":{"codehealthFindingId/v1":"45068b2e2f50cd724b3098f10eab92d27eca3b492b68acf97f6bc7ee956aaa01"}},{"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":1133}}}],"partialFingerprints":{"codehealthFindingId/v1":"1a7bf3564352085b7d0546144285afc443055e66b1a9a394d45ea4ae08aff904"}},{"ruleId":"D1","level":"warning","message":{"text":"rasterimage.extractWebPFrame (cyclomatic 23): rasterimage.extractWebPFrame 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":"internal/rasterimage/firstframe.go"},"region":{"startLine":840}}}],"partialFingerprints":{"codehealthFindingId/v1":"76265cdf18fb6da68dd722db4bddb6f8286ffcafac138c358410b8a9ec3eedc2"}},{"ruleId":"D1","level":"warning","message":{"text":"run.run (cyclomatic 23): run.run has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"ci/nonlayout-perf/run.py"},"region":{"startLine":41}}}],"partialFingerprints":{"codehealthFindingId/v1":"3b5cea2728391969cdcf45b0941056926a38500de1581676ab5c3cca86e8d6a2"}},{"ruleId":"D1","level":"warning","message":{"text":"main.main (cyclomatic 22): main.main has cyclomatic complexity 22 (threshold 15). Of this number, 21 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"ci/tala-performance/main.go"},"region":{"startLine":197}}}],"partialFingerprints":{"codehealthFindingId/v1":"ba0bbfd755b4817f90954d2ba7e9f4e022522564ae4f35db26dafcce08598161"}},{"ruleId":"D1","level":"warning","message":{"text":"d2cli.publishBoardOutputWorkspace (cyclomatic 22): d2cli.publishBoardOutputWorkspace has cyclomatic complexity 22 (threshold 15). Of this number, 21 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2cli/board_output_publish.go"},"region":{"startLine":38}}}],"partialFingerprints":{"codehealthFindingId/v1":"a6e457f2e860b65078cab944dfc270f9407438d380f830dcd7200bb8c1735fa6"}},{"ruleId":"D1","level":"warning","message":{"text":"d2compiler.compileConfig (cyclomatic 22): d2compiler.compileConfig has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2compiler/compile.go"},"region":{"startLine":1823}}}],"partialFingerprints":{"codehealthFindingId/v1":"f1a0268f3207eebff562f410264595782bccdb27fecfdc7afd13b09d72883620"}},{"ruleId":"D1","level":"warning","message":{"text":"compiler.compileBoard (cyclomatic 22): compiler.compileBoard has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2compiler/compile.go"},"region":{"startLine":145}}}],"partialFingerprints":{"codehealthFindingId/v1":"caaf8b4405a1dfa5c9953038a7ff3865c1be2c7a3659730e8ad1aa629cb61276"}},{"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":"engine.CompoundCandidate (cyclomatic 22): engine.CompoundCandidate has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/engine/compound_candidate.go"},"region":{"startLine":16}}}],"partialFingerprints":{"codehealthFindingId/v1":"7ae7372db73e78e3243dc4f9717494462035578fe459f02f34937759fec1778f"}},{"ruleId":"D1","level":"warning","message":{"text":"grouping.Cleanup (cyclomatic 22): grouping.Cleanup has cyclomatic complexity 22 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/grouping/lifecycle.go"},"region":{"startLine":126}}}],"partialFingerprints":{"codehealthFindingId/v1":"8c3bb50e98cd0ce901585d1d10c682af4ddb52fa649f78014013e60aba63fe78"}},{"ruleId":"D1","level":"warning","message":{"text":"layoutgraph.countSegmentCrossingsWithCheck (cyclomatic 22): layoutgraph.countSegmentCrossingsWithCheck 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":"d2layouts/d2talalayout/internal/layoutgraph/segment_crossing.go"},"region":{"startLine":54}}}],"partialFingerprints":{"codehealthFindingId/v1":"59db28b4d30185921e8756082e3adc58fe47153d7518c62808197b37c6f3e65e"}},{"ruleId":"D1","level":"warning","message":{"text":"graphCloneState.copyTrees (cyclomatic 22): graphCloneState.copyTrees has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 6 of the 22 points are its own statements and the rest belongs to one function literal inside it that branches (line 552). 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/d2talalayout/internal/layoutgraph/clone.go"},"region":{"startLine":546}}}],"partialFingerprints":{"codehealthFindingId/v1":"68582a7536b65ba812243de13c5e904fae3f0163e2349d9300bf62251589a6ce"}},{"ruleId":"D1","level":"warning","message":{"text":"Graph.allDescendantNodesGuarded (cyclomatic 22): Graph.allDescendantNodesGuarded has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 10 of the 22 points are its own statements and the rest belongs to one function literal inside it that branches (line 971). 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/d2talalayout/internal/layoutgraph/graph.go"},"region":{"startLine":955}}}],"partialFingerprints":{"codehealthFindingId/v1":"bba406981b8cdd1c84b483ec0037284ab9180928e697f0fbac40a2c00eff7b71"}},{"ruleId":"D1","level":"warning","message":{"text":"packing.snapshotCombineNodePositions (cyclomatic 22): packing.snapshotCombineNodePositions has cyclomatic complexity 22 (threshold 15). Of this number, 18 points are the body\u0027s own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own 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/d2talalayout/internal/packing/combine_snapshot.go"},"region":{"startLine":25}}}],"partialFingerprints":{"codehealthFindingId/v1":"44b334d78dd0390de5928639b0ea7a5885b0ae2b2b92889df78c21ec5eb0d3c5"}},{"ruleId":"D1","level":"warning","message":{"text":"placement.snapshotNodePositionsContext (cyclomatic 22): placement.snapshotNodePositionsContext has cyclomatic complexity 22 (threshold 15). Of this number, 18 points are the body\u0027s own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own 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/d2talalayout/internal/placement/types.go"},"region":{"startLine":47}}}],"partialFingerprints":{"codehealthFindingId/v1":"bf0c1203ab2a017c0c6347d8cf5593fa0d0b3fde7de4d61024c53c763db68654"}},{"ruleId":"D1","level":"warning","message":{"text":"routing.balancePortInteriorsGuarded (cyclomatic 22): routing.balancePortInteriorsGuarded 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":"d2layouts/d2talalayout/internal/routing/port_interior_balance.go"},"region":{"startLine":18}}}],"partialFingerprints":{"codehealthFindingId/v1":"ff6e38d005ae2e6a018f17c95d92efe557cb44caec57f3e13b026bed36c8d4d2"}},{"ruleId":"D1","level":"warning","message":{"text":"routing.positionedArrowheadLabelCostGuarded (cyclomatic 22): routing.positionedArrowheadLabelCostGuarded 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":"d2layouts/d2talalayout/internal/routing/standalone_route_guard.go"},"region":{"startLine":207}}}],"partialFingerprints":{"codehealthFindingId/v1":"10b1adf57dcd17db067c5e9803b59181cb96cafe5d0e8df41021f09cdc0249c9"}},{"ruleId":"D1","level":"warning","message":{"text":"OVG.connectNodes (cyclomatic 22): OVG.connectNodes has cyclomatic complexity 22 (threshold 15). Of this number, 19 points are the body\u0027s own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/ovg.go"},"region":{"startLine":1115}}}],"partialFingerprints":{"codehealthFindingId/v1":"5dca4d9d1072821cde42b7c22248110a0365302ce6f2ecee22ececb6a4c19ee5"}},{"ruleId":"D1","level":"warning","message":{"text":"OVG.fixedOverlapsForBuild (cyclomatic 22): OVG.fixedOverlapsForBuild 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":"d2layouts/d2talalayout/internal/routing/ovg_resource.go"},"region":{"startLine":607}}}],"partialFingerprints":{"codehealthFindingId/v1":"947b82a9bb8998dd70afae3789eba9ff4f9aed1066d2b65fd475e264bd76ce11"}},{"ruleId":"D1","level":"warning","message":{"text":"trees.positionEdgeLabels (cyclomatic 22): trees.positionEdgeLabels 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":"d2layouts/d2talalayout/internal/trees/geometry.go"},"region":{"startLine":285}}}],"partialFingerprints":{"codehealthFindingId/v1":"449095106191a5dbd01c407b7f2866bc6c29ab6a8b31a05859821d9a00297140"}},{"ruleId":"D1","level":"warning","message":{"text":"trees.handleTreeSubgraph (cyclomatic 22): trees.handleTreeSubgraph 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":"d2layouts/d2talalayout/internal/trees/layout.go"},"region":{"startLine":251}}}],"partialFingerprints":{"codehealthFindingId/v1":"b0b79523d90faa08fc4f0f3a1fcb11aad146e15245c27608caeb22ed436c6012"}},{"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":2650}}}],"partialFingerprints":{"codehealthFindingId/v1":"9e534acdfe75219dec99e7722546991a19b3bc683b42c5d16e7620649719c900"}},{"ruleId":"D1","level":"warning","message":{"text":"parser.parseMap (cyclomatic 22): parser.parseMap 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":"d2parser/parse.go"},"region":{"startLine":443}}}],"partialFingerprints":{"codehealthFindingId/v1":"8872ad65f27f1ee9f729b0a573156ec12408ed270e823c1d015ce7d61c1b9872"}},{"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":"meshBuilder.classicInkJunctions (cyclomatic 22): meshBuilder.classicInkJunctions has cyclomatic complexity 22 (threshold 15). Of this number, 21 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/native_ink_joins.go"},"region":{"startLine":12}}}],"partialFingerprints":{"codehealthFindingId/v1":"f6dc825e7d58a668fc81cc10e126076a50a102e541ff1eefe1780d1bf13ad69c"}},{"ruleId":"D1","level":"warning","message":{"text":"meshBuilder.solidContentSupport (cyclomatic 22): meshBuilder.solidContentSupport has cyclomatic complexity 22 (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/d2isometric/d2isometricimg/native_solids.go"},"region":{"startLine":203}}}],"partialFingerprints":{"codehealthFindingId/v1":"f435429d6140bfcd5ba052d9bd4094b67a290f11ee4d6e5586b65afc95c28485"}},{"ruleId":"D1","level":"warning","message":{"text":"routeCaptionPlacer.score (cyclomatic 22): routeCaptionPlacer.score has cyclomatic complexity 22 (threshold 15). Of this number, 11 points are the body\u0027s own statements and 11 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/route_labels.go"},"region":{"startLine":265}}}],"partialFingerprints":{"codehealthFindingId/v1":"b5758ad283f486204890539d6b188274e1d666523b06cb215cd8abf8397c839d"}},{"ruleId":"D1","level":"warning","message":{"text":"nativeSurfaceSVGWriter.node (cyclomatic 22): nativeSurfaceSVGWriter.node 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/d2isometric/d2isometricimg/vector_surface_svg.go"},"region":{"startLine":154}}}],"partialFingerprints":{"codehealthFindingId/v1":"87a0557acd12ca8b0aa43e980e6e81c40f826f2791619d02e3d0eab66b16e7c6"}},{"ruleId":"D1","level":"warning","message":{"text":"d2isometric.composeHierarchy (cyclomatic 22): d2isometric.composeHierarchy 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/d2isometric/hierarchy.go"},"region":{"startLine":13}}}],"partialFingerprints":{"codehealthFindingId/v1":"9eaf4abdf5b1f51279b6eddff0d281b2f403f0b8ff6e24305c2dd87aae098892"}},{"ruleId":"D1","level":"warning","message":{"text":"d2raster.planPrimitiveResources (cyclomatic 22): d2raster.planPrimitiveResources 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/d2raster/effects.go"},"region":{"startLine":502}}}],"partialFingerprints":{"codehealthFindingId/v1":"385954726869ddb8b4b67cb8ada735d6605cf6b0598f552b388c16b0ba8a50c8"}},{"ruleId":"D1","level":"warning","message":{"text":"d2raster.strokeRegionBounds (cyclomatic 22): d2raster.strokeRegionBounds 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/d2raster/stroke_regions.go"},"region":{"startLine":54}}}],"partialFingerprints":{"codehealthFindingId/v1":"9c98fd5e5650ae534c8d0fcbae4abd7e9d8ef4952d256a51e4b8eac6c6baae8b"}},{"ruleId":"D1","level":"warning","message":{"text":"retainedVectorValidator.stroke (cyclomatic 22): retainedVectorValidator.stroke 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/d2raster/vector_validation.go"},"region":{"startLine":756}}}],"partialFingerprints":{"codehealthFindingId/v1":"a5d05ee0c0843b2b116bfe531040784ba2e17171f2ed63e8448aad7c6034a953"}},{"ruleId":"D1","level":"warning","message":{"text":"d2scenebuild.Build (cyclomatic 22): d2scenebuild.Build has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/build.go"},"region":{"startLine":165}}}],"partialFingerprints":{"codehealthFindingId/v1":"4f8d1aee04580b1c29b741af65bde3638526d9ec9411c23704f228cdf641bc12"}},{"ruleId":"D1","level":"warning","message":{"text":"d2sketch.CompileScenePaths (cyclomatic 22): d2sketch.CompileScenePaths 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/d2sketch/scene.go"},"region":{"startLine":34}}}],"partialFingerprints":{"codehealthFindingId/v1":"ea904f1b0e29aa0400b9dcd377b253ff578b46f48021a1ddeb038a1b9a2725e2"}},{"ruleId":"D1","level":"warning","message":{"text":"d2svgimport.splitSVGNumberList (cyclomatic 22): d2svgimport.splitSVGNumberList has cyclomatic complexity 22 (threshold 15). Of this number, 19 points are the body\u0027s own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svgimport/style.go"},"region":{"startLine":744}}}],"partialFingerprints":{"codehealthFindingId/v1":"7f577abe2c4f965b2ff9082283cddceba113cd8414eec02b4dd6b71298f7038d"}},{"ruleId":"D1","level":"warning","message":{"text":"svgImporter.compileClipPathResource (cyclomatic 22): svgImporter.compileClipPathResource 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/d2svgimport/clip.go"},"region":{"startLine":113}}}],"partialFingerprints":{"codehealthFindingId/v1":"89a6e615f76fa5ac918be4eabd1c96f229b6e73e0747bfb34f6b816300200ff1"}},{"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":109}}}],"partialFingerprints":{"codehealthFindingId/v1":"d80ba8b11cf2add9bce46356f698c7d9713009f1235714ced99f16084512490e"}},{"ruleId":"D1","level":"warning","message":{"text":"rasterimage.jpegEXIFOrientation (cyclomatic 22): rasterimage.jpegEXIFOrientation 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":"internal/rasterimage/jpeg_orientation.go"},"region":{"startLine":23}}}],"partialFingerprints":{"codehealthFindingId/v1":"d7b348c99eb231ddba733e042f0077fecfb688d346baf1a8dc9d98d4c4401f7c"}},{"ruleId":"D1","level":"warning","message":{"text":"testutil.InspectD2PDF (cyclomatic 22): testutil.InspectD2PDF 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":"internal/testutil/pdf.go"},"region":{"startLine":66}}}],"partialFingerprints":{"codehealthFindingId/v1":"f951775daf1361aded56e37013e1589872b99a1fb12c1399371f05e79219f8d1"}},{"ruleId":"D1","level":"warning","message":{"text":"testutil.inspectPDFImage (cyclomatic 22): testutil.inspectPDFImage has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/testutil/pdf.go"},"region":{"startLine":343}}}],"partialFingerprints":{"codehealthFindingId/v1":"67dbf0dadf96a365311cf43f112f57b71a8e57ce86cca816ce0c5108a18fff12"}},{"ruleId":"D1","level":"warning","message":{"text":"Resolver.classifySource (cyclomatic 22): Resolver.classifySource 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":"lib/imageasset/resolve.go"},"region":{"startLine":183}}}],"partialFingerprints":{"codehealthFindingId/v1":"a81cfb3517e7d10bbe6f76830d0be5768d2e79f5c027a781e222aafad0dde00e"}},{"ruleId":"D1","level":"warning","message":{"text":"svg.parseSupportedExternalDoctype (cyclomatic 22): svg.parseSupportedExternalDoctype has cyclomatic complexity 22 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/svg/doctype.go"},"region":{"startLine":67}}}],"partialFingerprints":{"codehealthFindingId/v1":"35d9c7cceb69db95827fc91922fd74cd5edd7f2f4ca55b4777221baa5eee0790"}},{"ruleId":"D1","level":"warning","message":{"text":"xgif.buildFewOpaquePaletted (cyclomatic 22): xgif.buildFewOpaquePaletted 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":"lib/xgif/xgif.go"},"region":{"startLine":392}}}],"partialFingerprints":{"codehealthFindingId/v1":"7c526797c7a26f704755886a537dcdd116f79517134727a0d3cff2365cd5a524"}},{"ruleId":"D1","level":"warning","message":{"text":"d2cli._renderWithPNGEncoder (cyclomatic 21): d2cli._renderWithPNGEncoder 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":965}}}],"partialFingerprints":{"codehealthFindingId/v1":"b48e19e84c01c51008afc5c117b4443a51cad2137eaba7c12dc95dbc275fd0bd"}},{"ruleId":"D1","level":"warning","message":{"text":"boardOutputWorkspace.discard (cyclomatic 21): boardOutputWorkspace.discard 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":"d2cli/board_output.go"},"region":{"startLine":348}}}],"partialFingerprints":{"codehealthFindingId/v1":"a37fa72b8b62e727f3a05635deb95a22e5aa8efb22b134ee6dcb853097816870"}},{"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":244}}}],"partialFingerprints":{"codehealthFindingId/v1":"8063bd45c9a477f00288b760e0901f8364db77b2970bee7823c26f136210eeda"}},{"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":387}}}],"partialFingerprints":{"codehealthFindingId/v1":"649b316af2e46a6fe71239f71cb7ba4b4de3e89f9129f421f0a070b8734686c8"}},{"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":1995}}}],"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":1306}}}],"partialFingerprints":{"codehealthFindingId/v1":"39d1bc61c64ed4309498c681c07822b9cd8c6dede63e2e09d98c0ad582e74d49"}},{"ruleId":"D1","level":"warning","message":{"text":"d2talalayout.buildLayoutPatch (cyclomatic 21): d2talalayout.buildLayoutPatch 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/d2talalayout/patch.go"},"region":{"startLine":158}}}],"partialFingerprints":{"codehealthFindingId/v1":"9fbf7c687fe06249144f281397197e85c4a313225e56a96bc76b999faec3f1ad"}},{"ruleId":"D1","level":"warning","message":{"text":"Graph.containerPadding (cyclomatic 21): Graph.containerPadding 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/d2talalayout/internal/layoutgraph/graph.go"},"region":{"startLine":1168}}}],"partialFingerprints":{"codehealthFindingId/v1":"ead2e49b3443cd08a7162645b76a2d1fff208259cbc04bf9ba256b74255a8f78"}},{"ruleId":"D1","level":"warning","message":{"text":"GraphState.captureRuntimeStateContext (cyclomatic 21): GraphState.captureRuntimeStateContext 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/d2talalayout/internal/layoutgraph/transaction_snapshot.go"},"region":{"startLine":707}}}],"partialFingerprints":{"codehealthFindingId/v1":"37660e12f18134136d811a678c82a61f092c145563f72c4653314152cb062c5f"}},{"ruleId":"D1","level":"warning","message":{"text":"packing.estimateEdgeSegments (cyclomatic 21): packing.estimateEdgeSegments has cyclomatic complexity 21 (threshold 15). Of this number, 19 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own 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/d2talalayout/internal/packing/binpack.go"},"region":{"startLine":1283}}}],"partialFingerprints":{"codehealthFindingId/v1":"aa0b5ffde18062570834d191981cba95f4c49696edb5ad30685d7069dcd3cd6d"}},{"ruleId":"D1","level":"warning","message":{"text":"placement.compaction (cyclomatic 21): placement.compaction has cyclomatic complexity 21 (threshold 15). Of this number, 20 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, 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/d2talalayout/internal/placement/compaction.go"},"region":{"startLine":32}}}],"partialFingerprints":{"codehealthFindingId/v1":"50d4f521f52f58ff72b8ea2ba503c0c1028b33e0b33d6a958844eaecf094354a"}},{"ruleId":"D1","level":"warning","message":{"text":"sizelessOptimizer.findClosestUnoccupiedDistanceGuarded (cyclomatic 21): sizelessOptimizer.findClosestUnoccupiedDistanceGuarded has cyclomatic complexity 21 (threshold 15). Of this number, 19 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own 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/d2talalayout/internal/placement/sizeless_optimizer.go"},"region":{"startLine":280}}}],"partialFingerprints":{"codehealthFindingId/v1":"98e0de08c041c47d63766adf64cf939cc90f9e90778f317d5c6cd354b7cb4bc1"}},{"ruleId":"D1","level":"warning","message":{"text":"quality.inspectWithLimit (cyclomatic 21): quality.inspectWithLimit 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/d2talalayout/internal/quality/inspection.go"},"region":{"startLine":27}}}],"partialFingerprints":{"codehealthFindingId/v1":"6045abc46936f17c6734c0f11f3d0e31fa385eb16d49b7e11b43c405cdc36df6"}},{"ruleId":"D1","level":"warning","message":{"text":"routing.nudgeChannelsGuarded (cyclomatic 21): routing.nudgeChannelsGuarded 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/d2talalayout/internal/routing/nudge_channels.go"},"region":{"startLine":50}}}],"partialFingerprints":{"codehealthFindingId/v1":"8f964124e5df6b8a6314a8561c4f3d9373b3aae7322e1f20b102b87ef0ad7988"}},{"ruleId":"D1","level":"warning","message":{"text":"routing.undershot (cyclomatic 21): routing.undershot 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/d2talalayout/internal/routing/slingshot.go"},"region":{"startLine":176}}}],"partialFingerprints":{"codehealthFindingId/v1":"96ee0d7dee3a258294eb3c69da0a66e3fe1eb6d80ae669c83859b67286a18696"}},{"ruleId":"D1","level":"warning","message":{"text":"OVG.flagNodesNearPorts (cyclomatic 21): OVG.flagNodesNearPorts 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/d2talalayout/internal/routing/ovg.go"},"region":{"startLine":1540}}}],"partialFingerprints":{"codehealthFindingId/v1":"fe7b4fc0c460b80cb803a245fc0e95c29effcc00b7566e5d2d1a3fb0481be922"}},{"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":3163}}}],"partialFingerprints":{"codehealthFindingId/v1":"bc249566f980e5052b6d798dbca4f8a8985c2406f3a9c5ab1c0347c670a35411"}},{"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":1490}}}],"partialFingerprints":{"codehealthFindingId/v1":"f3edc6a3abfd3c60bae3bf05a04c9d0e97437e2b2b6ce561f3e876347b7a0ef7"}},{"ruleId":"D1","level":"warning","message":{"text":"SystemFallbackResolver.fontPaths (cyclomatic 21): SystemFallbackResolver.fontPaths 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":"d2renderers/d2fonts/fallback.go"},"region":{"startLine":338}}}],"partialFingerprints":{"codehealthFindingId/v1":"1349412bbd945ac3e7053d65eea42be96d32ac92e01752a0e63ea54b31518901"}},{"ruleId":"D1","level":"warning","message":{"text":"d2isometricimg.rasterSnapshot (cyclomatic 21): d2isometricimg.rasterSnapshot 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":"d2renderers/d2isometric/d2isometricimg/raster.go"},"region":{"startLine":307}}}],"partialFingerprints":{"codehealthFindingId/v1":"64f72031a6a4f8e964f06272f1174acc6de3037a68208aa77acdec1151b4d7b0"}},{"ruleId":"D1","level":"warning","message":{"text":"meshBuilder.arrowOwnerCaps (cyclomatic 21): meshBuilder.arrowOwnerCaps has cyclomatic complexity 21 (threshold 15). Of this number, 14 points are the body\u0027s own statements and 7 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own 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/d2isometric/d2isometricimg/arrow_visibility.go"},"region":{"startLine":94}}}],"partialFingerprints":{"codehealthFindingId/v1":"38819ce9c3911d48738e3b4fae9ee192c84231b655186378d7b7fad1ae79a97c"}},{"ruleId":"D1","level":"warning","message":{"text":"meshBuilder.nativeFaceLayer (cyclomatic 21): meshBuilder.nativeFaceLayer 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/d2isometric/d2isometricimg/native_shapes.go"},"region":{"startLine":191}}}],"partialFingerprints":{"codehealthFindingId/v1":"2da640bdfea973d3f5e424f2bfd7aa4ff4fbd3228535471369ce7ddfa37444c8"}},{"ruleId":"D1","level":"warning","message":{"text":"meshBuilder.routeCaptionKnockout (cyclomatic 21): meshBuilder.routeCaptionKnockout has cyclomatic complexity 21 (threshold 15). Of this number, 18 points are the body\u0027s own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/route_caption_mask.go"},"region":{"startLine":10}}}],"partialFingerprints":{"codehealthFindingId/v1":"213811b014f0e109cdd73f9242261d0fcf4c213297d36babf71b558cab59006c"}},{"ruleId":"D1","level":"warning","message":{"text":"budget.check (cyclomatic 21): budget.check 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":"d2renderers/d2isometric/scene.go"},"region":{"startLine":343}}}],"partialFingerprints":{"codehealthFindingId/v1":"ab9abb68efc41dc61fbd3046312079d90b01e5e52c8bcc56b555c359b4e32318"}},{"ruleId":"D1","level":"warning","message":{"text":"d2raster.normalizeNodeFilters (cyclomatic 21): d2raster.normalizeNodeFilters 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":"d2renderers/d2raster/filter.go"},"region":{"startLine":53}}}],"partialFingerprints":{"codehealthFindingId/v1":"f67adea93daa4540da5b6dbc17f6a046e5f49353107c0d7760c82267abc40a55"}},{"ruleId":"D1","level":"warning","message":{"text":"d2raster.prepareAnimatedPaintWithPattern (cyclomatic 21): d2raster.prepareAnimatedPaintWithPattern 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":"d2renderers/d2raster/gradient.go"},"region":{"startLine":62}}}],"partialFingerprints":{"codehealthFindingId/v1":"ca272b38e6e751e986b620ffd6bce053ae0290070c7edbb272e5d87657cbf7f9"}},{"ruleId":"D1","level":"warning","message":{"text":"d2raster.prepareAnimatedStrokeWithPaint (cyclomatic 21): d2raster.prepareAnimatedStrokeWithPaint 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. This is NOT this file\u0027s highest cyclomatic complexity: d2raster.validateOptions (cyclomatic 23) is higher and carries no row of its own \u2014 it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension\u0027s figures nor in its score."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/raster.go"},"region":{"startLine":1475}}}],"partialFingerprints":{"codehealthFindingId/v1":"5fdfe258f672a5adaf0514b096f874f54a97a1375e430e5da2b748c6324dce9c"}},{"ruleId":"D1","level":"warning","message":{"text":"preflight.preparePatternPaint (cyclomatic 21): preflight.preparePatternPaint 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/d2raster/pattern.go"},"region":{"startLine":50}}}],"partialFingerprints":{"codehealthFindingId/v1":"843361c7cabbdd03ac7b4b54fe128d2477ba4887533686c24d8a90e6463951d2"}},{"ruleId":"D1","level":"warning","message":{"text":"builder.sceneTextReferences (cyclomatic 21): builder.sceneTextReferences 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":"d2renderers/d2scenebuild/font_fallback.go"},"region":{"startLine":802}}}],"partialFingerprints":{"codehealthFindingId/v1":"0ce67a5c693c3d7a4b87b969f056942aa64fbcd3b48eacd65c967d123b3105a9"}},{"ruleId":"D1","level":"warning","message":{"text":"builder.buildConnectionLabels (cyclomatic 21): builder.buildConnectionLabels 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":"d2renderers/d2scenebuild/labels.go"},"region":{"startLine":159}}}],"partialFingerprints":{"codehealthFindingId/v1":"81783525c7a5a4c0c1949cd09ede02cc350f442042874bcda75f2afb49f35ca2"}},{"ruleId":"D1","level":"warning","message":{"text":"builder.buildLegend (cyclomatic 21): builder.buildLegend 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":"d2renderers/d2scenebuild/legend.go"},"region":{"startLine":351}}}],"partialFingerprints":{"codehealthFindingId/v1":"7c9c301fdc20c0e7524274aacff807a2acd03deec6c957b1bbb6687f89a50794"}},{"ruleId":"D1","level":"warning","message":{"text":"builder.buildMarkdownPrimitive (cyclomatic 21): builder.buildMarkdownPrimitive 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":"d2renderers/d2scenebuild/markdown.go"},"region":{"startLine":239}}}],"partialFingerprints":{"codehealthFindingId/v1":"4c9204201049301d94a3f7f1349b3fde7c155acd9c5f799695159257fb86d379"}},{"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":3322}}}],"partialFingerprints":{"codehealthFindingId/v1":"b536d3d8a0468ac03ea5e633919ce381f6f064cc3a374064f6a56857303f3b7d"}},{"ruleId":"D1","level":"warning","message":{"text":"d2svg.themeRuleSelector (cyclomatic 21): d2svg.themeRuleSelector 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":"d2renderers/d2svg/theme.go"},"region":{"startLine":120}}}],"partialFingerprints":{"codehealthFindingId/v1":"a1fcf4b494d584192d2342545529c1325eb1b4428f38c16a661c52da1e5db62d"}},{"ruleId":"D1","level":"warning","message":{"text":"svgImporter.viewport (cyclomatic 21): svgImporter.viewport 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/d2svgimport/viewport.go"},"region":{"startLine":18}}}],"partialFingerprints":{"codehealthFindingId/v1":"e82993bd16c5df026501c6f2e445b17b9ad695bcfba17a0d3cac99ded32ce7d8"}},{"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.renderPPTXWithRenderer (cyclomatic 20): d2cli.renderPPTXWithRenderer has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 7 of the 20 points are its own statements and the rest belongs to one function literal inside it that branches (line 523). 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":"d2cli/paged.go"},"region":{"startLine":509}}}],"partialFingerprints":{"codehealthFindingId/v1":"9fa5c5b4a0464a9512817cfc3e6c9fe7dd35bb9b1dbe28b1fe01b3997fc8ecb9"}},{"ruleId":"D1","level":"warning","message":{"text":"boardOutputTransaction.removeStaleDirectories (cyclomatic 20): boardOutputTransaction.removeStaleDirectories 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":"d2cli/board_output_publish.go"},"region":{"startLine":815}}}],"partialFingerprints":{"codehealthFindingId/v1":"2bf04e682a9eb690d2283577506fcb37b2ab35e4045936d849a6362a9f5e97cc"}},{"ruleId":"D1","level":"warning","message":{"text":"compiler.compilePosition (cyclomatic 20): compiler.compilePosition 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. This is NOT this file\u0027s highest cyclomatic complexity: d2compiler.compileStyleFieldInit (cyclomatic 21) is higher and carries no row of its own \u2014 it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension\u0027s figures nor in its score."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2compiler/compile.go"},"region":{"startLine":798}}}],"partialFingerprints":{"codehealthFindingId/v1":"1464655cfea20f77a8f52af92f3ad93f9f7c0373d65a6bd75d21712c6d08d482"}},{"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":1032}}}],"partialFingerprints":{"codehealthFindingId/v1":"13cc8de8e63a9f728f03219379884420e2a001cf1ae137782cec388b145f490b"}},{"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 1803). 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":1802}}}],"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":78}}}],"partialFingerprints":{"codehealthFindingId/v1":"cb1d359f58950ec7b93d57be285ed6bb9f88f41c5fd3d6e992791e09995cf5ed"}},{"ruleId":"D1","level":"warning","message":{"text":"grouping.identifySequences (cyclomatic 20): grouping.identifySequences 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/d2talalayout/internal/grouping/sequences.go"},"region":{"startLine":18}}}],"partialFingerprints":{"codehealthFindingId/v1":"2b529139915695223ddfeeb6716a3cb98afe79630fe232e635a985ad67623cd1"}},{"ruleId":"D1","level":"warning","message":{"text":"hierarchy.alignHierarchy (cyclomatic 20): hierarchy.alignHierarchy 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/d2talalayout/internal/hierarchy/brandes_kopf.go"},"region":{"startLine":42}}}],"partialFingerprints":{"codehealthFindingId/v1":"4015ce8bbefe325ccdd49cc3c665d5438e83c583dc3024c8d524e36bfaf1b86f"}},{"ruleId":"D1","level":"warning","message":{"text":"labeling.sortLabelPlacementEdges (cyclomatic 20): labeling.sortLabelPlacementEdges has cyclomatic complexity 20 (threshold 15). Of this number, 16 points are the body\u0027s own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/labeling/guard.go"},"region":{"startLine":486}}}],"partialFingerprints":{"codehealthFindingId/v1":"da329e22b19ff99489c4a337ee614be2b1e2576e8156b6d9aa0e1ba504ce3301"}},{"ruleId":"D1","level":"warning","message":{"text":"placementcost.obstructed (cyclomatic 20): placementcost.obstructed has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 3 of the 20 points are its own statements and the rest belongs to one function literal inside it that branches (line 516). 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/d2talalayout/internal/placementcost/symmetry.go"},"region":{"startLine":514}}}],"partialFingerprints":{"codehealthFindingId/v1":"64429484dc4fb5bf163b92c86d5f950199f98bbd9af4b9a3a227b60daa9ec367"}},{"ruleId":"D1","level":"warning","message":{"text":"placementcost.isMirrored (cyclomatic 20): placementcost.isMirrored 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/d2talalayout/internal/placementcost/symmetry.go"},"region":{"startLine":625}}}],"partialFingerprints":{"codehealthFindingId/v1":"ed128c8b27a3757a7ad523f377a11db03b91aaf9f8d7176025deaea032143a2f"}},{"ruleId":"D1","level":"warning","message":{"text":"routing.routeEdgesWithResourceGuards (cyclomatic 20): routing.routeEdgesWithResourceGuards 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/d2talalayout/internal/routing/coordinator.go"},"region":{"startLine":419}}}],"partialFingerprints":{"codehealthFindingId/v1":"b5174d951f734bd475504b953f7274f2c3d6e6cd644c6c5fc9714eca94d4a4a7"}},{"ruleId":"D1","level":"warning","message":{"text":"routing.newOVGEdgeRouterWithWorkLimit (cyclomatic 20): routing.newOVGEdgeRouterWithWorkLimit has cyclomatic complexity 20 (threshold 15). Of this number, 19 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/ovg_edge_router.go"},"region":{"startLine":102}}}],"partialFingerprints":{"codehealthFindingId/v1":"c21c5f16d3215d74f7ad95f8baee9c639f074ddc474784faadf8bf063d19634b"}},{"ruleId":"D1","level":"warning","message":{"text":"routing.treeEdgePathForBuild (cyclomatic 20): routing.treeEdgePathForBuild has cyclomatic complexity 20 (threshold 15). Of this number, 19 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/tree_routes.go"},"region":{"startLine":28}}}],"partialFingerprints":{"codehealthFindingId/v1":"141c5add3db47186aca472a368e52cba64639c9ce7241327ce04b34ee9c00144"}},{"ruleId":"D1","level":"warning","message":{"text":"routing.buildTunnels (cyclomatic 20): routing.buildTunnels 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/d2talalayout/internal/routing/tunnel.go"},"region":{"startLine":366}}}],"partialFingerprints":{"codehealthFindingId/v1":"a73ba67d157fb8741aa22922f61891070ce9fce2f4c4700c6c01aefccb93a527"}},{"ruleId":"D1","level":"warning","message":{"text":"OVG.addEdgesNodes (cyclomatic 20): OVG.addEdgesNodes 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/d2talalayout/internal/routing/ovg.go"},"region":{"startLine":433}}}],"partialFingerprints":{"codehealthFindingId/v1":"a81181fad23c8eef54216965f1d3856d43637ce65dc625102d276ad488d9bc55"}},{"ruleId":"D1","level":"warning","message":{"text":"OVG.createPortsConnectionsToBoundaries (cyclomatic 20): OVG.createPortsConnectionsToBoundaries has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 6 of the 20 points are its own statements and the rest belongs to one function literal inside it that branches (line 1470). 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/d2talalayout/internal/routing/ovg.go"},"region":{"startLine":1455}}}],"partialFingerprints":{"codehealthFindingId/v1":"63088c5b6d9b8cd03bbc94df9272a1536c5480ccec1e86a4aefabadcd3f97540"}},{"ruleId":"D1","level":"warning","message":{"text":"ovgEdgeRouter.slingshot (cyclomatic 20): ovgEdgeRouter.slingshot has cyclomatic complexity 20 (threshold 15). Of this number, 13 points are the body\u0027s own statements and 7 belong to one function literal inside it that branches. To reduce it, split the body: 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/d2talalayout/internal/routing/slingshot.go"},"region":{"startLine":566}}}],"partialFingerprints":{"codehealthFindingId/v1":"fd64824eef6a7cf6f982de6a02796211ae4098137ef05bda7f96f7f554019fd0"}},{"ruleId":"D1","level":"warning","message":{"text":"trees.treePlacementDescendants (cyclomatic 20): trees.treePlacementDescendants has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 9 of the 20 points are its own statements and the rest belongs to one function literal inside it that branches (line 578). 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/d2talalayout/internal/trees/geometry.go"},"region":{"startLine":571}}}],"partialFingerprints":{"codehealthFindingId/v1":"05e97f9317300a34ff9a32eab62a01bb3f4e18b25314c05109b2c8ade7ff3499"}},{"ruleId":"D1","level":"warning","message":{"text":"d2isometricimg.nativeLaneObstacles (cyclomatic 20): d2isometricimg.nativeLaneObstacles has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/route_lanes.go"},"region":{"startLine":350}}}],"partialFingerprints":{"codehealthFindingId/v1":"f08c597f74b0a30550e768020a7e29ae70f576caee4cff2b10fa0bbfce772973"}},{"ruleId":"D1","level":"warning","message":{"text":"d2isometricimg.nativeSequenceCaptionData (cyclomatic 20): d2isometricimg.nativeSequenceCaptionData has cyclomatic complexity 20 (threshold 15). Of this number, 18 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/sequence_routes.go"},"region":{"startLine":100}}}],"partialFingerprints":{"codehealthFindingId/v1":"824d041f26396792e4a091eb257ff39c891ffbec0dde1ed84513839856506e2e"}},{"ruleId":"D1","level":"warning","message":{"text":"projectedExtent.preparedGroundShadows (cyclomatic 20): projectedExtent.preparedGroundShadows has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 7 of the 20 points are its own statements and the rest belongs to one function literal inside it that branches (line 90). 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":"d2renderers/d2isometric/d2isometricimg/framing.go"},"region":{"startLine":75}}}],"partialFingerprints":{"codehealthFindingId/v1":"4755ab9cf690e575c10a1251e700f4c08ea8195b511e26c91c3b9412414b10fb"}},{"ruleId":"D1","level":"warning","message":{"text":"d2raster.multiplyLayerByAlpha (cyclomatic 20): d2raster.multiplyLayerByAlpha 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":"d2renderers/d2raster/effects.go"},"region":{"startLine":1023}}}],"partialFingerprints":{"codehealthFindingId/v1":"b8e8e05546d8011ec031fe894df0e596304340005be1d64f1abd7c71f1cdc2e5"}},{"ruleId":"D1","level":"warning","message":{"text":"preflight.prepareFilters (cyclomatic 20): preflight.prepareFilters 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. This is NOT this file\u0027s highest cyclomatic complexity: d2raster.exactIntegerTranslatedBounds (cyclomatic 21) is higher and carries no row of its own \u2014 it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension\u0027s figures nor in its score."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/filter.go"},"region":{"startLine":132}}}],"partialFingerprints":{"codehealthFindingId/v1":"747260bcc7d29680062644250f6137c3c23b51e6df006838be847c95b79111e6"}},{"ruleId":"D1","level":"warning","message":{"text":"builder.buildConnectionMask (cyclomatic 20): builder.buildConnectionMask 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":"d2renderers/d2scenebuild/labels.go"},"region":{"startLine":17}}}],"partialFingerprints":{"codehealthFindingId/v1":"be3ec69c716f22affef371fcd35c13b23a43fd925a2fc5bf67e121ce580588cb"}},{"ruleId":"D1","level":"warning","message":{"text":"d2svg.pruneThemeCSSWithClasses (cyclomatic 20): d2svg.pruneThemeCSSWithClasses 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":"d2renderers/d2svg/theme.go"},"region":{"startLine":19}}}],"partialFingerprints":{"codehealthFindingId/v1":"a092cf4aed8622324f08c1f8c496e2a19ebd67bffd60fffb61fcb109ed67576c"}},{"ruleId":"D1","level":"warning","message":{"text":"d2svgimport.inspectEmbeddedGIF (cyclomatic 20): d2svgimport.inspectEmbeddedGIF 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":"d2renderers/d2svgimport/image.go"},"region":{"startLine":492}}}],"partialFingerprints":{"codehealthFindingId/v1":"732baf099f6aca9f4d9b19784cf22dc44175c158f708cd4607a2244c12715a2f"}},{"ruleId":"D1","level":"warning","message":{"text":"svgImporter.validateClipTree (cyclomatic 20): svgImporter.validateClipTree 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":"d2renderers/d2svgimport/clip.go"},"region":{"startLine":38}}}],"partialFingerprints":{"codehealthFindingId/v1":"eff4b96bd3e1a830a422d9e458e57fc2b034e27559997805f091cdb5b9ec47b1"}},{"ruleId":"D1","level":"warning","message":{"text":"imageasset.expandDeclaredSVG (cyclomatic 20): imageasset.expandDeclaredSVG 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":"lib/imageasset/probe.go"},"region":{"startLine":148}}}],"partialFingerprints":{"codehealthFindingId/v1":"b829333fda2eca2f9d72a7ae9156b0f9bd7f4cea734e5dd0e2638bc84c8e9e50"}},{"ruleId":"D1","level":"warning","message":{"text":"Resolver.loadData (cyclomatic 20): Resolver.loadData 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":"lib/imageasset/resolve.go"},"region":{"startLine":507}}}],"partialFingerprints":{"codehealthFindingId/v1":"411db7c3b151eb7ac058a4426e1e851c88a26677824bf78f4d03c78365a23a86"}},{"ruleId":"D1","level":"warning","message":{"text":"compare.main (cyclomatic 20): compare.main 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":"ci/tala-performance/compare.py"},"region":{"startLine":48}}}],"partialFingerprints":{"codehealthFindingId/v1":"44abb09ce32db6b7836ed0bcd8852a48cf9a9a00af21ba378fbcc3be4bd3eda7"}},{"ruleId":"D1","level":"warning","message":{"text":"d2cli.isPortableBoardOutputComponent (cyclomatic 19): d2cli.isPortableBoardOutputComponent 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":"d2cli/board_output.go"},"region":{"startLine":50}}}],"partialFingerprints":{"codehealthFindingId/v1":"5a0c67997fabdbcc234595262c04468c59566ec99cba83fb63646f2c93e02cda"}},{"ruleId":"D1","level":"warning","message":{"text":"d2cli.renderPDFWithRenderer (cyclomatic 19): d2cli.renderPDFWithRenderer has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 7 of the 19 points are its own statements and the rest belongs to one function literal inside it that branches (line 440). 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":"d2cli/paged.go"},"region":{"startLine":428}}}],"partialFingerprints":{"codehealthFindingId/v1":"1a7ac69c0343537d05ca167601d4b20bbfc9de427a85733422e288e500e4b0cd"}},{"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":359}}}],"partialFingerprints":{"codehealthFindingId/v1":"366038c08c6c90c056eac6f92aa18ca86e721309ba2d9aa4b8a9e6989c62f034"}},{"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":"hierarchy.markConflicts (cyclomatic 19): hierarchy.markConflicts has cyclomatic complexity 19 (threshold 15). Of this number, 18 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/hierarchy/brandes_kopf.go"},"region":{"startLine":467}}}],"partialFingerprints":{"codehealthFindingId/v1":"9d15401bc3831c19f39bcf23d4b2d9e0b027757f1eb2d2645f47398c673b849a"}},{"ruleId":"D1","level":"warning","message":{"text":"hierarchy.assign (cyclomatic 19): hierarchy.assign has cyclomatic complexity 19 (threshold 15). Of this number, 18 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/hierarchy/discovery.go"},"region":{"startLine":111}}}],"partialFingerprints":{"codehealthFindingId/v1":"2e276347215d525dfa633d5d17e486d3fff4c7f02f66c79165feb248a64770bc"}},{"ruleId":"D1","level":"warning","message":{"text":"labeling.sortSharedSegmentGroup (cyclomatic 19): labeling.sortSharedSegmentGroup has cyclomatic complexity 19 (threshold 15). Of this number, 18 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/labeling/guard.go"},"region":{"startLine":557}}}],"partialFingerprints":{"codehealthFindingId/v1":"6e62bd860bbf2055af27226be119e02b5fb0dc2a73df7c565dfe5bfb475589aa"}},{"ruleId":"D1","level":"warning","message":{"text":"packing.placementCandidatesGuarded (cyclomatic 19): packing.placementCandidatesGuarded 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/d2talalayout/internal/packing/binpack.go"},"region":{"startLine":1032}}}],"partialFingerprints":{"codehealthFindingId/v1":"8d6767e0cdb2146ab9852952f01ac0201b8e741a08973e9d02ac4188e6298d54"}},{"ruleId":"D1","level":"warning","message":{"text":"placement.direct (cyclomatic 19): placement.direct 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":"d2layouts/d2talalayout/internal/placement/direct.go"},"region":{"startLine":270}}}],"partialFingerprints":{"codehealthFindingId/v1":"c75c6782caa71660a9e7b5b6e666f622ee1fb5153316e6ed506e5b31cb94dab0"}},{"ruleId":"D1","level":"warning","message":{"text":"sizedOptimizer.findUnoccupiedGuarded (cyclomatic 19): sizedOptimizer.findUnoccupiedGuarded 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/d2talalayout/internal/placement/sized_optimizer.go"},"region":{"startLine":619}}}],"partialFingerprints":{"codehealthFindingId/v1":"08d57cdc36d7650b83522a00bd39fa90977090dba74807d35d647c78a4ed8403"}},{"ruleId":"D1","level":"warning","message":{"text":"obstructionBounds.excludes (cyclomatic 19): obstructionBounds.excludes 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":"d2layouts/d2talalayout/internal/placementcost/obstruction_bounds.go"},"region":{"startLine":40}}}],"partialFingerprints":{"codehealthFindingId/v1":"762946a76bc06c8e175af799a13416451a53cfaee7ce4487825c0385ca7138bf"}},{"ruleId":"D1","level":"warning","message":{"text":"routing.checkBalanceOrder (cyclomatic 19): routing.checkBalanceOrder 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/d2talalayout/internal/routing/balance_route_guard.go"},"region":{"startLine":167}}}],"partialFingerprints":{"codehealthFindingId/v1":"f07251fc8bb8a229ce8df589fb6e32515b1b2fbd82a7c00bf07772615e4c100d"}},{"ruleId":"D1","level":"warning","message":{"text":"routing.segmentIntersectsBox (cyclomatic 19): routing.segmentIntersectsBox has cyclomatic complexity 19 (threshold 15). Of this number, 13 points are the body\u0027s own statements and 6 belong to 2 function literals inside it that branch. To reduce it, 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":"d2layouts/d2talalayout/internal/routing/geometry.go"},"region":{"startLine":9}}}],"partialFingerprints":{"codehealthFindingId/v1":"c16c3ad4fdf56fa8a2021cedc404343648241cddb5de7518397037fd5f57a4a0"}},{"ruleId":"D1","level":"warning","message":{"text":"trees.placeTrees (cyclomatic 19): trees.placeTrees has cyclomatic complexity 19 (threshold 15). Of this number, 18 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/trees/layout.go"},"region":{"startLine":906}}}],"partialFingerprints":{"codehealthFindingId/v1":"38c5200876df3ba0b66d7c32f95a1d3c345f57b3c05e640701a7939eeadc15f1"}},{"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":"d2isometricimg.nativeShapeProfiles (cyclomatic 19): d2isometricimg.nativeShapeProfiles has cyclomatic complexity 19 (threshold 15). Of this number, 11 points are the body\u0027s own statements and 8 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/native_shapes.go"},"region":{"startLine":593}}}],"partialFingerprints":{"codehealthFindingId/v1":"ea3b934679353c8d1444ffd4452a544926be634af5cdbcad79269a1886c1dd22"}},{"ruleId":"D1","level":"warning","message":{"text":"d2isometricimg.nativeVectorInitialPaint (cyclomatic 19): d2isometricimg.nativeVectorInitialPaint has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform \u2014 the same kind of value, with no behaviour of its own \u2014 a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/vector_surface_animation.go"},"region":{"startLine":43}}}],"partialFingerprints":{"codehealthFindingId/v1":"2fea6b3dffee50733172db8d4bf8bbb3e79743439bdfc76d760b49b2a05d1c43"}},{"ruleId":"D1","level":"warning","message":{"text":"meshBuilder.arrowObstacles (cyclomatic 19): meshBuilder.arrowObstacles has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 8 of the 19 points are its own statements and the rest belongs to one function literal inside it that branches (line 234). 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":"d2renderers/d2isometric/d2isometricimg/arrow_visibility.go"},"region":{"startLine":223}}}],"partialFingerprints":{"codehealthFindingId/v1":"ced630be03a2a0322568b92d843c8ea2dcc585681a260bcb042e9a8a084ea7ef"}},{"ruleId":"D1","level":"warning","message":{"text":"meshBuilder.structuredNode (cyclomatic 19): meshBuilder.structuredNode has cyclomatic complexity 19 (threshold 15). Of this number, 18 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/native_structured.go"},"region":{"startLine":142}}}],"partialFingerprints":{"codehealthFindingId/v1":"d7021b601a65eb0ab28378243193f3defe8254f50a26ba3e0fddf69d5f951060"}},{"ruleId":"D1","level":"warning","message":{"text":"nativeSurfaceSVGWriter.paint (cyclomatic 19): nativeSurfaceSVGWriter.paint has cyclomatic complexity 19 (threshold 15). Of this number, 15 points are the body\u0027s own statements and 4 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/vector_surface_svg.go"},"region":{"startLine":280}}}],"partialFingerprints":{"codehealthFindingId/v1":"e20b32b4c75ec9fad914d9d3a8fe2a6f308101e30e8b69f91ec8617a0e72d3bf"}},{"ruleId":"D1","level":"warning","message":{"text":"d2raster.setBandReferenceBounds (cyclomatic 19): d2raster.setBandReferenceBounds 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/d2raster/bands.go"},"region":{"startLine":180}}}],"partialFingerprints":{"codehealthFindingId/v1":"d3cb405a6a2a9bd9f3d77cd769a0040ad768aed0a1e2a6afd97e06a37019107a"}},{"ruleId":"D1","level":"warning","message":{"text":"d2raster.drawSampledPreparedImage (cyclomatic 19): d2raster.drawSampledPreparedImage 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/d2raster/image.go"},"region":{"startLine":1022}}}],"partialFingerprints":{"codehealthFindingId/v1":"5ec824c0175120a13b034cb3b09f38902d7cb19af0099532a2c1ef22973574e8"}},{"ruleId":"D1","level":"warning","message":{"text":"Rasterizer.rasterize (cyclomatic 19): Rasterizer.rasterize 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/d2raster/internal/scanline/rasterizer.go"},"region":{"startLine":1026}}}],"partialFingerprints":{"codehealthFindingId/v1":"c5d44ff324c956c7a09f9cb4c212f38173933e973ab53ac63a03b0027ab0f0ef"}},{"ruleId":"D1","level":"warning","message":{"text":"retainedVectorValidator.paint (cyclomatic 19): retainedVectorValidator.paint 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/d2raster/vector_validation.go"},"region":{"startLine":580}}}],"partialFingerprints":{"codehealthFindingId/v1":"ac2cef977ecd12a1e1fece096e71e6a5ff2b551702404e46fa9c415adee30cc2"}},{"ruleId":"D1","level":"warning","message":{"text":"builder.measureAppendix (cyclomatic 19): builder.measureAppendix 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/d2scenebuild/appendix.go"},"region":{"startLine":139}}}],"partialFingerprints":{"codehealthFindingId/v1":"fcdff2fc322039ecce18b6937ccca2ce568da996f77971bad9202b56b9a7e321"}},{"ruleId":"D1","level":"warning","message":{"text":"builder.preflight (cyclomatic 19): builder.preflight 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":"d2renderers/d2scenebuild/build.go"},"region":{"startLine":282}}}],"partialFingerprints":{"codehealthFindingId/v1":"91046ae6122a9714fc9082cb4611e3a46a3859397953c3733719ff1ebae098a5"}},{"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":178}}}],"partialFingerprints":{"codehealthFindingId/v1":"243b4c7142fe3a99e0047bdc8d0d9b5dac6d52ac4e79e12038fe65c91bbd7e2e"}},{"ruleId":"D1","level":"warning","message":{"text":"d2svgimport.ImportNodeWithOptions (cyclomatic 19): d2svgimport.ImportNodeWithOptions 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":"d2renderers/d2svgimport/import.go"},"region":{"startLine":117}}}],"partialFingerprints":{"codehealthFindingId/v1":"619aca50b904bdb29a74613ef0788cde6196ef133767d224f0639f1db3e27cba"}},{"ruleId":"D1","level":"warning","message":{"text":"d2svgimport.transformFunction (cyclomatic 19): d2svgimport.transformFunction 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/d2svgimport/transform.go"},"region":{"startLine":247}}}],"partialFingerprints":{"codehealthFindingId/v1":"7e7f0d8d091ff0d732dbeafd37a3b5e7f6570964df56010da1f20683d3463b73"}},{"ruleId":"D1","level":"warning","message":{"text":"svgImporter.validateIgnoredUnnamespacedAttribute (cyclomatic 19): svgImporter.validateIgnoredUnnamespacedAttribute 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/d2svgimport/boilerplate.go"},"region":{"startLine":243}}}],"partialFingerprints":{"codehealthFindingId/v1":"a076b40f5be1617b175e5b402c3637b8ea9bad6ac49f814fda423f9f206bb458"}},{"ruleId":"D1","level":"warning","message":{"text":"ParsedFace.SupportsRenderableRune (cyclomatic 19): ParsedFace.SupportsRenderableRune 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/internal/fontface/face.go"},"region":{"startLine":404}}}],"partialFingerprints":{"codehealthFindingId/v1":"cbfd943e53a3752e6332b57e4ebddfe803ef40d506dddb5fc263f86357cd4d3b"}},{"ruleId":"D1","level":"warning","message":{"text":"testutil.ValidatePPTX (cyclomatic 19): testutil.ValidatePPTX 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":"internal/testutil/pptx.go"},"region":{"startLine":18}}}],"partialFingerprints":{"codehealthFindingId/v1":"ca6faf1a31e8045c850f808955fb8da8913a895b6b324f11d6b2ca0acfc59308"}},{"ruleId":"D1","level":"warning","message":{"text":"png.exifChunkLocation (cyclomatic 19): png.exifChunkLocation 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/png/png.go"},"region":{"startLine":135}}}],"partialFingerprints":{"codehealthFindingId/v1":"a5fb63d66b78d574dd242661369a922ea2906c53211a54d8164a93f1863199fc"}},{"ruleId":"D1","level":"warning","message":{"text":"textmeasure.fitMarkdownTableColumns (cyclomatic 19): textmeasure.fitMarkdownTableColumns 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/textmeasure/markdown_svg.go"},"region":{"startLine":1668}}}],"partialFingerprints":{"codehealthFindingId/v1":"bb61fcfd745f536369b95465be15da77949cc0994d398493c1a40d925da9516a"}},{"ruleId":"D1","level":"warning","message":{"text":"markdownPainter.atomizeInlineTokens (cyclomatic 19): markdownPainter.atomizeInlineTokens 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/textmeasure/markdown_svg.go"},"region":{"startLine":1191}}}],"partialFingerprints":{"codehealthFindingId/v1":"73bd26f984ce44720039630d0cfacc3bb3888de6f3cd4a5d1d0d5257d2bb9320"}},{"ruleId":"D1","level":"warning","message":{"text":"run.fingerprints (cyclomatic 19): run.fingerprints 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":"ci/nonlayout-perf/run.py"},"region":{"startLine":142}}}],"partialFingerprints":{"codehealthFindingId/v1":"02519e37a1b33d8b4a5bb5777e12a0191064e0f3c83b8ca8247e7b3cabc9d982"}},{"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":"pagedRenderer.render (cyclomatic 18): pagedRenderer.render has cyclomatic complexity 18 (threshold 15). Of this number, 12 points are the body\u0027s own statements and 6 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2cli/paged.go"},"region":{"startLine":124}}}],"partialFingerprints":{"codehealthFindingId/v1":"0be44555d2e5fc0cf523b79452adb6dda6be35b3eaa67f8b92c0378db59c09f9"}},{"ruleId":"D1","level":"warning","message":{"text":"compiler.compileLegend (cyclomatic 18): compiler.compileLegend 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. This is NOT this file\u0027s highest cyclomatic complexity: d2compiler.compileStyleFieldInit (cyclomatic 21) is higher and carries no row of its own \u2014 it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension\u0027s figures nor in its score."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2compiler/compile.go"},"region":{"startLine":256}}}],"partialFingerprints":{"codehealthFindingId/v1":"42161487621b617f465b4c7c75f5e16dabd68e6ad60e6fae7c3ec4eb4f8e9874"}},{"ruleId":"D1","level":"warning","message":{"text":"compiler.compileEdgeMap (cyclomatic 18): compiler.compileEdgeMap 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. This is NOT this file\u0027s highest cyclomatic complexity: d2compiler.compileStyleFieldInit (cyclomatic 21) is higher and carries no row of its own \u2014 it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension\u0027s figures nor in its score."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2compiler/compile.go"},"region":{"startLine":1247}}}],"partialFingerprints":{"codehealthFindingId/v1":"74bbaac2ed49f869deb33f98a4320c6ee4736438a8e4ef6faad9a95e7a0f9d4b"}},{"ruleId":"D1","level":"warning","message":{"text":"compiler.compileClass (cyclomatic 18): compiler.compileClass 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. This is NOT this file\u0027s highest cyclomatic complexity: d2compiler.compileStyleFieldInit (cyclomatic 21) is higher and carries no row of its own \u2014 it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension\u0027s figures nor in its score."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2compiler/compile.go"},"region":{"startLine":1385}}}],"partialFingerprints":{"codehealthFindingId/v1":"f12870983d360dc10be25f3362acdd807252c089d19026497ca598f45f73c71a"}},{"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.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":"d2ir.Compile (cyclomatic 18): d2ir.Compile has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ir/compile.go"},"region":{"startLine":109}}}],"partialFingerprints":{"codehealthFindingId/v1":"dfc25d9bbae6f71a21bb287dd25b5f59d851c2b712120a547c1275a3a04f8a9d"}},{"ruleId":"D1","level":"warning","message":{"text":"Map.createEdge2 (cyclomatic 18): Map.createEdge2 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":1846}}}],"partialFingerprints":{"codehealthFindingId/v1":"c3b35945bf666a952d7005d26be7ec4ab1f6c861a15dafc01781da80edff3fbf"}},{"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":2405}}}],"partialFingerprints":{"codehealthFindingId/v1":"5997eb8dccc47dc9f0f548573707d0b4f873079722bac1f4de5f7728835dd711"}},{"ruleId":"D1","level":"warning","message":{"text":"astCloner.cloneArray (cyclomatic 18): astCloner.cloneArray 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/import_cache.go"},"region":{"startLine":91}}}],"partialFingerprints":{"codehealthFindingId/v1":"38a59fbbba2c61c77c79812a4658f6e31a21924532d113405ecc52cb5663627e"}},{"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":233}}}],"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":313}}}],"partialFingerprints":{"codehealthFindingId/v1":"b9e6d7108dcc7d5c68e555480e9f1bf383acc5634eeca9e3a096eb24f0ce9f0b"}},{"ruleId":"D1","level":"warning","message":{"text":"Graph.restoreEdgeAbductions (cyclomatic 18): Graph.restoreEdgeAbductions 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/d2talalayout/internal/layoutgraph/layout.go"},"region":{"startLine":72}}}],"partialFingerprints":{"codehealthFindingId/v1":"ad3aaf09a31068c5e06e69bd25678a4e8582091f32187b35b14eb2a840844040"}},{"ruleId":"D1","level":"warning","message":{"text":"packing.blocksRoutesWithDeltasGuarded (cyclomatic 18): packing.blocksRoutesWithDeltasGuarded 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/d2talalayout/internal/packing/binpack.go"},"region":{"startLine":1129}}}],"partialFingerprints":{"codehealthFindingId/v1":"aee822663031969fd1d8d97ec56d155441fbaee8a50f0ef4b184543af10174e4"}},{"ruleId":"D1","level":"warning","message":{"text":"packing.binPackHasExternalConnection (cyclomatic 18): packing.binPackHasExternalConnection 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/d2talalayout/internal/packing/guard.go"},"region":{"startLine":86}}}],"partialFingerprints":{"codehealthFindingId/v1":"dda6180d5cf0adcef6354852ffecfa2bab07c6212902baa01e98d49c832b29d5"}},{"ruleId":"D1","level":"warning","message":{"text":"packing.routedContainerRoundedCornersStayInsideShrink (cyclomatic 18): packing.routedContainerRoundedCornersStayInsideShrink 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/d2talalayout/internal/packing/routed_container.go"},"region":{"startLine":271}}}],"partialFingerprints":{"codehealthFindingId/v1":"6d2134dd95e19a13a4f7a860ea846d2a11c57472fdecb230fe27404cb65e8311"}},{"ruleId":"D1","level":"warning","message":{"text":"packing.routedContainerEndpointKeepsSides (cyclomatic 18): packing.routedContainerEndpointKeepsSides 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":"d2layouts/d2talalayout/internal/packing/routed_container.go"},"region":{"startLine":435}}}],"partialFingerprints":{"codehealthFindingId/v1":"da9481e03578deab73ce7b870443c4ea7c928784ac7dbecb409f44c63d378265"}},{"ruleId":"D1","level":"warning","message":{"text":"sizelessOptimizer.optimizeGuarded (cyclomatic 18): sizelessOptimizer.optimizeGuarded 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/d2talalayout/internal/placement/sizeless_optimizer.go"},"region":{"startLine":161}}}],"partialFingerprints":{"codehealthFindingId/v1":"f5893cc222a05dfd5c36199ea0b4fc2731109adc1ce929c02e5e2f52995f13e0"}},{"ruleId":"D1","level":"warning","message":{"text":"sizelessOptimizer.bestSwapCandidateGuarded (cyclomatic 18): sizelessOptimizer.bestSwapCandidateGuarded has cyclomatic complexity 18 (threshold 15). Of this number, 13 points are the body\u0027s own statements and 5 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own 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/d2talalayout/internal/placement/sizeless_optimizer.go"},"region":{"startLine":479}}}],"partialFingerprints":{"codehealthFindingId/v1":"fc95168148b439815fcd5bed938f178ae2926c113a72cb8b22921a5e1537bc06"}},{"ruleId":"D1","level":"warning","message":{"text":"routing.changedRouteIsClear (cyclomatic 18): routing.changedRouteIsClear 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/d2talalayout/internal/routing/port_interior_balance.go"},"region":{"startLine":87}}}],"partialFingerprints":{"codehealthFindingId/v1":"13e9a413858db28b228fc8ac665c2a8359293b4fea52fc0a4a9e33e3eabaca63"}},{"ruleId":"D1","level":"warning","message":{"text":"routing.fixedOverlapsForRoute (cyclomatic 18): routing.fixedOverlapsForRoute 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/d2talalayout/internal/routing/route_search_guard.go"},"region":{"startLine":304}}}],"partialFingerprints":{"codehealthFindingId/v1":"ca12da51beff36a9bd49288b0e0e833a6f2ce141f27132c2ab98d64dfc014979"}},{"ruleId":"D1","level":"warning","message":{"text":"routing.refineEdgeGuarded (cyclomatic 18): routing.refineEdgeGuarded 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/d2talalayout/internal/routing/swap_ports.go"},"region":{"startLine":248}}}],"partialFingerprints":{"codehealthFindingId/v1":"66b9af086ef5ee46513e7078e01fa5aff8307abc9dbeb5771c7dfb8fa126e0b1"}},{"ruleId":"D1","level":"warning","message":{"text":"ovgEdgeRouter.fillPathGuarded (cyclomatic 18): ovgEdgeRouter.fillPathGuarded 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/d2talalayout/internal/routing/slingshot.go"},"region":{"startLine":413}}}],"partialFingerprints":{"codehealthFindingId/v1":"f527e328be4497ffae1c9c283cf334df27b015b136ff4ce42c2cf3eef0d87ac4"}},{"ruleId":"D1","level":"warning","message":{"text":"trees.treeContainerRDFSOrder (cyclomatic 18): trees.treeContainerRDFSOrder 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/d2talalayout/internal/trees/preprocess_helpers.go"},"region":{"startLine":20}}}],"partialFingerprints":{"codehealthFindingId/v1":"d6f27ff60a05aa9f48745e7efcdeb4442887836f964478727f53af7d519ad927"}},{"ruleId":"D1","level":"warning","message":{"text":"layoutguard.CheckGraph (cyclomatic 18): layoutguard.CheckGraph 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/internal/layoutguard/graph.go"},"region":{"startLine":31}}}],"partialFingerprints":{"codehealthFindingId/v1":"416f970cfadd96755d2e88b150bec95240fdd474995ad7f9c411a856e214e4d3"}},{"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":1476}}}],"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":3354}}}],"partialFingerprints":{"codehealthFindingId/v1":"5d08295c61ecbec33d98cc861879692c884280b88a599c44f0e7f1d2bd1d5a4f"}},{"ruleId":"D1","level":"warning","message":{"text":"d2isometricimg.nativeSolidContactRoutes (cyclomatic 18): d2isometricimg.nativeSolidContactRoutes 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":"d2renderers/d2isometric/d2isometricimg/solid_contacts.go"},"region":{"startLine":79}}}],"partialFingerprints":{"codehealthFindingId/v1":"66c6cff7f38b585e4dc7ef7707d0adfcca6bda9002c9b548602e2b718fc85f3b"}},{"ruleId":"D1","level":"warning","message":{"text":"d2isometricimg.nativeUprightContact (cyclomatic 18): d2isometricimg.nativeUprightContact 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":"d2renderers/d2isometric/d2isometricimg/solid_contacts.go"},"region":{"startLine":151}}}],"partialFingerprints":{"codehealthFindingId/v1":"8c969b5b34aa53bd18dc1ba2ea3411b1c5090eef310152379bdb573965629f59"}},{"ruleId":"D1","level":"warning","message":{"text":"d2isometricimg.nativeQueueContact (cyclomatic 18): d2isometricimg.nativeQueueContact has cyclomatic complexity 18 (threshold 15). Of this number, 16 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/solid_contacts.go"},"region":{"startLine":218}}}],"partialFingerprints":{"codehealthFindingId/v1":"1adba4e56810e7d3fac3b361f60bebc7f304266dfde950e3087a200d7f950a39"}},{"ruleId":"D1","level":"warning","message":{"text":"nativeScene.Frame (cyclomatic 18): nativeScene.Frame 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":"d2renderers/d2isometric/d2isometricimg/geometry.go"},"region":{"startLine":687}}}],"partialFingerprints":{"codehealthFindingId/v1":"8f90f8146e193871abadf53d3f59f2c82037cd84cfbe49a8e68d523f1ac9eaa6"}},{"ruleId":"D1","level":"warning","message":{"text":"nativeScene.frameRaster (cyclomatic 18): nativeScene.frameRaster 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":"d2renderers/d2isometric/d2isometricimg/source_panels.go"},"region":{"startLine":281}}}],"partialFingerprints":{"codehealthFindingId/v1":"bdcef7156498a5d57a20348fde8a2075e2256e191ea066e3af268aa336400a33"}},{"ruleId":"D1","level":"warning","message":{"text":"meshBuilder.classicInkFace (cyclomatic 18): meshBuilder.classicInkFace has cyclomatic complexity 18 (threshold 15). Of this number, 13 points are the body\u0027s own statements and 5 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own 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/d2isometric/d2isometricimg/native_edges.go"},"region":{"startLine":594}}}],"partialFingerprints":{"codehealthFindingId/v1":"41f8b15ced89d340606623cec4befd21335f48d98ac9813768b2dc1325f972de"}},{"ruleId":"D1","level":"warning","message":{"text":"meshBuilder.addDocumentLinks (cyclomatic 18): meshBuilder.addDocumentLinks 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":"d2renderers/d2isometric/d2isometricimg/page.go"},"region":{"startLine":246}}}],"partialFingerprints":{"codehealthFindingId/v1":"134a5dfe7504d36fc267391f858407c8c18b195c50173842cd1d4d71fcbcdca9"}},{"ruleId":"D1","level":"warning","message":{"text":"Raster.rasterPrepareOpacityGroups (cyclomatic 18): Raster.rasterPrepareOpacityGroups has cyclomatic complexity 18 (threshold 15). Of this number, 10 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":"d2renderers/d2isometric/d2isometricimg/opacity_groups.go"},"region":{"startLine":60}}}],"partialFingerprints":{"codehealthFindingId/v1":"85e44c43802cd5e820e5aa5fb37cc251b3f05264e2a831e471299489b25705ac"}},{"ruleId":"D1","level":"warning","message":{"text":"Raster.drawOpacityGroup (cyclomatic 18): Raster.drawOpacityGroup 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":"d2renderers/d2isometric/d2isometricimg/opacity_groups.go"},"region":{"startLine":146}}}],"partialFingerprints":{"codehealthFindingId/v1":"b30cda3aac98f9ed834ed5c187578e76bfe3cbeefa3824da17ee596b0f9e0c64"}},{"ruleId":"D1","level":"warning","message":{"text":"d2raster.renderFilteredEffectNode (cyclomatic 18): d2raster.renderFilteredEffectNode 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":"d2renderers/d2raster/effects.go"},"region":{"startLine":718}}}],"partialFingerprints":{"codehealthFindingId/v1":"c15cc8e7ec5eef669c28f388f30a8a6555d49c9650b00bdd6da3dbe0cc01de42"}},{"ruleId":"D1","level":"warning","message":{"text":"d2raster.compositeCOLRv1SoftLightLayer (cyclomatic 18): d2raster.compositeCOLRv1SoftLightLayer 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":"d2renderers/d2raster/effects.go"},"region":{"startLine":1391}}}],"partialFingerprints":{"codehealthFindingId/v1":"6bb17a2276314d4d0402f3afa2fbac31f0c503fe38f0cf33b6f3add43a30a7fd"}},{"ruleId":"D1","level":"warning","message":{"text":"d2raster.compositeLayerOverOpaquePartialPrefix (cyclomatic 18): d2raster.compositeLayerOverOpaquePartialPrefix 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":"d2renderers/d2raster/effects.go"},"region":{"startLine":1689}}}],"partialFingerprints":{"codehealthFindingId/v1":"6108f20c2452892fb4fe06b34267c16eea09433d658c44c9a293655cf46eb2c3"}},{"ruleId":"D1","level":"warning","message":{"text":"d2raster.prepareRadialGradient (cyclomatic 18): d2raster.prepareRadialGradient 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":"d2renderers/d2raster/gradient.go"},"region":{"startLine":200}}}],"partialFingerprints":{"codehealthFindingId/v1":"9e81c029a736c351fe4f81a1021c65a9294e90c9430e47c937ff64d57b0101c2"}},{"ruleId":"D1","level":"warning","message":{"text":"d2raster.drawDirectPatternMaskPixels (cyclomatic 18): d2raster.drawDirectPatternMaskPixels 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":"d2renderers/d2raster/gradient.go"},"region":{"startLine":1022}}}],"partialFingerprints":{"codehealthFindingId/v1":"07e5854d610c654d71e59b26ef5f0663d72925951295809d8b49e7b0ecbe5c3a"}},{"ruleId":"D1","level":"warning","message":{"text":"d2raster.validateRasterAsset (cyclomatic 18): d2raster.validateRasterAsset has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file\u0027s highest cyclomatic complexity: d2raster.nativeRasterImageOrigin (cyclomatic 19) is higher and carries no row of its own \u2014 it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension\u0027s figures nor in its score."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/image.go"},"region":{"startLine":64}}}],"partialFingerprints":{"codehealthFindingId/v1":"573e4a4db9db5bdad51674260e4f9f8a02ec1228bc4d56a970eed07cc2b0061f"}},{"ruleId":"D1","level":"warning","message":{"text":"retainedVectorValidator.pattern (cyclomatic 18): retainedVectorValidator.pattern has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/vector_validation.go"},"region":{"startLine":633}}}],"partialFingerprints":{"codehealthFindingId/v1":"c35241f09d375616234fd03aeae97e09eca355157f6de435747daa7ff209dcac"}},{"ruleId":"D1","level":"warning","message":{"text":"d2scene.PrimitiveBounds (cyclomatic 18): d2scene.PrimitiveBounds 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":"d2renderers/d2scene/primitive.go"},"region":{"startLine":128}}}],"partialFingerprints":{"codehealthFindingId/v1":"0029b23085062b85a2a5e83e1b5caf2f7e5fb0e34d659516d77251b3037adc18"}},{"ruleId":"D1","level":"warning","message":{"text":"legendLayout.expandViewBox (cyclomatic 18): legendLayout.expandViewBox 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":"d2renderers/d2scenebuild/legend.go"},"region":{"startLine":293}}}],"partialFingerprints":{"codehealthFindingId/v1":"21b423d0391fd73e1e3a73727322dde46d077207b4f419a051e3d0058a2d804d"}},{"ruleId":"D1","level":"warning","message":{"text":"svgImporter.compileUse (cyclomatic 18): svgImporter.compileUse has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svgimport/compile.go"},"region":{"startLine":343}}}],"partialFingerprints":{"codehealthFindingId/v1":"5e40bf94a519f64a79a2d2e541f4d28806fdf57df3ceed232eaf9f4bb3e429c7"}},{"ruleId":"D1","level":"warning","message":{"text":"transformParser.parse (cyclomatic 18): transformParser.parse 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":"d2renderers/d2svgimport/transform.go"},"region":{"startLine":49}}}],"partialFingerprints":{"codehealthFindingId/v1":"5f76b9d183de80d818546a0932c6c44c96c91ab56bcc62cdf7466608ab647e21"}},{"ruleId":"D1","level":"warning","message":{"text":"fontface.colrv1ClipBounds (cyclomatic 18): fontface.colrv1ClipBounds has cyclomatic complexity 18 (threshold 15). Of this number, 15 points are the body\u0027s own statements and 3 belong to one function literal inside it that branches. To reduce it, 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/internal/fontface/face.go"},"region":{"startLine":603}}}],"partialFingerprints":{"codehealthFindingId/v1":"f58abfb27b3a3d3327c8de7fe2d39d21784f55baf11a425b012f88fee3d9aab9"}},{"ruleId":"D1","level":"warning","message":{"text":"rasterimage.inspectGIF (cyclomatic 18): rasterimage.inspectGIF 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":"internal/rasterimage/firstframe.go"},"region":{"startLine":232}}}],"partialFingerprints":{"codehealthFindingId/v1":"b7052f6f1f00349c43175e0604087f3ed4b1f39e3e4c0bbfd8b64f36938fc51b"}},{"ruleId":"D1","level":"warning","message":{"text":"testutil.orderPDFImagesByPage (cyclomatic 18): testutil.orderPDFImagesByPage 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":"internal/testutil/pdf.go"},"region":{"startLine":149}}}],"partialFingerprints":{"codehealthFindingId/v1":"135840ce74afa187890a6e7b5fddb412c033a7c1876637dcfe3cf6aa74468f2d"}},{"ruleId":"D1","level":"warning","message":{"text":"textmeasure.ReplaceSubstitutionsMarkdownBounded (cyclomatic 18): textmeasure.ReplaceSubstitutionsMarkdownBounded has cyclomatic complexity 18 (threshold 15). Of this number, 12 points are the body\u0027s own statements and 6 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/textmeasure/substitutions.go"},"region":{"startLine":24}}}],"partialFingerprints":{"codehealthFindingId/v1":"42df6ac35d65aed63772aca2e646693ba03a898d6a67f44296c7cfa236fd71d6"}},{"ruleId":"D1","level":"warning","message":{"text":"textmeasure.newMarkdownSubstitutionMatcher (cyclomatic 18): textmeasure.newMarkdownSubstitutionMatcher 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":"lib/textmeasure/substitutions.go"},"region":{"startLine":139}}}],"partialFingerprints":{"codehealthFindingId/v1":"a98716b2eb1448593bd28ee1a047aa13ed686f437fdd0c033057e6c2875a9ba2"}},{"ruleId":"D1","level":"warning","message":{"text":"fewOpaqueBucket.split (cyclomatic 18): fewOpaqueBucket.split 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 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":"lib/xgif/xgif.go"},"region":{"startLine":246}}}],"partialFingerprints":{"codehealthFindingId/v1":"667777b879d1731cbaf8c87bcb3b743a806c6925fde83553165bee22a8191269"}},{"ruleId":"D1","level":"warning","message":{"text":"main.verifyChecksums (cyclomatic 17): main.verifyChecksums 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":"ci/release/releasetool/main.go"},"region":{"startLine":512}}}],"partialFingerprints":{"codehealthFindingId/v1":"9acf0dc765899e8b92b8d40905b64c9aac6b5664a88c0b7e03234cfc946bc388"}},{"ruleId":"D1","level":"warning","message":{"text":"d2cli.isometricImageOptions (cyclomatic 17): d2cli.isometricImageOptions 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":"d2cli/isometric_image.go"},"region":{"startLine":19}}}],"partialFingerprints":{"codehealthFindingId/v1":"d484786c389f8990a3a0e9ad259c86cfe2f3bf29824961c9c941f41fd67c4667"}},{"ruleId":"D1","level":"warning","message":{"text":"d2cli.relink (cyclomatic 17): d2cli.relink 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":"d2cli/main.go"},"region":{"startLine":817}}}],"partialFingerprints":{"codehealthFindingId/v1":"f587bbecb3c0d53f586b720fb4d2a37178776e52f0cf1b5181fe61dc4416fa56"}},{"ruleId":"D1","level":"warning","message":{"text":"d2cli.renderGIFBoardFrames (cyclomatic 17): d2cli.renderGIFBoardFrames has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2cli/raster.go"},"region":{"startLine":402}}}],"partialFingerprints":{"codehealthFindingId/v1":"77ec5de68a5723a06498389c39491a7e5db0fda5b4a1f1eee3523506a64029c7"}},{"ruleId":"D1","level":"warning","message":{"text":"compiler.validateBoardLinks (cyclomatic 17): compiler.validateBoardLinks 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. This is NOT this file\u0027s highest cyclomatic complexity: d2compiler.compileStyleFieldInit (cyclomatic 21) is higher and carries no row of its own \u2014 it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension\u0027s figures nor in its score."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2compiler/compile.go"},"region":{"startLine":1726}}}],"partialFingerprints":{"codehealthFindingId/v1":"ca31d22115a68f33ede80551b8825cb1f6a71364244070dc65701cd63a17109b"}},{"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":92}}}],"partialFingerprints":{"codehealthFindingId/v1":"eb86eff151fe0b0794cc7dd6de2560e5face0b3d6570fcda06a655985110f8a5"}},{"ruleId":"D1","level":"warning","message":{"text":"compiler.compileKey (cyclomatic 17): compiler.compileKey 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/compile.go"},"region":{"startLine":1161}}}],"partialFingerprints":{"codehealthFindingId/v1":"56d78d8c2b4409ae7f03235e577240c37a96ed74735aaf05babe9abba2708a51"}},{"ruleId":"D1","level":"warning","message":{"text":"compiler.applyLazyGlobs (cyclomatic 17): compiler.applyLazyGlobs 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":"d2ir/compile.go"},"region":{"startLine":1254}}}],"partialFingerprints":{"codehealthFindingId/v1":"d2b04c9af1bd79b6b219723fc3ea5220ef6e56e7f710f640522c38ef75f4cfc1"}},{"ruleId":"D1","level":"warning","message":{"text":"d2ir.walkComposite (cyclomatic 17): d2ir.walkComposite 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/compile.go"},"region":{"startLine":753}}}],"partialFingerprints":{"codehealthFindingId/v1":"614631d9ac185fff2746c8aab5e82ccfbceccff78a5bd71f571c7140f8bc35df"}},{"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":1061}}}],"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":637}}}],"partialFingerprints":{"codehealthFindingId/v1":"925511dc2dac1bbe66a4a2373bfa300ae73e73ebe484e7b5628d334ac9fe5413"}},{"ruleId":"D1","level":"warning","message":{"text":"d2talalayout.coordinateLocalSeeds (cyclomatic 17): d2talalayout.coordinateLocalSeeds 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/d2talalayout/layout.go"},"region":{"startLine":169}}}],"partialFingerprints":{"codehealthFindingId/v1":"2f6ed706f6a313895f80bb0f56cf2197f310b3af3d718dacf3ce653278555812"}},{"ruleId":"D1","level":"warning","message":{"text":"engine.preserveCompoundInteriors (cyclomatic 17): engine.preserveCompoundInteriors 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":"d2layouts/d2talalayout/internal/engine/compound_routes.go"},"region":{"startLine":38}}}],"partialFingerprints":{"codehealthFindingId/v1":"d820f05469fe2ca3555e2f4d1b0857d6c0099dc8cc379920d0300d6030bcfc11"}},{"ruleId":"D1","level":"warning","message":{"text":"grouping.SequenceDefiningEdges (cyclomatic 17): grouping.SequenceDefiningEdges 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":"d2layouts/d2talalayout/internal/grouping/sequences.go"},"region":{"startLine":80}}}],"partialFingerprints":{"codehealthFindingId/v1":"0f9208681772ebe5723ed10240d269fb0de4f5e8f4c4d6878c174a202ff3d0b2"}},{"ruleId":"D1","level":"warning","message":{"text":"joinPositionJournal.moveWithChildren (cyclomatic 17): joinPositionJournal.moveWithChildren 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":"d2layouts/d2talalayout/internal/grouping/join.go"},"region":{"startLine":46}}}],"partialFingerprints":{"codehealthFindingId/v1":"8fb4e23a56c97c101da251d6ff754338b149f20939ad79480d3d7801b8690ca0"}},{"ruleId":"D1","level":"warning","message":{"text":"hierarchy.Assign (cyclomatic 17): hierarchy.Assign 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/d2talalayout/internal/hierarchy/discovery.go"},"region":{"startLine":38}}}],"partialFingerprints":{"codehealthFindingId/v1":"a7a06e280616dbfba03815160acc84932e5e0134021cd95809ea905e6f4a1592"}},{"ruleId":"D1","level":"warning","message":{"text":"GraphState.captureGeometryStateContext (cyclomatic 17): GraphState.captureGeometryStateContext 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":"d2layouts/d2talalayout/internal/layoutgraph/transaction_snapshot.go"},"region":{"startLine":278}}}],"partialFingerprints":{"codehealthFindingId/v1":"7f24671731e9594a29a8b469292d5596ecdb7f26d3685c5d8253425f67a159fa"}},{"ruleId":"D1","level":"warning","message":{"text":"packing.routedContainerRoutesStayInsideShrink (cyclomatic 17): packing.routedContainerRoutesStayInsideShrink 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":"d2layouts/d2talalayout/internal/packing/routed_container.go"},"region":{"startLine":216}}}],"partialFingerprints":{"codehealthFindingId/v1":"83316d7136f419a68f2104a3642a2fab8c1ea120c7c2dccc0135cd288f928c19"}},{"ruleId":"D1","level":"warning","message":{"text":"placement.inflateAlongAxis (cyclomatic 17): placement.inflateAlongAxis 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":"d2layouts/d2talalayout/internal/placement/compaction.go"},"region":{"startLine":330}}}],"partialFingerprints":{"codehealthFindingId/v1":"2e509f0a3e509ad62571364f5bdc3c018bda9a073ee448b255c81670e1e6df62"}},{"ruleId":"D1","level":"warning","message":{"text":"placement.nearestConnectedAhead (cyclomatic 17): placement.nearestConnectedAhead 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":"d2layouts/d2talalayout/internal/placement/gapreduction.go"},"region":{"startLine":197}}}],"partialFingerprints":{"codehealthFindingId/v1":"36dc9cb87a49bab564f19454cbb5926f568db4080cf2443055f3b001912b36a6"}},{"ruleId":"D1","level":"warning","message":{"text":"placement.withHubSpokesSuppressed (cyclomatic 17): placement.withHubSpokesSuppressed 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":"d2layouts/d2talalayout/internal/placement/sized_optimizer.go"},"region":{"startLine":57}}}],"partialFingerprints":{"codehealthFindingId/v1":"d9ec895408d2a8cd5e5c010496d8f21e2988f0b43ba7b52a360fcd4a6824bf4e"}},{"ruleId":"D1","level":"warning","message":{"text":"placement.newSizelessOptimizer (cyclomatic 17): placement.newSizelessOptimizer 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":"d2layouts/d2talalayout/internal/placement/sizeless_optimizer.go"},"region":{"startLine":29}}}],"partialFingerprints":{"codehealthFindingId/v1":"00d51ede05dfda3c99f09d25057102cd4374323de68c6fdc528e002d9e30f1c9"}},{"ruleId":"D1","level":"warning","message":{"text":"sizelessOptimizer.moveNodeToBestGuarded (cyclomatic 17): sizelessOptimizer.moveNodeToBestGuarded 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/d2talalayout/internal/placement/sizeless_optimizer.go"},"region":{"startLine":403}}}],"partialFingerprints":{"codehealthFindingId/v1":"bea432d4fd08754be4c4fd0c2cecdb600779580f09d5ccf9c1c6385a289791de"}},{"ruleId":"D1","level":"warning","message":{"text":"placementcost.clusterExactlyTwoExternalConnectedNodes (cyclomatic 17): placementcost.clusterExactlyTwoExternalConnectedNodes 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":"d2layouts/d2talalayout/internal/placementcost/cluster.go"},"region":{"startLine":5}}}],"partialFingerprints":{"codehealthFindingId/v1":"d77efec97946b03bcbdfd0f0d9c06e1f80d656e663c581cdf14f4eac007dac2d"}},{"ruleId":"D1","level":"warning","message":{"text":"routing.edgesIntersect (cyclomatic 17): routing.edgesIntersect 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":"d2layouts/d2talalayout/internal/routing/swap_ports.go"},"region":{"startLine":200}}}],"partialFingerprints":{"codehealthFindingId/v1":"f48dc00595d3d47d3a1f7234794eca6200a1b79f323cfb9b2ba01e206a285ecf"}},{"ruleId":"D1","level":"warning","message":{"text":"OVG.isMisdirectedPortPair (cyclomatic 17): OVG.isMisdirectedPortPair 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":"d2layouts/d2talalayout/internal/routing/ovg.go"},"region":{"startLine":1355}}}],"partialFingerprints":{"codehealthFindingId/v1":"3022c9e9ed99821e7e3da4a90f999c86ac64aab6d039ec2a8b13d6f5d9623450"}},{"ruleId":"D1","level":"warning","message":{"text":"ovgEdgeRouter.generateRoutes (cyclomatic 17): ovgEdgeRouter.generateRoutes has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/ovg_edge_router.go"},"region":{"startLine":349}}}],"partialFingerprints":{"codehealthFindingId/v1":"ed590e105c26e1c3b4f527f86ae508822d8ebd891d096368b9f6710c545af60c"}},{"ruleId":"D1","level":"warning","message":{"text":"Route.isEntireColinear (cyclomatic 17): Route.isEntireColinear 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":"d2layouts/d2talalayout/internal/routing/route.go"},"region":{"startLine":34}}}],"partialFingerprints":{"codehealthFindingId/v1":"d1f4ad507346c4af70bfd61743e829d3ea0fe81f3d77d050b024b9f913430021"}},{"ruleId":"D1","level":"warning","message":{"text":"trees.normalizedAspectRatio (cyclomatic 17): trees.normalizedAspectRatio 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":"d2layouts/d2talalayout/internal/trees/layout.go"},"region":{"startLine":701}}}],"partialFingerprints":{"codehealthFindingId/v1":"02362398bb024423f172763186b894314db524c1aa41e90a4244804c1269f919"}},{"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":1417}}}],"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":1035}}}],"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":"d2isometricimg.richSourceSize (cyclomatic 17): d2isometricimg.richSourceSize has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/rich_labels.go"},"region":{"startLine":165}}}],"partialFingerprints":{"codehealthFindingId/v1":"6582e45482868d8e005ea96f03da943fdc3568562c85601696938bd9a1c49b08"}},{"ruleId":"D1","level":"warning","message":{"text":"meshBuilder.node (cyclomatic 17): meshBuilder.node 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":"d2renderers/d2isometric/d2isometricimg/geometry.go"},"region":{"startLine":630}}}],"partialFingerprints":{"codehealthFindingId/v1":"474db62a5247db6367978542122b9dd2a8b1e336b1ac42ce9840c2a5f6a8c832"}},{"ruleId":"D1","level":"warning","message":{"text":"surfaceIconPainter.resolve (cyclomatic 17): surfaceIconPainter.resolve 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":"d2renderers/d2isometric/d2isometricimg/surface_icons.go"},"region":{"startLine":213}}}],"partialFingerprints":{"codehealthFindingId/v1":"33790be04f64d98a1cdaa19b30a64faa8a41e0e9ffe81424db4f49d956158229"}},{"ruleId":"D1","level":"warning","message":{"text":"nativeSurfaceSVGWriter.colorPaint (cyclomatic 17): nativeSurfaceSVGWriter.colorPaint 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, 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":"d2renderers/d2isometric/d2isometricimg/vector_surface_color.go"},"region":{"startLine":26}}}],"partialFingerprints":{"codehealthFindingId/v1":"c82a2de6360b0c19e8476c5f4a93f96c8a7ab252606d0c0118e467a2dbf3ef2c"}},{"ruleId":"D1","level":"warning","message":{"text":"d2raster.sampleShadowAlphaRGBA (cyclomatic 17): d2raster.sampleShadowAlphaRGBA 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. This shape REPEATS in the file: one other method here (d2raster.sampleShadowAlphaImage) has the same decision points, in the same order, at the same nesting depths \u2014 so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared. This is NOT this file\u0027s highest cyclomatic complexity: d2raster.exactIntegerTranslatedBounds (cyclomatic 21) is higher and carries no row of its own \u2014 it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension\u0027s figures nor in its score."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/filter.go"},"region":{"startLine":1131}}}],"partialFingerprints":{"codehealthFindingId/v1":"917d6299c9f9ed58ec9b2c9345157f0bfa5e81f5fe0672d67da2cf9547bcc260"}},{"ruleId":"D1","level":"warning","message":{"text":"d2raster.sampleShadowAlphaImage (cyclomatic 17): d2raster.sampleShadowAlphaImage 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. This shape REPEATS in the file: one other method here (d2raster.sampleShadowAlphaRGBA) has the same decision points, in the same order, at the same nesting depths \u2014 so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared. This is NOT this file\u0027s highest cyclomatic complexity: d2raster.exactIntegerTranslatedBounds (cyclomatic 21) is higher and carries no row of its own \u2014 it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension\u0027s figures nor in its score."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/filter.go"},"region":{"startLine":1163}}}],"partialFingerprints":{"codehealthFindingId/v1":"d6ff0455f40b0691fde7adb11617b808a3f1c016465c7b506029523b7e21c122"}},{"ruleId":"D1","level":"warning","message":{"text":"d2raster.roundedRectSubpaths (cyclomatic 17): d2raster.roundedRectSubpaths has cyclomatic complexity 17 (threshold 15). Of this number, 14 points are the body\u0027s own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/geometry.go"},"region":{"startLine":176}}}],"partialFingerprints":{"codehealthFindingId/v1":"061e89cc16f06334ad69ae8481997b5290d63bfbc062aeacfdf2e1ab98b1d3ed"}},{"ruleId":"D1","level":"warning","message":{"text":"patternCollector.node (cyclomatic 17): patternCollector.node 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":"d2renderers/d2raster/pattern.go"},"region":{"startLine":346}}}],"partialFingerprints":{"codehealthFindingId/v1":"40d5a3c034607ea6f72bdd2ba471c568616a455e695e2f1b89ea1e5858398619"}},{"ruleId":"D1","level":"warning","message":{"text":"preflight.primitive (cyclomatic 17): preflight.primitive 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. This is NOT this file\u0027s highest cyclomatic complexity: d2raster.validateOptions (cyclomatic 23) is higher and carries no row of its own \u2014 it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension\u0027s figures nor in its score."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/raster.go"},"region":{"startLine":1186}}}],"partialFingerprints":{"codehealthFindingId/v1":"e457ad59fafe84c08950016ad2ed0aa3d01b4bb2ccc7a8db7c14a45a926653c1"}},{"ruleId":"D1","level":"warning","message":{"text":"retainedVectorValidator.animations (cyclomatic 17): retainedVectorValidator.animations 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":"d2renderers/d2raster/vector_validation.go"},"region":{"startLine":231}}}],"partialFingerprints":{"codehealthFindingId/v1":"07433afae7f265fb7a8ae9a526b2d24c49809c744adcb1d6291d5fdaf2aeec9f"}},{"ruleId":"D1","level":"warning","message":{"text":"retainedVectorValidator.primitive (cyclomatic 17): retainedVectorValidator.primitive 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 taking that case\u0027s concrete type, so the dispatch reads one line per case. These arms are selected by TYPE rather than by value, so there is no key a lookup table could be built on; where you own the matched types, giving them one shared interface method and calling that is the form a table would have taken, and where you do not, keep the cases \u2014 they stay explicit and reviewable."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/vector_validation.go"},"region":{"startLine":283}}}],"partialFingerprints":{"codehealthFindingId/v1":"773d9681e9c94e84211341e783d722172c3697d0ceae2bf5fa9038c62c266eed"}},{"ruleId":"D1","level":"warning","message":{"text":"retainedVectorValidator.text (cyclomatic 17): retainedVectorValidator.text 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":"d2renderers/d2raster/vector_validation.go"},"region":{"startLine":392}}}],"partialFingerprints":{"codehealthFindingId/v1":"7c24002a75a42b6cd33434640e37cf55801c992979b0512b36f22a0a451ac617"}},{"ruleId":"D1","level":"warning","message":{"text":"Path.transformedGeometryBounds (cyclomatic 17): Path.transformedGeometryBounds 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":"d2renderers/d2scene/path.go"},"region":{"startLine":99}}}],"partialFingerprints":{"codehealthFindingId/v1":"f80b53ff254f2887c8902a7a76eaebb02b5b52f72f1a9c2ae20a9f3e3b543703"}},{"ruleId":"D1","level":"warning","message":{"text":"d2scenebuild.validateShapeEffectIntegerBounds (cyclomatic 17): d2scenebuild.validateShapeEffectIntegerBounds has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/shape_effects.go"},"region":{"startLine":202}}}],"partialFingerprints":{"codehealthFindingId/v1":"acfb4fae204d4eb5dd3d22a393f7a3cae0c325eb85cd7825be0df0eaa244145a"}},{"ruleId":"D1","level":"warning","message":{"text":"d2scenebuild.sketchStreakRoot (cyclomatic 17): d2scenebuild.sketchStreakRoot 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":"d2renderers/d2scenebuild/sketch_shapes.go"},"region":{"startLine":866}}}],"partialFingerprints":{"codehealthFindingId/v1":"7c3a6bccc4cbb406a122183d67d961ed8e8d4faba95df2078e4f375d9f6d5143"}},{"ruleId":"D1","level":"warning","message":{"text":"builder.resolveImageAsset (cyclomatic 17): builder.resolveImageAsset 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":"d2renderers/d2scenebuild/assets.go"},"region":{"startLine":103}}}],"partialFingerprints":{"codehealthFindingId/v1":"b1793225d56c581acd16b66a5e1df9a6242ebe7c56654809c11971e5cd4ff051"}},{"ruleId":"D1","level":"warning","message":{"text":"d2svg.validateRenderPaints (cyclomatic 17): d2svg.validateRenderPaints 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":"d2renderers/d2svg/paint_validation.go"},"region":{"startLine":16}}}],"partialFingerprints":{"codehealthFindingId/v1":"02b7111cf7a33297c0d919871e51d5cdfbcbcd17e69b90e14ef95b2bbde3579e"}},{"ruleId":"D1","level":"warning","message":{"text":"d2svgimport.inspectEmbeddedWebP (cyclomatic 17): d2svgimport.inspectEmbeddedWebP 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":"d2renderers/d2svgimport/image.go"},"region":{"startLine":583}}}],"partialFingerprints":{"codehealthFindingId/v1":"bd5f3d73a7a9a6c3482873a63528057183aa30482c403d8d08b4a29e441b9510"}},{"ruleId":"D1","level":"warning","message":{"text":"svgImporter.ignoredNamespacedAttribute (cyclomatic 17): svgImporter.ignoredNamespacedAttribute 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/d2svgimport/boilerplate.go"},"region":{"startLine":203}}}],"partialFingerprints":{"codehealthFindingId/v1":"7adfcecb9e756c256a8b89d46ce2daf3c93a8345a7b54fc651c2ad09e5c0089d"}},{"ruleId":"D1","level":"warning","message":{"text":"svgImporter.pointCommands (cyclomatic 17): svgImporter.pointCommands 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":"d2renderers/d2svgimport/geometry.go"},"region":{"startLine":195}}}],"partialFingerprints":{"codehealthFindingId/v1":"de659f6c42519b779a4ac067e31fe29a2019d8a9366005444004412119284c35"}},{"ruleId":"D1","level":"warning","message":{"text":"svgImporter.compileEmbeddedImage (cyclomatic 17): svgImporter.compileEmbeddedImage 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":"d2renderers/d2svgimport/image.go"},"region":{"startLine":21}}}],"partialFingerprints":{"codehealthFindingId/v1":"8b300ca30052f568994699c43d58af985057a4756fe42da06f64640bc080dec8"}},{"ruleId":"D1","level":"warning","message":{"text":"transformParser.arguments (cyclomatic 17): transformParser.arguments 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":"d2renderers/d2svgimport/transform.go"},"region":{"startLine":103}}}],"partialFingerprints":{"codehealthFindingId/v1":"f9deb58e13e1ee2e11cba6a676de0b3640a5d6067a2190697e93d51620813f9c"}},{"ruleId":"D1","level":"warning","message":{"text":"BundledFaceSource.SupportsRenderableRune (cyclomatic 17): BundledFaceSource.SupportsRenderableRune 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":"d2renderers/internal/fontface/face.go"},"region":{"startLine":191}}}],"partialFingerprints":{"codehealthFindingId/v1":"0fc087c43524f82ec774974ff0b34f947073ef9c75196bfb8da34fb1fd30cd16"}},{"ruleId":"D1","level":"warning","message":{"text":"Diagram.appendCorpus (cyclomatic 17): Diagram.appendCorpus 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":702}}}],"partialFingerprints":{"codehealthFindingId/v1":"606734c60527719ebebcb06bef85c7228372093a1b90680813147944d530b6cb"}},{"ruleId":"D1","level":"warning","message":{"text":"rasterimage.Config (cyclomatic 17): rasterimage.Config 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":"internal/rasterimage/firstframe.go"},"region":{"startLine":28}}}],"partialFingerprints":{"codehealthFindingId/v1":"4fa8bb7599dbef2b3d0a125f440c1085bc755b058e198cdf5c3eb4b02edf7198"}},{"ruleId":"D1","level":"warning","message":{"text":"rasterimage.parseEXIFOrientation (cyclomatic 17): rasterimage.parseEXIFOrientation 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":"internal/rasterimage/jpeg_orientation.go"},"region":{"startLine":69}}}],"partialFingerprints":{"codehealthFindingId/v1":"02298232e0b9c70f27cf6ba12cb55eda36725c84a620a7ef87dfd44108659fde"}},{"ruleId":"D1","level":"warning","message":{"text":"testutil.InspectGIF (cyclomatic 17): testutil.InspectGIF 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":"internal/testutil/gif.go"},"region":{"startLine":88}}}],"partialFingerprints":{"codehealthFindingId/v1":"0f6664641ab95fc1646df859e0cba338e246c6d97473662192d00ffbe6119452"}},{"ruleId":"D1","level":"warning","message":{"text":"imageasset.uriScheme (cyclomatic 17): imageasset.uriScheme 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":"lib/imageasset/resolve.go"},"region":{"startLine":317}}}],"partialFingerprints":{"codehealthFindingId/v1":"ede1003d4666217701a15e52d7df3afaf9252175ab20cd739f2ed8871d2b1e29"}},{"ruleId":"D1","level":"warning","message":{"text":"textmeasure.normalizeMarkdownWhitespaceTree (cyclomatic 17): textmeasure.normalizeMarkdownWhitespaceTree has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 2 of the 17 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 266, 300, 257, \u2026). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals\u0027 work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/textmeasure/markdown.go"},"region":{"startLine":241}}}],"partialFingerprints":{"codehealthFindingId/v1":"d886deb84871559883e5341bae91f604efb86ee16df3f34e853964d2108c9343"}},{"ruleId":"D1","level":"warning","message":{"text":"markdownPainter.collectInlineTokens (cyclomatic 17): markdownPainter.collectInlineTokens 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/textmeasure/markdown_svg.go"},"region":{"startLine":1312}}}],"partialFingerprints":{"codehealthFindingId/v1":"7fba17f5a1750e9c6807111c602382e6df76e10ca882b9d0b7bb550480e47f9e"}},{"ruleId":"D1","level":"warning","message":{"text":"Ruler.scaleUnicodeFallback (cyclomatic 17): Ruler.scaleUnicodeFallback 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/textmeasure/textmeasure.go"},"region":{"startLine":322}}}],"partialFingerprints":{"codehealthFindingId/v1":"c3532bdd58a3039c78a3a29bf634d0242960efccd55f7d103a3d2386ed4b0c69"}},{"ruleId":"D1","level":"warning","message":{"text":"xgif.AnimateCenteredOpaquePalettedImagesWithLimit (cyclomatic 17): xgif.AnimateCenteredOpaquePalettedImagesWithLimit 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":"lib/xgif/encode.go"},"region":{"startLine":38}}}],"partialFingerprints":{"codehealthFindingId/v1":"39954a24833c074706aa7116d1db32d0446d1b371e2fcbd5141a75981baf8f78"}},{"ruleId":"D1","level":"warning","message":{"text":"paletteTree.nearest (cyclomatic 17): paletteTree.nearest 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":"lib/xgif/xgif.go"},"region":{"startLine":722}}}],"partialFingerprints":{"codehealthFindingId/v1":"ac042d243b9067d89791d0e4e7e08e95f98482aa2877c1fd8fb6173c57e07abb"}},{"ruleId":"D1","level":"warning","message":{"text":"d2cli.planBoardOutput (cyclomatic 16): d2cli.planBoardOutput 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":"d2cli/board_output.go"},"region":{"startLine":160}}}],"partialFingerprints":{"codehealthFindingId/v1":"57b009c26a8792df241845801c5a4c23446f04ea323b694599693b94b7a5828c"}},{"ruleId":"D1","level":"warning","message":{"text":"d2cli.indexPagedBoards (cyclomatic 16): d2cli.indexPagedBoards has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 4 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 355). 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":"d2cli/paged.go"},"region":{"startLine":344}}}],"partialFingerprints":{"codehealthFindingId/v1":"967ec9ae148064e4d411afd3735670b42cd0811864ab260bd17d20dadf1ca76d"}},{"ruleId":"D1","level":"warning","message":{"text":"boardOutputWorkspace.preflightMerge (cyclomatic 16): boardOutputWorkspace.preflightMerge has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 435). 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":"d2cli/board_output.go"},"region":{"startLine":433}}}],"partialFingerprints":{"codehealthFindingId/v1":"5682f77dcf3c80abc9bacaaed6400c5f62848754d0528dfee2e1251ba7c14ec0"}},{"ruleId":"D1","level":"warning","message":{"text":"rasterPNGBandEncoder.append (cyclomatic 16): rasterPNGBandEncoder.append 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":"d2cli/raster_png_encoder.go"},"region":{"startLine":321}}}],"partialFingerprints":{"codehealthFindingId/v1":"b57e460b7265b3ba322b359bedcccc6fa3eeba5e8a5f0c65ca77a2b5aefe81df"}},{"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":659}}}],"partialFingerprints":{"codehealthFindingId/v1":"d63c01320ed0a6b3b83647498001a88afa041a87e794f5c034da464ed3fa6a07"}},{"ruleId":"D1","level":"warning","message":{"text":"Object.FindEdges (cyclomatic 16): Object.FindEdges 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":816}}}],"partialFingerprints":{"codehealthFindingId/v1":"c7c7f48afbf05cd0f0c8571764a393f50ff87757ef1c47d373e1253b94f60460"}},{"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":1608}}}],"partialFingerprints":{"codehealthFindingId/v1":"6dd24ea8db5d8e35dffd36dfdd29a05ad1b8cba3e54ae71e136fa8ca03427869"}},{"ruleId":"D1","level":"warning","message":{"text":"d2ir.canSelectImportNode (cyclomatic 16): d2ir.canSelectImportNode 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/import_cache.go"},"region":{"startLine":407}}}],"partialFingerprints":{"codehealthFindingId/v1":"efd55cdf8e1a72cd06a73112005047cb0aa13e8ba4efdcf146f9048d70113e23"}},{"ruleId":"D1","level":"warning","message":{"text":"Map.ensureFieldMode (cyclomatic 16): Map.ensureFieldMode 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":1179}}}],"partialFingerprints":{"codehealthFindingId/v1":"445db4a05f87fed136422c740eb21bf27effdba7172735eb49d06f1d107b51eb"}},{"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":974}}}],"partialFingerprints":{"codehealthFindingId/v1":"27af38c626a0999cfbed899df770a6eedc146f75ebcceded39377868877329c9"}},{"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":577}}}],"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":1153}}}],"partialFingerprints":{"codehealthFindingId/v1":"0dbac16b026e8646c16a8c3c561fcb87aafae3684a93274843775f5bb88ef019"}},{"ruleId":"D1","level":"warning","message":{"text":"d2talalayout.validateCompletedGraph (cyclomatic 16): d2talalayout.validateCompletedGraph 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/d2talalayout/result_validate.go"},"region":{"startLine":421}}}],"partialFingerprints":{"codehealthFindingId/v1":"e31ec42867cb03b195130dd1049d5b2c8008f91ad6607ca7879b2595fad0d3f3"}},{"ruleId":"D1","level":"warning","message":{"text":"d2talalayout.validateResultEdge (cyclomatic 16): d2talalayout.validateResultEdge 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/d2talalayout/result_validate.go"},"region":{"startLine":510}}}],"partialFingerprints":{"codehealthFindingId/v1":"15199f21e7cafcf59a75eacf9793e862ecd75bc092751d27e2ee6d55d114ee72"}},{"ruleId":"D1","level":"warning","message":{"text":"grouping.hasNodeID (cyclomatic 16): grouping.hasNodeID has cyclomatic complexity 16 (threshold 15). Of this number, 13 points are the body\u0027s own statements and 3 belong to 2 function literals inside it that branch. To reduce it, separate the 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":"d2layouts/d2talalayout/internal/grouping/sequences.go"},"region":{"startLine":464}}}],"partialFingerprints":{"codehealthFindingId/v1":"f617c31ac7d60e83ec19251539253cb88566e29c3558eee688d0546e8eed018e"}},{"ruleId":"D1","level":"warning","message":{"text":"hierarchy.orderCompoundInterfaces (cyclomatic 16): hierarchy.orderCompoundInterfaces has cyclomatic complexity 16 (threshold 15). Of this number, 13 points are the body\u0027s own statements and 3 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/hierarchy/compound.go"},"region":{"startLine":240}}}],"partialFingerprints":{"codehealthFindingId/v1":"8451951ac925fd557db8da44cb8a46dc1eb5323621a64db2970057f77427e673"}},{"ruleId":"D1","level":"warning","message":{"text":"Edge.stylesMatchOneWay (cyclomatic 16): Edge.stylesMatchOneWay 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/d2talalayout/internal/layoutgraph/edge.go"},"region":{"startLine":51}}}],"partialFingerprints":{"codehealthFindingId/v1":"b65503524250d481877a433b041c2829ceb437d4e5477d596ab047e11bff7287"}},{"ruleId":"D1","level":"warning","message":{"text":"Graph.buildNodeToTreeGuarded (cyclomatic 16): Graph.buildNodeToTreeGuarded 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/d2talalayout/internal/layoutgraph/tree_access.go"},"region":{"startLine":48}}}],"partialFingerprints":{"codehealthFindingId/v1":"27ac4c8a549749564a223f69358ca63079f8a8bc56ca09d2fb2ecfd73c34559f"}},{"ruleId":"D1","level":"warning","message":{"text":"Node.isVisibilityGraphCandidate (cyclomatic 16): Node.isVisibilityGraphCandidate 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/d2talalayout/internal/layoutgraph/node.go"},"region":{"startLine":1359}}}],"partialFingerprints":{"codehealthFindingId/v1":"da187761b8f8a91c1dfd2c0d68131ef99c80aa9be40b462d62405387597b5759"}},{"ruleId":"D1","level":"warning","message":{"text":"packing.binPackPositionContainerChildren (cyclomatic 16): packing.binPackPositionContainerChildren 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/d2talalayout/internal/packing/guard.go"},"region":{"startLine":274}}}],"partialFingerprints":{"codehealthFindingId/v1":"57514729fefb70bb9b1b66286e26880c604dc1a099bb69c902389fcfb97f4915"}},{"ruleId":"D1","level":"warning","message":{"text":"placement.optimizerMoveNodeAbs (cyclomatic 16): placement.optimizerMoveNodeAbs has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/optimization_guard.go"},"region":{"startLine":684}}}],"partialFingerprints":{"codehealthFindingId/v1":"95f41c51165d8cc689010f5df5e119dd1d8f39f98344e9b2fcc296145ef27e77"}},{"ruleId":"D1","level":"warning","message":{"text":"placementcost.GraphEdgeCrossings (cyclomatic 16): placementcost.GraphEdgeCrossings 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/d2talalayout/internal/placementcost/graph.go"},"region":{"startLine":301}}}],"partialFingerprints":{"codehealthFindingId/v1":"6751ade5cfed6cbb92fef78fdca9ec3d3df020e3cf4f382ba6da423d0bbc4e66"}},{"ruleId":"D1","level":"warning","message":{"text":"quality.sortSharedSegments (cyclomatic 16): quality.sortSharedSegments has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/quality/labels.go"},"region":{"startLine":512}}}],"partialFingerprints":{"codehealthFindingId/v1":"adedbbb64f3c98c8a88e87280bd89c6395737ae754bf765cf32ee9156ff88553"}},{"ruleId":"D1","level":"warning","message":{"text":"quality.evaluateWithAreaLimit (cyclomatic 16): quality.evaluateWithAreaLimit 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/d2talalayout/internal/quality/scoring.go"},"region":{"startLine":21}}}],"partialFingerprints":{"codehealthFindingId/v1":"df152686bd5d50a32be4590faaf084d86fd455904eeaf448b8945245ded44ace"}},{"ruleId":"D1","level":"warning","message":{"text":"routing.crosshatchWithWorkLimit (cyclomatic 16): routing.crosshatchWithWorkLimit has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to one function literal inside it that branches (line 1827). 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/d2talalayout/internal/routing/coordinator.go"},"region":{"startLine":1826}}}],"partialFingerprints":{"codehealthFindingId/v1":"f6ba78d71cb0ada232051154c25dd51468967b170ec4d6be2828d47875ae36c9"}},{"ruleId":"D1","level":"warning","message":{"text":"routing.shortcutLabelBoxes (cyclomatic 16): routing.shortcutLabelBoxes 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/d2talalayout/internal/routing/shortcut_routes.go"},"region":{"startLine":518}}}],"partialFingerprints":{"codehealthFindingId/v1":"8c382276ce8e99efc17bccef5b71a7cf7b6c2cdc6bd6153e18d1d74cf930e1d4"}},{"ruleId":"D1","level":"warning","message":{"text":"routing.preferLaunchingVertically (cyclomatic 16): routing.preferLaunchingVertically 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/d2talalayout/internal/routing/slingshot.go"},"region":{"startLine":340}}}],"partialFingerprints":{"codehealthFindingId/v1":"05dc242f0f6671763440568a47867247aff9a2a71cbce20cc18eb3356b15073e"}},{"ruleId":"D1","level":"warning","message":{"text":"trees.dominantTreeEdgeDirection (cyclomatic 16): trees.dominantTreeEdgeDirection 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/d2talalayout/internal/trees/preprocess_helpers.go"},"region":{"startLine":158}}}],"partialFingerprints":{"codehealthFindingId/v1":"db8cacd6b3a4edee0a29bd48d409830065cc0ce1ce356f074181d90d5c3b1973"}},{"ruleId":"D1","level":"warning","message":{"text":"trees.buildNodeToTreeGuarded (cyclomatic 16): trees.buildNodeToTreeGuarded 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/d2talalayout/internal/trees/preprocess_helpers.go"},"region":{"startLine":651}}}],"partialFingerprints":{"codehealthFindingId/v1":"33d9277bb7bb5021c891a38c462674593002207886369383f821330f55952e2e"}},{"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.parseArray (cyclomatic 16): parser.parseArray 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":"d2parser/parse.go"},"region":{"startLine":1603}}}],"partialFingerprints":{"codehealthFindingId/v1":"ecd4b253e4081d78a8baec71295b330b0e14c1bd4d60759a6612d88b518ea225"}},{"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":1728}}}],"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":"d2fonts.readBoundedFontFile (cyclomatic 16): d2fonts.readBoundedFontFile 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":"d2renderers/d2fonts/fallback.go"},"region":{"startLine":549}}}],"partialFingerprints":{"codehealthFindingId/v1":"cfee3e2615f792d40d3ae8f2972b7348137931057e9119cd67c5f73a58a91011"}},{"ruleId":"D1","level":"warning","message":{"text":"d2fonts.fallbackPathPriority (cyclomatic 16): d2fonts.fallbackPathPriority has cyclomatic complexity 16 (threshold 15). Of this number, 14 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2fonts/fallback.go"},"region":{"startLine":725}}}],"partialFingerprints":{"codehealthFindingId/v1":"0f9eaca4ffe5f5ae3e1bcc4e061c499949830faec0898174cc45f22efd4e5dae"}},{"ruleId":"D1","level":"warning","message":{"text":"d2isometricimg.sceneOutputDensity (cyclomatic 16): d2isometricimg.sceneOutputDensity has cyclomatic complexity 16 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/framing.go"},"region":{"startLine":208}}}],"partialFingerprints":{"codehealthFindingId/v1":"08b8163bd5574ab276c16bd298629c32de4832c34a1541af17c5338a81ce2469"}},{"ruleId":"D1","level":"warning","message":{"text":"d2isometricimg.renderGIF (cyclomatic 16): d2isometricimg.renderGIF 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/d2isometric/d2isometricimg/gif.go"},"region":{"startLine":20}}}],"partialFingerprints":{"codehealthFindingId/v1":"0d1cb3d48dbc210e8a03e08891308aab2c5d7137e34d42f0bdac8d6558b4e0ca"}},{"ruleId":"D1","level":"warning","message":{"text":"d2isometricimg.CaptureFrames (cyclomatic 16): d2isometricimg.CaptureFrames 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/d2isometric/d2isometricimg/render.go"},"region":{"startLine":117}}}],"partialFingerprints":{"codehealthFindingId/v1":"4e8ea10c6d399f23b136577a7582e0309d332e2bb2b172854927ec61fbd34ec5"}},{"ruleId":"D1","level":"warning","message":{"text":"d2isometricimg.rasterNativeSurfaceDocument (cyclomatic 16): d2isometricimg.rasterNativeSurfaceDocument has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/surface_document.go"},"region":{"startLine":108}}}],"partialFingerprints":{"codehealthFindingId/v1":"7a89eebd094ffd060c6993297d4912189efe7615553d93bed547fd97be6aebd7"}},{"ruleId":"D1","level":"warning","message":{"text":"d2isometricimg.svgPolygonPath (cyclomatic 16): d2isometricimg.svgPolygonPath 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/d2isometric/d2isometricimg/svg.go"},"region":{"startLine":119}}}],"partialFingerprints":{"codehealthFindingId/v1":"126c0e6536f0b22e425f5ddffc8f37bfc0df7913bf55a964eb8ab3b127979526"}},{"ruleId":"D1","level":"warning","message":{"text":"d2isometricimg.svgOrderComponents (cyclomatic 16): d2isometricimg.svgOrderComponents 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/d2isometric/d2isometricimg/svg_order.go"},"region":{"startLine":394}}}],"partialFingerprints":{"codehealthFindingId/v1":"3163230cc13db022b2504a99e13c88ee827e01d8525c1c661f2086bc6984a4f2"}},{"ruleId":"D1","level":"warning","message":{"text":"meshBuilder.prepareGradientMaterials (cyclomatic 16): meshBuilder.prepareGradientMaterials 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/d2isometric/d2isometricimg/gradient_paints.go"},"region":{"startLine":58}}}],"partialFingerprints":{"codehealthFindingId/v1":"bdaf55158858eb369765b7defd47a5582104cd4cfb88ec8881a2b057f2c28c72"}},{"ruleId":"D1","level":"warning","message":{"text":"d2raster.drawDirectPatternCoverage (cyclomatic 16): d2raster.drawDirectPatternCoverage has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 738, 728). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals\u0027 work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/gradient.go"},"region":{"startLine":723}}}],"partialFingerprints":{"codehealthFindingId/v1":"811112c4683aa4b79592e53c9387af9a9bab45b470cce289eec84e697c0e5108"}},{"ruleId":"D1","level":"warning","message":{"text":"d2raster.renderNode (cyclomatic 16): d2raster.renderNode has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This is NOT this file\u0027s highest cyclomatic complexity: d2raster.validateOptions (cyclomatic 23) is higher and carries no row of its own \u2014 it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension\u0027s figures nor in its score."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/raster.go"},"region":{"startLine":1536}}}],"partialFingerprints":{"codehealthFindingId/v1":"8a4141a7a95127332de70e7257b700e2a5eb30c3f9104d0338625b5d6230f4ae"}},{"ruleId":"D1","level":"warning","message":{"text":"d2raster.drawPrimitive (cyclomatic 16): d2raster.drawPrimitive has cyclomatic complexity 16 (threshold 15). Of this number, 14 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file\u0027s highest cyclomatic complexity: d2raster.validateOptions (cyclomatic 23) is higher and carries no row of its own \u2014 it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension\u0027s figures nor in its score."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/raster.go"},"region":{"startLine":1559}}}],"partialFingerprints":{"codehealthFindingId/v1":"f1a490ff035311ce4f1bcc038f16a0ca6c82b3f926cd8efea2be286533f5f5f4"}},{"ruleId":"D1","level":"warning","message":{"text":"preflight.vectorImage (cyclomatic 16): preflight.vectorImage 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. This is NOT this file\u0027s highest cyclomatic complexity: d2raster.nativeRasterImageOrigin (cyclomatic 19) is higher and carries no row of its own \u2014 it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension\u0027s figures nor in its score."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/image.go"},"region":{"startLine":266}}}],"partialFingerprints":{"codehealthFindingId/v1":"f89d86fc888e5489c2ac4e64613badaca343cd034dfcc0eb86cc634dd646604b"}},{"ruleId":"D1","level":"warning","message":{"text":"RenderSession.memoizedCacheKeyWithDigest (cyclomatic 16): RenderSession.memoizedCacheKeyWithDigest 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/d2raster/session.go"},"region":{"startLine":202}}}],"partialFingerprints":{"codehealthFindingId/v1":"460586ba9a8fdc4d9f6567249db98e9ca5aca45430b0ad47fc3b6db9e2f6dd88"}},{"ruleId":"D1","level":"warning","message":{"text":"retainedVectorValidator.image (cyclomatic 16): retainedVectorValidator.image 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/d2raster/vector_validation.go"},"region":{"startLine":479}}}],"partialFingerprints":{"codehealthFindingId/v1":"370e85dce64fefd6e76339e631868a46b193dcae6e36ada8013156e4f306f16b"}},{"ruleId":"D1","level":"warning","message":{"text":"retainedVectorValidator.gradientCommon (cyclomatic 16): retainedVectorValidator.gradientCommon 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/d2raster/vector_validation.go"},"region":{"startLine":716}}}],"partialFingerprints":{"codehealthFindingId/v1":"8fbd751797b4444f19b1c19dd7a37bb923de99fd6182b06830edfa664f15d353"}},{"ruleId":"D1","level":"warning","message":{"text":"d2scenebuild.validateConnectionNumbers (cyclomatic 16): d2scenebuild.validateConnectionNumbers 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":"d2renderers/d2scenebuild/build.go"},"region":{"startLine":1162}}}],"partialFingerprints":{"codehealthFindingId/v1":"ee3ac40aeee4e302313aa757e2dcd6d1c2378ecb0d770c79399dccb4adb2228e"}},{"ruleId":"D1","level":"warning","message":{"text":"builder.buildCodeTextRuns (cyclomatic 16): builder.buildCodeTextRuns 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/d2scenebuild/code_shape.go"},"region":{"startLine":115}}}],"partialFingerprints":{"codehealthFindingId/v1":"89bbe2e2cc7bac69da6df3e5a15b6f6337376f9864f71a212e5524ac8ff27b41"}},{"ruleId":"D1","level":"warning","message":{"text":"builder.addLinkRegion (cyclomatic 16): builder.addLinkRegion has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/metadata.go"},"region":{"startLine":202}}}],"partialFingerprints":{"codehealthFindingId/v1":"c044220a86f21ee907889b0899dcf2adb4eacce573091f9b8b95c0c136a37e17"}},{"ruleId":"D1","level":"warning","message":{"text":"builder.buildClassContents (cyclomatic 16): builder.buildClassContents 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/d2scenebuild/special_shapes.go"},"region":{"startLine":69}}}],"partialFingerprints":{"codehealthFindingId/v1":"947b2fd50783e8d05051d1804bac95c1a24dfd2bd87a6a71fb4b7879cef226b7"}},{"ruleId":"D1","level":"warning","message":{"text":"builder.buildSQLTableContents (cyclomatic 16): builder.buildSQLTableContents 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/d2scenebuild/special_shapes.go"},"region":{"startLine":184}}}],"partialFingerprints":{"codehealthFindingId/v1":"bc2500509423bb9c98fd82b0e72fb90449f8713ffb67cdaeecffb7aa2b16c084"}},{"ruleId":"D1","level":"warning","message":{"text":"svgImporter.elementName (cyclomatic 16): svgImporter.elementName 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/d2svgimport/import.go"},"region":{"startLine":731}}}],"partialFingerprints":{"codehealthFindingId/v1":"24ffe0dc1ba9294ac28899d002cae76a82aa136ce1fb9be290dca522434bfcfd"}},{"ruleId":"D1","level":"warning","message":{"text":"svgImporter.simpleClassSelector (cyclomatic 16): svgImporter.simpleClassSelector 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/d2svgimport/stylesheet.go"},"region":{"startLine":153}}}],"partialFingerprints":{"codehealthFindingId/v1":"670095e64fd90f50db3c383aabf645c607695bb3e0bf11c37db7b70a898bfc14"}},{"ruleId":"D1","level":"warning","message":{"text":"pathParser.parse (cyclomatic 16): pathParser.parse 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. This is NOT this file\u0027s highest cyclomatic complexity: pathParser.append (cyclomatic 19) is higher and carries no row of its own \u2014 it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension\u0027s figures nor in its score."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svgimport/path.go"},"region":{"startLine":80}}}],"partialFingerprints":{"codehealthFindingId/v1":"2d67580b66d7f8245794b5984c3701b80629dce8caf14416fe6c0c2121b2060a"}},{"ruleId":"D1","level":"warning","message":{"text":"clusterFaceResolver.supports (cyclomatic 16): clusterFaceResolver.supports 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/internal/fontface/shaping.go"},"region":{"startLine":445}}}],"partialFingerprints":{"codehealthFindingId/v1":"0cb86e091577d27653eab2e6486b5ac6c41a4498e9ca6b0f0c408c97eea0a83e"}},{"ruleId":"D1","level":"warning","message":{"text":"d2target.validateRenderConnectionNumbers (cyclomatic 16): d2target.validateRenderConnectionNumbers 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":"d2target/render_validation.go"},"region":{"startLine":308}}}],"partialFingerprints":{"codehealthFindingId/v1":"8d17dcc9a1dcac745b7c19461025c27d809c49a2aa9b1f4576354c2d7f15f7ac"}},{"ruleId":"D1","level":"warning","message":{"text":"Resolver.Resolve (cyclomatic 16): Resolver.Resolve 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/imageasset/resolve.go"},"region":{"startLine":72}}}],"partialFingerprints":{"codehealthFindingId/v1":"40a128812a0bfaeb8c0828d6d028ace8dda5b3c07fb1ad8baf58f4d940bd0230"}},{"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":71}}}],"partialFingerprints":{"codehealthFindingId/v1":"12b71638672fd96fc8787a70fbcaac96bb72ca8756fd02fabf458d040b845435"}},{"ruleId":"D1","level":"warning","message":{"text":"Presentation.writeTo (cyclomatic 16): Presentation.writeTo 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/pptx/pptx.go"},"region":{"startLine":203}}}],"partialFingerprints":{"codehealthFindingId/v1":"cae6bfdb7bfc9adb99f6cf18d84b2e41095db78c8c2d56ec8164a702523428d0"}},{"ruleId":"D1","level":"warning","message":{"text":"svg.ParseAttributes (cyclomatic 16): svg.ParseAttributes 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/svg/markup.go"},"region":{"startLine":81}}}],"partialFingerprints":{"codehealthFindingId/v1":"f911b06ba6f6f0f1d2fd97f5cdf7c602d08fd17e1f775f0704c1994ee52bb820"}},{"ruleId":"D1","level":"warning","message":{"text":"textmeasure.collectMarkdownTableRows (cyclomatic 16): textmeasure.collectMarkdownTableRows has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 1753, 1740). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals\u0027 work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/textmeasure/markdown_svg.go"},"region":{"startLine":1738}}}],"partialFingerprints":{"codehealthFindingId/v1":"fa4db15693de1803291827a5aac4db7632abe9ba321e4e1046f776c10447b39b"}},{"ruleId":"D1","level":"warning","message":{"text":"textmeasure.markdownListMarker (cyclomatic 16): textmeasure.markdownListMarker 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/textmeasure/markdown_svg.go"},"region":{"startLine":1780}}}],"partialFingerprints":{"codehealthFindingId/v1":"b892badad2120f4283909f70b9098b41d67b70a34c51f65201d367f972738e57"}},{"ruleId":"D1","level":"warning","message":{"text":"paletteTree.nearestRGBA (cyclomatic 16): paletteTree.nearestRGBA 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/xgif/xgif.go"},"region":{"startLine":796}}}],"partialFingerprints":{"codehealthFindingId/v1":"d8766fcbf2cdb46cf2670a6f67ec6e70e2e4532269dda8c1c4df7147d36dd46c"}},{"ruleId":"D2","level":"warning","message":{"text":"placementcost.evaluateNodeEdgeLength (cognitive 819): placementcost.evaluateNodeEdgeLength has cognitive complexity 819 (threshold 15). Drivers by points: if/else 152 (547 pts), match/switch 40 (205 pts), boolean chains 48, loops 7 (19 pts) (nesting depth added 572). Of this number, 547 points are the body\u0027s own statements and 272 belong to 4 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placementcost/edge_length.go"},"region":{"startLine":345}}}],"partialFingerprints":{"codehealthFindingId/v1":"ef256701de99e4bcb62a2c847ead5f4aa1b81a1df0c29fbe8d33c36411046d7c"}},{"ruleId":"D2","level":"warning","message":{"text":"packing.packGuarded (cognitive 718): packing.packGuarded has cognitive complexity 718 (threshold 15). Drivers by points: if/else 189 (563 pts), loops 56 (146 pts), boolean chains 6, match/switch 1 (3 pts) (nesting depth added 466). Of this number, 670 points are the body\u0027s own statements and 48 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/d2talalayout/internal/packing/binpack.go"},"region":{"startLine":65}}}],"partialFingerprints":{"codehealthFindingId/v1":"8248b0eb90891231fa1b3217110acdff2c521ce39b0e0c628df4cff6846abca5"}},{"ruleId":"D2","level":"warning","message":{"text":"ovgEdgeRouter.search (cognitive 683): ovgEdgeRouter.search has cognitive complexity 683 (threshold 15). Drivers by points: if/else 167 (576 pts), loops 18 (52 pts), boolean chains 37, match/switch 4 (18 pts) (nesting depth added 457). Of this number, 657 points are the body\u0027s own statements and 26 belong to 2 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/ovg_edge_router.go"},"region":{"startLine":558}}}],"partialFingerprints":{"codehealthFindingId/v1":"4613f256f82fd17a2f76d58367d899090fd14b0f16a3eaf5268c82a5b5017843"}},{"ruleId":"D2","level":"warning","message":{"text":"layoutgraph.validateEngineGraph (cognitive 462): layoutgraph.validateEngineGraph has cognitive complexity 462 (threshold 15). Drivers by points: if/else 146 (349 pts), loops 47 (97 pts), boolean chains 8, match/switch 3 (8 pts) (nesting depth added 258). Of this number, 408 points are the body\u0027s own statements and 54 belong to 11 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/d2talalayout/internal/layoutgraph/topology_preflight.go"},"region":{"startLine":510}}}],"partialFingerprints":{"codehealthFindingId/v1":"0800f1506383438e1de5156eb88dac43a0c6b2bb41739009e8ab3d36b2dfdfb6"}},{"ruleId":"D2","level":"warning","message":{"text":"d2oracle._set (cognitive 455): d2oracle._set has cognitive complexity 455 (threshold 15). Drivers by points: if/else 110 (387 pts), loops 8 (26 pts), boolean chains 25, match/switch 4 (17 pts) (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, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2oracle/edit.go"},"region":{"startLine":327}}}],"partialFingerprints":{"codehealthFindingId/v1":"820ced844b6185ccf91e206e2b6fe92f6cbdc237834604fb53e56947fe8557ba"}},{"ruleId":"D2","level":"warning","message":{"text":"placement.Dejitter (cognitive 421): placement.Dejitter has cognitive complexity 421 (threshold 15). Drivers by points: if/else 108 (352 pts), boolean chains 36, loops 11 (33 pts) (nesting depth added 266). Of this number, 389 points are the body\u0027s own statements and 32 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":"d2layouts/d2talalayout/internal/placement/dejitter.go"},"region":{"startLine":16}}}],"partialFingerprints":{"codehealthFindingId/v1":"cb7008caa47f8f0664a64f48b34ed91b5ef7bf7b5b47147f3a0702529344d83a"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.balanceRegularEdgesGuarded (cognitive 384): routing.balanceRegularEdgesGuarded has cognitive complexity 384 (threshold 15). Drivers by points: if/else 80 (307 pts), loops 22 (64 pts), boolean chains 13 (nesting depth added 269). Of this number, 357 points are the body\u0027s own statements and 27 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/d2talalayout/internal/routing/postprocess.go"},"region":{"startLine":70}}}],"partialFingerprints":{"codehealthFindingId/v1":"998c668abbfd16d58310cd3d4d77d5b86f2e60db6e2328f9f13a37dc0db549a4"}},{"ruleId":"D2","level":"warning","message":{"text":"placement.reduceGapToNeighbors (cognitive 369): placement.reduceGapToNeighbors has cognitive complexity 369 (threshold 15). Drivers by points: if/else 108 (347 pts), loops 8 (16 pts), boolean chains 6 (nesting depth added 247). Of this number, 316 points are the body\u0027s own statements and 53 belong to 3 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/gapreduction.go"},"region":{"startLine":273}}}],"partialFingerprints":{"codehealthFindingId/v1":"7ef4b127a1747da29b9738e0199e9ff87c470c69f2a6fde12c25c90304ad4995"}},{"ruleId":"D2","level":"warning","message":{"text":"d2oracle.move (cognitive 356): d2oracle.move has cognitive complexity 356 (threshold 15). Drivers by points: if/else 95 (297 pts), loops 14 (42 pts), boolean chains 17 (nesting depth added 230). To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2oracle/edit.go"},"region":{"startLine":1765}}}],"partialFingerprints":{"codehealthFindingId/v1":"4ecc4f498b8bf3dda0b00d2ac241ddb880f5f36ea078b296edf5dd3373584c61"}},{"ruleId":"D2","level":"warning","message":{"text":"d2dagrelayout.shiftReachableDownIndexed (cognitive 279): d2dagrelayout.shiftReachableDownIndexed has cognitive complexity 279 (threshold 15). Drivers by points: if/else 70 (214 pts), loops 17 (47 pts), 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, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2dagrelayout/layout.go"},"region":{"startLine":810}}}],"partialFingerprints":{"codehealthFindingId/v1":"e480c5348121de3c933f5d6fe6d1a94b8a8927292f8ebfe50338f08c43eea3f9"}},{"ruleId":"D2","level":"warning","message":{"text":"Ruler.measureMarkdownNode (cognitive 279): Ruler.measureMarkdownNode has cognitive complexity 279 (threshold 15). Drivers by points: if/else 78 (220 pts), loops 9 (29 pts), boolean chains 22, match/switch 4 (8 pts) (nesting depth added 166). Of this number, 270 points are the body\u0027s own statements and 9 belong to one function literal inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/textmeasure/markdown.go"},"region":{"startLine":330}}}],"partialFingerprints":{"codehealthFindingId/v1":"216c0c1c33e88c497fadd7c028a68ba78a9f0d11ed52a057990bcaa3f3d3f888"}},{"ruleId":"D2","level":"warning","message":{"text":"ovgEdgeRouter.findLShapedRoute (cognitive 277): ovgEdgeRouter.findLShapedRoute has cognitive complexity 277 (threshold 15). Drivers by points: if/else 47 (230 pts), loops 10 (40 pts), boolean chains 7 (nesting depth added 213). To reduce it, split the body into named stages: move each independent step or branch into 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/d2talalayout/internal/routing/slingshot.go"},"region":{"startLine":666}}}],"partialFingerprints":{"codehealthFindingId/v1":"d18010ca8595e6b73c938e014c56b7db9a16e7576fb849e4bdc669a71819df47"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.fixClusterEdgeBranchingGuarded (cognitive 270): routing.fixClusterEdgeBranchingGuarded has cognitive complexity 270 (threshold 15). Drivers by points: if/else 61 (238 pts), loops 10 (29 pts), boolean chains 2, jumps 1 (nesting depth added 196). To reduce it, split the body into named stages: move each independent step or branch into 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/d2talalayout/internal/routing/postprocess.go"},"region":{"startLine":472}}}],"partialFingerprints":{"codehealthFindingId/v1":"d3eca3330a3b58a11fd693755b18ca8560e46f4324ed0cb32644da9925561fb6"}},{"ruleId":"D2","level":"warning","message":{"text":"ovgEdgeRouter.findSShapedRoute (cognitive 264): ovgEdgeRouter.findSShapedRoute has cognitive complexity 264 (threshold 15). Drivers by points: if/else 56 (218 pts), loops 13 (39 pts), boolean chains 5, match/switch 1 (2 pts) (nesting depth added 189). Of this number, 259 points are the body\u0027s own statements and 5 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/slingshot.go"},"region":{"startLine":891}}}],"partialFingerprints":{"codehealthFindingId/v1":"63799f7f35f9f0f77f1d700289c2d7eca35b1e085ee321c4ab12b1e1dda555af"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.routeLineChecked (cognitive 257): routing.routeLineChecked has cognitive complexity 257 (threshold 15). Drivers by points: if/else 86 (237 pts), loops 10 (16 pts), boolean chains 4 (nesting depth added 157). Of this number, 252 points are the body\u0027s own statements and 5 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/coordinator.go"},"region":{"startLine":844}}}],"partialFingerprints":{"codehealthFindingId/v1":"46304ac5f50bbc33ee0f944b5840836614e442cb3e77081410f089220f5c1060"}},{"ruleId":"D2","level":"warning","message":{"text":"d2talalayout.translateGraph (cognitive 251): d2talalayout.translateGraph has cognitive complexity 251 (threshold 15). Drivers by points: if/else 87 (216 pts), boolean chains 19, loops 8 (16 pts) (nesting depth added 137). To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/adapter.go"},"region":{"startLine":116}}}],"partialFingerprints":{"codehealthFindingId/v1":"b14690133a75b81e6a7fec25e6e13cee889e93a41dffbafd113fc566abf87376"}},{"ruleId":"D2","level":"warning","message":{"text":"d2dagrelayout.fitPadding (cognitive 248): d2dagrelayout.fitPadding has cognitive complexity 248 (threshold 15). Drivers by points: if/else 53 (172 pts), loops 12 (45 pts), match/switch 8 (22 pts), boolean chains 9 (nesting depth added 166). To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2dagrelayout/layout.go"},"region":{"startLine":1385}}}],"partialFingerprints":{"codehealthFindingId/v1":"17fe6b01e213455cd3874df4484cfd3b65c31d8feab7ea6837f8cb4bc410942f"}},{"ruleId":"D2","level":"warning","message":{"text":"d2svg.drawShape (cognitive 248): d2svg.drawShape has cognitive complexity 248 (threshold 15). Drivers by points: if/else 91 (208 pts), loops 7 (26 pts), boolean chains 11, match/switch 2 (3 pts) (nesting depth added 137). To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svg/d2svg.go"},"region":{"startLine":1688}}}],"partialFingerprints":{"codehealthFindingId/v1":"bda39f6d2d348ed896acbf567827b20f105b49d38d55e415eb9f27e3285e5c03"}},{"ruleId":"D2","level":"warning","message":{"text":"compiler.resolveSubstitutions (cognitive 243): compiler.resolveSubstitutions has cognitive complexity 243 (threshold 15). Drivers by points: if/else 44 (186 pts), loops 8 (33 pts), match/switch 4 (16 pts), boolean chains 8 (nesting depth added 179). To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ir/compile.go"},"region":{"startLine":415}}}],"partialFingerprints":{"codehealthFindingId/v1":"c8fa9153e32ad671a49b20b3d3b758289aae4495b78085a299c189558a2b2acc"}},{"ruleId":"D2","level":"warning","message":{"text":"builder.resolveFontFallbacks (cognitive 243): builder.resolveFontFallbacks has cognitive complexity 243 (threshold 15). Drivers by points: if/else 61 (189 pts), loops 18 (47 pts), boolean chains 7 (nesting depth added 157). Of this number, 241 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/font_fallback.go"},"region":{"startLine":131}}}],"partialFingerprints":{"codehealthFindingId/v1":"672768b6363c5eb6381ad8b0498112c1a18d4ac74b22e33063459f84acbfd13c"}},{"ruleId":"D2","level":"warning","message":{"text":"labeling.place (cognitive 231): labeling.place has cognitive complexity 231 (threshold 15). Drivers by points: if/else 64 (198 pts), loops 12 (24 pts), boolean chains 9 (nesting depth added 146). Of this number, 229 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/labeling/placement.go"},"region":{"startLine":28}}}],"partialFingerprints":{"codehealthFindingId/v1":"aeef12bbcc439fcc9a7e032563c138742da13f33bc7d5c0e6a09e480873865c6"}},{"ruleId":"D2","level":"warning","message":{"text":"graphjson.deserializeGraphContext (cognitive 226): graphjson.deserializeGraphContext has cognitive complexity 226 (threshold 15). Drivers by points: if/else 74 (176 pts), loops 28 (39 pts), boolean chains 11 (nesting depth added 113). To reduce it, split the body into named stages: move each independent step or branch into 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/d2talalayout/internal/graphjson/codec.go"},"region":{"startLine":1035}}}],"partialFingerprints":{"codehealthFindingId/v1":"795947fa827139969798ba2fc1b7bbd5aceb9297a323d944cca86acdb54985af"}},{"ruleId":"D2","level":"warning","message":{"text":"compiler._compileEdges (cognitive 212): compiler._compileEdges has cognitive complexity 212 (threshold 15). Drivers by points: if/else 39 (167 pts), loops 6 (30 pts), boolean chains 15 (nesting depth added 152). To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ir/compile.go"},"region":{"startLine":2088}}}],"partialFingerprints":{"codehealthFindingId/v1":"5be96eaffa022543bbcde8a5639d1fa3b0d637f05d934baf4f72e4b684dcd8b3"}},{"ruleId":"D2","level":"warning","message":{"text":"grouping.AddClusters (cognitive 210): grouping.AddClusters has cognitive complexity 210 (threshold 15). Drivers by points: if/else 67 (163 pts), loops 20 (36 pts), boolean chains 11 (nesting depth added 112). Of this number, 155 points are the body\u0027s own statements and 55 belong to 5 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/grouping/clusters.go"},"region":{"startLine":167}}}],"partialFingerprints":{"codehealthFindingId/v1":"fd6f2d3e9458bc06848c43a8b044b574119f74ff8a97fdca274c0c8a91c84ca5"}},{"ruleId":"D2","level":"warning","message":{"text":"layoutgraph.validateCombineNodeTopology (cognitive 209): layoutgraph.validateCombineNodeTopology has cognitive complexity 209 (threshold 15). Drivers by points: if/else 73 (164 pts), loops 16 (42 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 118). Of this number, 169 points are the body\u0027s own statements and 40 belong to 9 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/d2talalayout/internal/layoutgraph/topology_preflight.go"},"region":{"startLine":129}}}],"partialFingerprints":{"codehealthFindingId/v1":"27bf8c282e5ae58856ad6e83a873dc8692532d9429c8f7f5d1001c8d83cc9617"}},{"ruleId":"D2","level":"warning","message":{"text":"placementcost.nodeSymmetry (cognitive 192): placementcost.nodeSymmetry has cognitive complexity 192 (threshold 15). Drivers by points: if/else 55 (161 pts), loops 10 (22 pts), boolean chains 9 (nesting depth added 118). To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placementcost/symmetry.go"},"region":{"startLine":94}}}],"partialFingerprints":{"codehealthFindingId/v1":"90d24066179ef05b0e4be8d39dc2d5385da1b1e41628da737bdf03a20a0a9fa7"}},{"ruleId":"D2","level":"warning","message":{"text":"grouping.JoinDistancedClusters (cognitive 188): grouping.JoinDistancedClusters has cognitive complexity 188 (threshold 15). Drivers by points: if/else 65 (151 pts), loops 10 (24 pts), boolean chains 13 (nesting depth added 100). Of this number, 69 points are the body\u0027s own statements and 119 belong to 3 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/grouping/join.go"},"region":{"startLine":142}}}],"partialFingerprints":{"codehealthFindingId/v1":"0f5e32ac3a4074f8aa69c3b761c7e270980690cf210d2c80d39c372ee30e902b"}},{"ruleId":"D2","level":"warning","message":{"text":"d2isometricimg.classicInkSegments (cognitive 184): d2isometricimg.classicInkSegments has cognitive complexity 184 (threshold 15). Drivers by points: if/else 47 (130 pts), loops 15 (29 pts), boolean chains 25 (nesting depth added 97). Of this number, 117 points are the body\u0027s own statements and 67 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/native_edges.go"},"region":{"startLine":102}}}],"partialFingerprints":{"codehealthFindingId/v1":"fe8734c3df4398a11d7ee66c13bdad36437189fd874963a877940827b86420b1"}},{"ruleId":"D2","level":"warning","message":{"text":"packing.CombineSubgraphs (cognitive 178): packing.CombineSubgraphs has cognitive complexity 178 (threshold 15). Drivers by points: if/else 49 (132 pts), loops 20 (42 pts), boolean chains 4 (nesting depth added 105). Of this number, 138 points are the body\u0027s own statements and 40 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":"d2layouts/d2talalayout/internal/packing/combine.go"},"region":{"startLine":92}}}],"partialFingerprints":{"codehealthFindingId/v1":"8c0eba3403924418e72b675fbbd415925bc2c5439302afd11121c99b64cea169"}},{"ruleId":"D2","level":"warning","message":{"text":"d2dagrelayout.adjustRankSpacing (cognitive 176): d2dagrelayout.adjustRankSpacing has cognitive complexity 176 (threshold 15). Drivers by points: if/else 37 (131 pts), loops 14 (37 pts), 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":1123}}}],"partialFingerprints":{"codehealthFindingId/v1":"ce98a49a994369b50e6e161dd427e745225747fae40532585964034d2d0927b2"}},{"ruleId":"D2","level":"warning","message":{"text":"d2elklayout.Layout (cognitive 166): d2elklayout.Layout has cognitive complexity 166 (threshold 15). Drivers by points: if/else 46 (104 pts), loops 16 (33 pts), boolean chains 17, match/switch 7 (12 pts) (nesting depth added 80). Of this number, 134 points are the body\u0027s own statements and 32 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":257}}}],"partialFingerprints":{"codehealthFindingId/v1":"42e996fa49112083c4fa537d00055d479a30bf6dcae0b2c2d94af8563a2e3518"}},{"ruleId":"D2","level":"warning","message":{"text":"d2isometricimg.svgVisibleFacesWithLimits (cognitive 165): d2isometricimg.svgVisibleFacesWithLimits has cognitive complexity 165 (threshold 15). Drivers by points: if/else 46 (121 pts), loops 12 (32 pts), boolean chains 12 (nesting depth added 95). Of this number, 139 points are the body\u0027s own statements and 26 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":"d2renderers/d2isometric/d2isometricimg/svg_visibility.go"},"region":{"startLine":343}}}],"partialFingerprints":{"codehealthFindingId/v1":"2d7acd5ba9704eacc08750ee837b3c7840e9ef7d2d3ef74ab259894ad1463d81"}},{"ruleId":"D2","level":"warning","message":{"text":"placementcost.prepareNodeEdgeLength (cognitive 162): placementcost.prepareNodeEdgeLength has cognitive complexity 162 (threshold 15). Drivers by points: if/else 45 (141 pts), loops 6 (14 pts), match/switch 1 (4 pts), boolean chains 3 (nesting depth added 107). To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placementcost/edge_length.go"},"region":{"startLine":142}}}],"partialFingerprints":{"codehealthFindingId/v1":"9f185f16f8efe8ee1af5a538fe2555bf517500589fcfc1ac891717e1a904f694"}},{"ruleId":"D2","level":"warning","message":{"text":"d2isometricimg.nativeResolveLaneRoutes (cognitive 162): d2isometricimg.nativeResolveLaneRoutes has cognitive complexity 162 (threshold 15). Drivers by points: if/else 43 (124 pts), loops 13 (26 pts), boolean chains 12 (nesting depth added 94). Of this number, 153 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":"d2renderers/d2isometric/d2isometricimg/route_lanes.go"},"region":{"startLine":63}}}],"partialFingerprints":{"codehealthFindingId/v1":"adf5a618f3e352e9f954073ab6c57bd0a2f237a39fb10a6c2123009ef800cc96"}},{"ruleId":"D2","level":"warning","message":{"text":"ovgEdgeSet.intersectsWithChecked (cognitive 161): ovgEdgeSet.intersectsWithChecked has cognitive complexity 161 (threshold 15). Drivers by points: if/else 45 (147 pts), loops 6 (14 pts) (nesting depth added 110). Of this number, 160 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/d2talalayout/internal/routing/ovg_edge_set.go"},"region":{"startLine":128}}}],"partialFingerprints":{"codehealthFindingId/v1":"d1ab261ea610cf9e1ecd2d362ea6b9a53cf7c16ac25a7406184fec5fba697268"}},{"ruleId":"D2","level":"warning","message":{"text":"placement.equidistanceNodeGuarded (cognitive 160): placement.equidistanceNodeGuarded has cognitive complexity 160 (threshold 15). Drivers by points: if/else 64 (127 pts), loops 11 (18 pts), boolean chains 15 (nesting depth added 70). Of this number, 145 points are the body\u0027s own statements and 15 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/equidistance.go"},"region":{"startLine":103}}}],"partialFingerprints":{"codehealthFindingId/v1":"4b36b6eed0f8078273a810e0240574305d42c338ec3f4eb754c56d0970da9e55"}},{"ruleId":"D2","level":"warning","message":{"text":"placement.swapOptimize (cognitive 159): placement.swapOptimize has cognitive complexity 159 (threshold 15). Drivers by points: if/else 51 (141 pts), boolean chains 15, loops 2 (3 pts) (nesting depth added 91). Of this number, 152 points are the body\u0027s own statements and 7 belong to 2 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/swap.go"},"region":{"startLine":60}}}],"partialFingerprints":{"codehealthFindingId/v1":"3065db33a36fe4e6c1a84918df4dfb5e41593c950992293efa6a7784ec35435c"}},{"ruleId":"D2","level":"warning","message":{"text":"Rasterizer.DrawRGBA (cognitive 157): Rasterizer.DrawRGBA has cognitive complexity 157 (threshold 15). Drivers by points: if/else 33 (104 pts), loops 12 (45 pts), boolean chains 8 (nesting depth added 104). Most of this is not in the body itself: 8 of the 157 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 507, 613, 576, \u2026). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals\u0027 work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/internal/scanline/rasterizer.go"},"region":{"startLine":491}}}],"partialFingerprints":{"codehealthFindingId/v1":"afd9035618c540a0b6c00c3bc61fad73bbd1587ff37cbd6a39dbbf3a21114ab2"}},{"ruleId":"D2","level":"warning","message":{"text":"d2cli.compile (cognitive 154): d2cli.compile has cognitive complexity 154 (threshold 15). Drivers by points: if/else 68 (142 pts), boolean chains 11, match/switch 1 (nesting depth added 74). To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2cli/main.go"},"region":{"startLine":452}}}],"partialFingerprints":{"codehealthFindingId/v1":"6fff3da16d60c7643dd8dd05a2215ac5f3fff204092ab97d48fac424d630a9dd"}},{"ruleId":"D2","level":"warning","message":{"text":"compiler._compileField (cognitive 154): compiler._compileField has cognitive complexity 154 (threshold 15). Drivers by points: if/else 46 (119 pts), loops 4 (15 pts), match/switch 5 (13 pts), boolean chains 7 (nesting depth added 92). To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ir/compile.go"},"region":{"startLine":1704}}}],"partialFingerprints":{"codehealthFindingId/v1":"08570127e05d6c5811ce2e5bcc1c31f03076202c3c21ee4520e657bd1d161c59"}},{"ruleId":"D2","level":"warning","message":{"text":"Transaction.buildPostStateOverlapCandidates (cognitive 152): Transaction.buildPostStateOverlapCandidates has cognitive complexity 152 (threshold 15). Drivers by points: if/else 42 (116 pts), loops 10 (22 pts), boolean chains 11, match/switch 1 (3 pts) (nesting depth added 88). Of this number, 144 points are the body\u0027s own statements and 8 belong to 2 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/transaction.go"},"region":{"startLine":824}}}],"partialFingerprints":{"codehealthFindingId/v1":"fc4acfabe592ef4d0af27b6edb88cdd660416b46dc0bc4761afac9b85a140510"}},{"ruleId":"D2","level":"warning","message":{"text":"labeling.findBestEdgeLabelPosition (cognitive 149): labeling.findBestEdgeLabelPosition has cognitive complexity 149 (threshold 15). Drivers by points: if/else 58 (128 pts), loops 6 (11 pts), match/switch 2 (8 pts), boolean chains 2 (nesting depth added 81). Of this number, 119 points are the body\u0027s own statements and 30 belong to one function literal inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/labeling/placement.go"},"region":{"startLine":687}}}],"partialFingerprints":{"codehealthFindingId/v1":"fa1239f4c7182ed775d3bced8e24a129fe664c27ccd40ccf790a8c3e12a22731"}},{"ruleId":"D2","level":"warning","message":{"text":"Map.ensureField (cognitive 148): Map.ensureField has cognitive complexity 148 (threshold 15). Drivers by points: if/else 58 (118 pts), boolean chains 22, loops 4 (8 pts) (nesting depth added 64). Of this number, 120 points are the body\u0027s own statements and 28 belong to 4 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ir/d2ir.go"},"region":{"startLine":1216}}}],"partialFingerprints":{"codehealthFindingId/v1":"ec8c5a7d79a221d4e21fd0f75f608ab919a2739863c2b959b480250214f80bc5"}},{"ruleId":"D2","level":"warning","message":{"text":"d2svg.renderValidated (cognitive 148): d2svg.renderValidated has cognitive complexity 148 (threshold 15). Drivers by points: if/else 61 (116 pts), loops 10 (15 pts), boolean chains 14, match/switch 1 (3 pts) (nesting depth added 62). To reduce it, split the body into named stages: move each independent step or branch into 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":2896}}}],"partialFingerprints":{"codehealthFindingId/v1":"2575db0e66b1fdf0c6e274e90fe298a5c78846339622f50d2ba2ed8aec07ac38"}},{"ruleId":"D2","level":"warning","message":{"text":"compiler.compileReserved (cognitive 145): compiler.compileReserved has cognitive complexity 145 (threshold 15). Drivers by points: if/else 44 (111 pts), match/switch 4 (14 pts), loops 3 (13 pts), boolean chains 7 (nesting depth added 87). To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2compiler/compile.go"},"region":{"startLine":863}}}],"partialFingerprints":{"codehealthFindingId/v1":"a313dd5d841eaf12cecf18a9635580acfe4b5bae7c90a48c14c2c943bd3ca4fe"}},{"ruleId":"D2","level":"warning","message":{"text":"trees.extractTreesInContainer (cognitive 144): trees.extractTreesInContainer has cognitive complexity 144 (threshold 15). Drivers by points: if/else 42 (121 pts), loops 10 (17 pts), boolean chains 6 (nesting depth added 86). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/trees/layout.go"},"region":{"startLine":14}}}],"partialFingerprints":{"codehealthFindingId/v1":"288c1a3151bb2bcbf519f1fa7dba868fd53db4ae0b14696e7cd81a98d05f4a9a"}},{"ruleId":"D2","level":"warning","message":{"text":"graphjson.Serialize (cognitive 143): graphjson.Serialize has cognitive complexity 143 (threshold 15). Drivers by points: if/else 45 (108 pts), loops 21 (35 pts) (nesting depth added 77). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/graphjson/codec.go"},"region":{"startLine":262}}}],"partialFingerprints":{"codehealthFindingId/v1":"c68e3fba12804c8b1d2c92bb0ab843f1ba8caa06271ed92f8c74dbb6d0421d1e"}},{"ruleId":"D2","level":"warning","message":{"text":"ShapingWorkspace.ShapeTextTransient (cognitive 138): ShapingWorkspace.ShapeTextTransient has cognitive complexity 138 (threshold 15). Drivers by points: if/else 60 (121 pts), loops 7 (9 pts), boolean chains 8 (nesting depth added 63). To reduce it, split the body into named stages: move each independent step or branch into 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/internal/fontface/shaping.go"},"region":{"startLine":111}}}],"partialFingerprints":{"codehealthFindingId/v1":"91196f9c50071c34104cf32830bb466454806735aec49857d68d2a1fd0cc9ec0"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.RouteGraphWithWorkLimit (cognitive 135): routing.RouteGraphWithWorkLimit has cognitive complexity 135 (threshold 15). Drivers by points: if/else 45 (107 pts), loops 11 (27 pts), boolean chains 1 (nesting depth added 78). Of this number, 25 points are the body\u0027s own statements and 110 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/d2talalayout/internal/routing/graph_stage.go"},"region":{"startLine":44}}}],"partialFingerprints":{"codehealthFindingId/v1":"36095b71025ca7a04a77824679810b32855fb38bdafc527b38a51ab6dd52c6a6"}},{"ruleId":"D2","level":"warning","message":{"text":"svgImporter.parse (cognitive 133): svgImporter.parse has cognitive complexity 133 (threshold 15). Drivers by points: if/else 41 (122 pts), boolean chains 8, match/switch 1 (2 pts), loops 1 (nesting depth added 82). To reduce it, split the body into named stages: move each independent step or branch into 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/d2svgimport/import.go"},"region":{"startLine":393}}}],"partialFingerprints":{"codehealthFindingId/v1":"94a866492d76abe3f1195075a82469972b3c5c2cc42b82a1c9d4d60b54dae137"}},{"ruleId":"D2","level":"warning","message":{"text":"sizedOptimizer.optimizeGuarded (cognitive 132): sizedOptimizer.optimizeGuarded has cognitive complexity 132 (threshold 15). Drivers by points: if/else 42 (124 pts), loops 3 (5 pts), boolean chains 3 (nesting depth added 84). Of this number, 108 points are the body\u0027s own statements and 24 belong to one function literal inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/sized_optimizer.go"},"region":{"startLine":279}}}],"partialFingerprints":{"codehealthFindingId/v1":"c636ec3311a0adc38a04ccd2f83e0ee4ae8d28a9d4c60c81afd18cfb5be26e49"}},{"ruleId":"D2","level":"warning","message":{"text":"d2svg.drawConnection (cognitive 132): d2svg.drawConnection has cognitive complexity 132 (threshold 15). Drivers by points: if/else 52 (113 pts), loops 3 (12 pts), boolean chains 7 (nesting depth added 70). To reduce it, split the body into named stages: move each independent step or branch into 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":1079}}}],"partialFingerprints":{"codehealthFindingId/v1":"81e4a10da428a69568439d5a589d2a39577452b028513545f60ba027615cec4b"}},{"ruleId":"D2","level":"warning","message":{"text":"preflight.text (cognitive 130): preflight.text has cognitive complexity 130 (threshold 15). Drivers by points: if/else 60 (120 pts), boolean chains 5, loops 3 (4 pts), match/switch 1 (nesting depth added 61). Of this number, 127 points are the body\u0027s own statements and 3 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/text.go"},"region":{"startLine":183}}}],"partialFingerprints":{"codehealthFindingId/v1":"0fcd34306040e834176d783b887b201d3eb717fec4fe0d4b631d14801004a408"}},{"ruleId":"D2","level":"warning","message":{"text":"ovgEdgeRouter.addRoute (cognitive 129): ovgEdgeRouter.addRoute has cognitive complexity 129 (threshold 15). Drivers by points: if/else 28 (104 pts), loops 7 (22 pts), boolean chains 3 (nesting depth added 91). To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/ovg_edge_router.go"},"region":{"startLine":1659}}}],"partialFingerprints":{"codehealthFindingId/v1":"38842a30d7a8981037e07182fa624418a3a1425931aefd2499e79a9570e657cb"}},{"ruleId":"D2","level":"warning","message":{"text":"d2oracle.updateNear (cognitive 129): d2oracle.updateNear has cognitive complexity 129 (threshold 15). Drivers by points: if/else 33 (120 pts), loops 4 (6 pts), boolean chains 3 (nesting depth added 89). To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2oracle/edit.go"},"region":{"startLine":2328}}}],"partialFingerprints":{"codehealthFindingId/v1":"d88f11f420c7197f0298b01084320d739930ebf87efbb210d14bcb88d4cb73de"}},{"ruleId":"D2","level":"warning","message":{"text":"placement.transpose (cognitive 128): placement.transpose has cognitive complexity 128 (threshold 15). Drivers by points: if/else 51 (102 pts), loops 9 (19 pts), boolean chains 7 (nesting depth added 61). Of this number, 105 points are the body\u0027s own statements and 23 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/d2talalayout/internal/placement/transpose.go"},"region":{"startLine":35}}}],"partialFingerprints":{"codehealthFindingId/v1":"0f064f83ec0387b551e7698ec58095e4bd9f2f58163dc7f00406dd2a315f64cd"}},{"ruleId":"D2","level":"warning","message":{"text":"rasterimage.inspectPNG (cognitive 128): rasterimage.inspectPNG has cognitive complexity 128 (threshold 15). Drivers by points: if/else 37 (107 pts), boolean chains 18, match/switch 1 (2 pts), loops 1 (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":"internal/rasterimage/firstframe.go"},"region":{"startLine":339}}}],"partialFingerprints":{"codehealthFindingId/v1":"fecdb69a0144e8ceffa690d6f4967339f2b3dd3a72c6226a4f2bc073a273b9fa"}},{"ruleId":"D2","level":"warning","message":{"text":"placement.shiftSubgraphs (cognitive 127): placement.shiftSubgraphs has cognitive complexity 127 (threshold 15). Drivers by points: if/else 41 (105 pts), loops 10 (22 pts) (nesting depth added 76). Of this number, 121 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":"d2layouts/d2talalayout/internal/placement/compaction.go"},"region":{"startLine":145}}}],"partialFingerprints":{"codehealthFindingId/v1":"f444077523fbd2edb19ded949dd470c227aa971cf1ce9736f5d0d62b0f38cb62"}},{"ruleId":"D2","level":"warning","message":{"text":"Route.isOpposingColinear (cognitive 127): Route.isOpposingColinear has cognitive complexity 127 (threshold 15). Drivers by points: if/else 33 (103 pts), boolean chains 20, loops 2 (4 pts) (nesting depth added 72). To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/route.go"},"region":{"startLine":87}}}],"partialFingerprints":{"codehealthFindingId/v1":"29272e17c23893e34fa22be8fc695d0c62f5b460498a95e7ad77a84f6b54dcf1"}},{"ruleId":"D2","level":"warning","message":{"text":"Node.reachableNodesGuarded (cognitive 126): Node.reachableNodesGuarded has cognitive complexity 126 (threshold 15). Drivers by points: if/else 32 (97 pts), loops 9 (29 pts) (nesting depth added 85). Of this number, 123 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/d2talalayout/internal/layoutgraph/node.go"},"region":{"startLine":1670}}}],"partialFingerprints":{"codehealthFindingId/v1":"cf00f3be1bfaacad847e86df55580339aebdff048f154add6991b5ab9936ee21"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.buildChannelProblem (cognitive 126): routing.buildChannelProblem has cognitive complexity 126 (threshold 15). Drivers by points: if/else 26 (69 pts), loops 24 (43 pts), boolean chains 14 (nesting depth added 62). Of this number, 124 points are the body\u0027s own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/nudge_channels.go"},"region":{"startLine":200}}}],"partialFingerprints":{"codehealthFindingId/v1":"7ccad667206ccf1b5c5d138824bfbe7a7ad277a23653b593d34f4be2aa82e983"}},{"ruleId":"D2","level":"warning","message":{"text":"d2raster.compositeLayerOver (cognitive 126): d2raster.compositeLayerOver has cognitive complexity 126 (threshold 15). Drivers by points: if/else 24 (96 pts), loops 8 (25 pts), boolean chains 5 (nesting depth added 89). To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/effects.go"},"region":{"startLine":1760}}}],"partialFingerprints":{"codehealthFindingId/v1":"35329c73ce76040d725bc2c7d706a3510d0b3fb5587323e90a6b4d368ad2d496"}},{"ruleId":"D2","level":"warning","message":{"text":"quality.scoreExistingLabelPlacements (cognitive 125): quality.scoreExistingLabelPlacements has cognitive complexity 125 (threshold 15). Drivers by points: if/else 45 (104 pts), loops 10 (16 pts), boolean chains 5 (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":"d2layouts/d2talalayout/internal/quality/labels.go"},"region":{"startLine":16}}}],"partialFingerprints":{"codehealthFindingId/v1":"dd98ec86104ab239d5edfe2c98270b827759d1ba1f22daee9b27e372063fd90f"}},{"ruleId":"D2","level":"warning","message":{"text":"d2svg.collectFontCorporaAndClasses (cognitive 122): d2svg.collectFontCorporaAndClasses has cognitive complexity 122 (threshold 15). Drivers by points: if/else 24 (84 pts), loops 5 (16 pts), boolean chains 13, match/switch 3 (9 pts) (nesting depth added 77). Of this number, 114 points are the body\u0027s own statements and 8 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svg/font_corpus.go"},"region":{"startLine":79}}}],"partialFingerprints":{"codehealthFindingId/v1":"53408e7214a272c254bbb1047ba4331d9ce9fe34cb98370f2d8619d0d25b9b81"}},{"ruleId":"D2","level":"warning","message":{"text":"graphjson.validateSerializedGraphForDeserialization (cognitive 121): graphjson.validateSerializedGraphForDeserialization has cognitive complexity 121 (threshold 15). Drivers by points: if/else 57 (99 pts), loops 14 (19 pts), boolean chains 3 (nesting depth added 47). Of this number, 97 points are the body\u0027s own statements and 24 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/d2talalayout/internal/graphjson/preflight.go"},"region":{"startLine":25}}}],"partialFingerprints":{"codehealthFindingId/v1":"da995f1057e2c964b4aba97edf0bce854491cd098efc8a183f8e92cd53c0f9a1"}},{"ruleId":"D2","level":"warning","message":{"text":"builder.shapeTextRuns (cognitive 120): builder.shapeTextRuns has cognitive complexity 120 (threshold 15). Drivers by points: if/else 35 (84 pts), loops 9 (28 pts), boolean chains 8 (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":"d2renderers/d2scenebuild/font_fallback.go"},"region":{"startLine":432}}}],"partialFingerprints":{"codehealthFindingId/v1":"53a3ea95175006bec9e6ad2cc30f5a7b736f7fe2c6c8f64f22115bb075fd4c5b"}},{"ruleId":"D2","level":"warning","message":{"text":"d2layouts.LayoutNested (cognitive 119): d2layouts.LayoutNested has cognitive complexity 119 (threshold 15). Drivers by points: if/else 37 (90 pts), loops 11 (24 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 67). Of this number, 116 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":"d2cli.Run (cognitive 118): d2cli.Run has cognitive complexity 118 (threshold 15). Drivers by points: if/else 78 (103 pts), boolean chains 10, match/switch 3 (5 pts) (nesting depth added 27). 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":62}}}],"partialFingerprints":{"codehealthFindingId/v1":"17a506a1d3686e119d60af0d3da74221a1a806758284cb63e71bf2b033d7c4fa"}},{"ruleId":"D2","level":"warning","message":{"text":"OVG.addPortConnectionNodesAtBoundaries (cognitive 118): OVG.addPortConnectionNodesAtBoundaries has cognitive complexity 118 (threshold 15). Drivers by points: if/else 21 (103 pts), loops 5 (15 pts) (nesting depth added 92). Of this number, 31 points are the body\u0027s own statements and 87 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/d2talalayout/internal/routing/ovg.go"},"region":{"startLine":874}}}],"partialFingerprints":{"codehealthFindingId/v1":"0f40e1c4904c3c0ca705e6cde87c208b7292e169eb8dd897041f6f05ce5a1acc"}},{"ruleId":"D2","level":"warning","message":{"text":"graphjson.newEdgeSerializationIDs (cognitive 117): graphjson.newEdgeSerializationIDs has cognitive complexity 117 (threshold 15). Drivers by points: if/else 33 (77 pts), loops 24 (39 pts), boolean chains 1 (nesting depth added 59). Of this number, 108 points are the body\u0027s own statements and 9 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/graphjson/codec.go"},"region":{"startLine":50}}}],"partialFingerprints":{"codehealthFindingId/v1":"67235c3418a008fc9235e3e1a3b540ee4bc809125c63b2cc8aabe7bb3fc93be1"}},{"ruleId":"D2","level":"warning","message":{"text":"placement.optimizeClusterWithRollback (cognitive 116): placement.optimizeClusterWithRollback has cognitive complexity 116 (threshold 15). Drivers by points: if/else 42 (95 pts), match/switch 7 (17 pts), boolean chains 3, loops 1 (nesting depth added 63). Of this number, 96 points are the body\u0027s own statements and 20 belong to 5 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/cluster_optimization.go"},"region":{"startLine":148}}}],"partialFingerprints":{"codehealthFindingId/v1":"08e55077b3a8d4a88d2822c2c214dc3a38278b3956e24af872aa2c0fda615642"}},{"ruleId":"D2","level":"warning","message":{"text":"Graph.SetDimensions (cognitive 115): Graph.SetDimensions has cognitive complexity 115 (threshold 15). Drivers by points: if/else 40 (92 pts), boolean chains 15, match/switch 2 (6 pts), 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":1515}}}],"partialFingerprints":{"codehealthFindingId/v1":"153f013706a50c563803170e74d16ab199f8ad6ea24726f8fad5003f9b3530d4"}},{"ruleId":"D2","level":"warning","message":{"text":"d2isometricimg.nativeResolveBridgeRoutes (cognitive 115): d2isometricimg.nativeResolveBridgeRoutes has cognitive complexity 115 (threshold 15). Drivers by points: if/else 30 (76 pts), loops 14 (31 pts), boolean chains 8 (nesting depth added 63). Of this number, 110 points are the body\u0027s own statements and 5 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/route_bridges.go"},"region":{"startLine":60}}}],"partialFingerprints":{"codehealthFindingId/v1":"29f5823e31950723e5ca3306e414270becf3db676190b576e15384c38a781287"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.reorderDuplicatesInEdges (cognitive 114): routing.reorderDuplicatesInEdges has cognitive complexity 114 (threshold 15). Drivers by points: if/else 29 (74 pts), loops 11 (34 pts), boolean chains 6 (nesting depth added 68). Of this number, 111 points are the body\u0027s own statements and 3 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/coordinator.go"},"region":{"startLine":1633}}}],"partialFingerprints":{"codehealthFindingId/v1":"2a828748128080ae2b5161b26c855485a4ad73675d47abb251df0b9655d62cfd"}},{"ruleId":"D2","level":"warning","message":{"text":"d2raster.rgbaToNRGBAInPlaceBounds (cognitive 114): d2raster.rgbaToNRGBAInPlaceBounds has cognitive complexity 114 (threshold 15). Drivers by points: if/else 20 (83 pts), loops 7 (23 pts), boolean chains 8 (nesting depth added 79). To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/raster.go"},"region":{"startLine":462}}}],"partialFingerprints":{"codehealthFindingId/v1":"f04150b21019fe7398f71898b34cf239be6ceca93d0ba0553ee9995cb2195213"}},{"ruleId":"D2","level":"warning","message":{"text":"d2dagrelayout.Layout (cognitive 113): d2dagrelayout.Layout has cognitive complexity 113 (threshold 15). Drivers by points: if/else 40 (84 pts), loops 13 (19 pts), boolean chains 6, match/switch 2 (4 pts) (nesting depth added 52). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2dagrelayout/layout.go"},"region":{"startLine":53}}}],"partialFingerprints":{"codehealthFindingId/v1":"164fa85aa8505817ebf8455ecd7b5f4ae82b671b2749490563dc4558f8d3c739"}},{"ruleId":"D2","level":"warning","message":{"text":"Transaction.Commit (cognitive 113): Transaction.Commit has cognitive complexity 113 (threshold 15). Drivers by points: if/else 45 (102 pts), loops 6 (9 pts), boolean chains 2 (nesting depth added 60). Of this number, 111 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/transaction.go"},"region":{"startLine":1166}}}],"partialFingerprints":{"codehealthFindingId/v1":"ac7de2990544c72521385302f57939695b02c7e260bcd2f7c441662d455e26da"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.reorderDuplicatesInEdgesGuarded (cognitive 113): routing.reorderDuplicatesInEdgesGuarded has cognitive complexity 113 (threshold 15). Drivers by points: if/else 38 (99 pts), loops 5 (9 pts), boolean chains 5 (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":"d2layouts/d2talalayout/internal/routing/standalone_route_guard.go"},"region":{"startLine":323}}}],"partialFingerprints":{"codehealthFindingId/v1":"d6c0c72119abfb1d98b8bcf4efd813539536c6c24320bd69459792c325f327de"}},{"ruleId":"D2","level":"warning","message":{"text":"d2elklayout.deleteBends (cognitive 112): d2elklayout.deleteBends has cognitive complexity 112 (threshold 15). Drivers by points: if/else 34 (98 pts), loops 7 (10 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 69). To reduce it, split the body into named stages: move each independent step or branch into 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":770}}}],"partialFingerprints":{"codehealthFindingId/v1":"d12a798d74740e7f99fe5896965b209d3f4e03d89af09a2bb1a83039529c3283"}},{"ruleId":"D2","level":"warning","message":{"text":"svgImporter.instantiate (cognitive 111): svgImporter.instantiate has cognitive complexity 111 (threshold 15). Drivers by points: if/else 29 (99 pts), boolean chains 6, match/switch 2 (5 pts), loops 1 (nesting depth added 73). To reduce it, split the body into named stages: move each independent step or branch into 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/d2svgimport/compile.go"},"region":{"startLine":386}}}],"partialFingerprints":{"codehealthFindingId/v1":"dca95eabc1547add2608765af148d38122a4d23c342465dd1ec9410d6e0050c6"}},{"ruleId":"D2","level":"warning","message":{"text":"svgImporter.computeStyle (cognitive 111): svgImporter.computeStyle has cognitive complexity 111 (threshold 15). Drivers by points: if/else 54 (96 pts), match/switch 6 (12 pts), boolean chains 3 (nesting depth added 48). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svgimport/style.go"},"region":{"startLine":266}}}],"partialFingerprints":{"codehealthFindingId/v1":"1058735d8f90c7d5420c66451f99553d18cb1c99742736494997623322c43826"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.tunnelRangesBetweenChecked (cognitive 110): routing.tunnelRangesBetweenChecked has cognitive complexity 110 (threshold 15). Drivers by points: if/else 35 (85 pts), boolean chains 20, loops 3 (5 pts) (nesting depth added 52). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/tunnel.go"},"region":{"startLine":93}}}],"partialFingerprints":{"codehealthFindingId/v1":"7af6d7d0f5223a266837bf2874cc3c7c9ee5dcc19d786534d0b69c99d6c1f450"}},{"ruleId":"D2","level":"warning","message":{"text":"trees.layoutTree (cognitive 110): trees.layoutTree has cognitive complexity 110 (threshold 15). Drivers by points: if/else 24 (90 pts), loops 10 (20 pts) (nesting depth added 76). Of this number, 96 points are the body\u0027s own statements and 14 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/d2talalayout/internal/trees/geometry.go"},"region":{"startLine":113}}}],"partialFingerprints":{"codehealthFindingId/v1":"97d64b446a483d93891f1b392008fd4e067f774862164c712038d0927a48cc14"}},{"ruleId":"D2","level":"warning","message":{"text":"quality.measureLabels (cognitive 109): quality.measureLabels has cognitive complexity 109 (threshold 15). Drivers by points: if/else 34 (89 pts), loops 7 (12 pts), boolean chains 8 (nesting depth added 60). Of this number, 107 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/quality/inspection_labels.go"},"region":{"startLine":19}}}],"partialFingerprints":{"codehealthFindingId/v1":"f99449558d512b1b5771401d6431677096c182c1ec78b1ceef45d5c1803ee955"}},{"ruleId":"D2","level":"warning","message":{"text":"meshBuilder.edges (cognitive 109): meshBuilder.edges has cognitive complexity 109 (threshold 15). Drivers by points: if/else 36 (83 pts), boolean chains 18, loops 4 (8 pts) (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":"d2renderers/d2isometric/d2isometricimg/geometry_routes.go"},"region":{"startLine":332}}}],"partialFingerprints":{"codehealthFindingId/v1":"8de2066a70f2418092941df5b11a8f283007150b129c3950123eefa12686dc29"}},{"ruleId":"D2","level":"warning","message":{"text":"compiler.compileMap (cognitive 108): compiler.compileMap has cognitive complexity 108 (threshold 15). Drivers by points: if/else 26 (78 pts), loops 8 (24 pts), boolean chains 4, match/switch 1 (2 pts) (nesting depth added 69). To reduce it, split the body into named stages: move each independent step or branch into 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":971}}}],"partialFingerprints":{"codehealthFindingId/v1":"efe74c23d31258c4a3ab9e353a830529a11c97ad65f9a5850a4e64b4c806d9ca"}},{"ruleId":"D2","level":"warning","message":{"text":"proximity.assignNearsWithWorkLimit (cognitive 108): proximity.assignNearsWithWorkLimit has cognitive complexity 108 (threshold 15). Drivers by points: if/else 32 (85 pts), loops 13 (20 pts), boolean chains 3 (nesting depth added 60). Of this number, 91 points are the body\u0027s own statements and 17 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/d2talalayout/internal/proximity/nears.go"},"region":{"startLine":18}}}],"partialFingerprints":{"codehealthFindingId/v1":"6cc04488017932750f5b4eff389c2ea183526e5446fcc0fe906097f6126d0421"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.balanceReversalRemovesCrossings (cognitive 108): routing.balanceReversalRemovesCrossings has cognitive complexity 108 (threshold 15). Drivers by points: if/else 27 (81 pts), loops 9 (18 pts), boolean chains 9 (nesting depth added 63). To reduce it, split the body into named stages: move each independent step or branch into 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/d2talalayout/internal/routing/balance_crossings.go"},"region":{"startLine":17}}}],"partialFingerprints":{"codehealthFindingId/v1":"cab62ef84b8a9e3ec6db8fc34dbe2758e745fb84354adef90ef1540c9e055558"}},{"ruleId":"D2","level":"warning","message":{"text":"grouping.AddSequences (cognitive 106): grouping.AddSequences has cognitive complexity 106 (threshold 15). Drivers by points: if/else 34 (80 pts), loops 13 (24 pts), boolean chains 2 (nesting depth added 57). Of this number, 105 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/d2talalayout/internal/grouping/sequences.go"},"region":{"startLine":206}}}],"partialFingerprints":{"codehealthFindingId/v1":"bc5630004d990901cc891fb35fdc4123c025d4c31cf1199efa6665ff372b2201"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.channelProposalSafe (cognitive 106): routing.channelProposalSafe has cognitive complexity 106 (threshold 15). Drivers by points: if/else 22 (75 pts), loops 10 (22 pts), boolean chains 9 (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":"d2layouts/d2talalayout/internal/routing/nudge_channels.go"},"region":{"startLine":602}}}],"partialFingerprints":{"codehealthFindingId/v1":"703578e3193e6bfc3dac405885e3ea4e8949cd563714d59a8fba97a243ce1e0e"}},{"ruleId":"D2","level":"warning","message":{"text":"placement.optimizerAdjacents (cognitive 104): placement.optimizerAdjacents has cognitive complexity 104 (threshold 15). Drivers by points: if/else 39 (83 pts), boolean chains 11, loops 7 (10 pts) (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":"d2layouts/d2talalayout/internal/placement/optimization_guard.go"},"region":{"startLine":176}}}],"partialFingerprints":{"codehealthFindingId/v1":"1b8394e324dc8a98cc769139bf5acb22e615b5baac8bb119f5f0d29b3aef2897"}},{"ruleId":"D2","level":"warning","message":{"text":"d2oracle.Delete (cognitive 104): d2oracle.Delete has cognitive complexity 104 (threshold 15). Drivers by points: if/else 38 (84 pts), loops 4 (19 pts), boolean chains 1 (nesting depth added 61). To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2oracle/edit.go"},"region":{"startLine":937}}}],"partialFingerprints":{"codehealthFindingId/v1":"94352eb4396e995b29a66113eae40e048d7e099cbaed65d456165d7e09e38e94"}},{"ruleId":"D2","level":"warning","message":{"text":"d2isometricimg.newNativeSceneWithOptions (cognitive 104): d2isometricimg.newNativeSceneWithOptions has cognitive complexity 104 (threshold 15). Drivers by points: if/else 39 (87 pts), loops 8 (9 pts), boolean chains 8 (nesting depth added 49). To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/geometry.go"},"region":{"startLine":431}}}],"partialFingerprints":{"codehealthFindingId/v1":"dcbe42f5e6851164876e2ecc4c3edc423dfbb1551f3b4ad8e2103ddbfccecbf3"}},{"ruleId":"D2","level":"warning","message":{"text":"hierarchy.findCycleEdges (cognitive 101): hierarchy.findCycleEdges has cognitive complexity 101 (threshold 15). Drivers by points: if/else 29 (77 pts), loops 11 (21 pts), boolean chains 3 (nesting depth added 58). Of this number, 87 points are the body\u0027s own statements and 14 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/hierarchy/discovery.go"},"region":{"startLine":579}}}],"partialFingerprints":{"codehealthFindingId/v1":"5ee7970bcc2293fb6be040153a51430a228281ccd07e790639be7713607826fd"}},{"ruleId":"D2","level":"warning","message":{"text":"Node.connectedNodes (cognitive 101): Node.connectedNodes has cognitive complexity 101 (threshold 15). Drivers by points: if/else 19 (67 pts), loops 12 (33 pts), boolean chains 1 (nesting depth added 69). Of this number, 100 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/d2talalayout/internal/layoutgraph/node.go"},"region":{"startLine":1847}}}],"partialFingerprints":{"codehealthFindingId/v1":"f10c3321644a76a703b7f7e94eea66e52192392a1b2b21a13ba5001b6e31bc21"}},{"ruleId":"D2","level":"warning","message":{"text":"proximity.AssignHerds (cognitive 101): proximity.AssignHerds has cognitive complexity 101 (threshold 15). Drivers by points: if/else 23 (64 pts), loops 12 (28 pts), boolean chains 9 (nesting depth added 57). Of this number, 99 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/proximity/herding.go"},"region":{"startLine":16}}}],"partialFingerprints":{"codehealthFindingId/v1":"ac7de0ca7111a6958382f0f243e8e8e74760491fec640a54fe6b9f65578d59e8"}},{"ruleId":"D2","level":"warning","message":{"text":"d2oracle.DeleteIDDeltas (cognitive 101): d2oracle.DeleteIDDeltas has cognitive complexity 101 (threshold 15). Drivers by points: if/else 27 (73 pts), loops 12 (25 pts), 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":2972}}}],"partialFingerprints":{"codehealthFindingId/v1":"a24a066e7d767f703abc07d434738b6819f7b61eb01298df0ca8950e5560909b"}},{"ruleId":"D2","level":"warning","message":{"text":"layoutgraph.collectRuntimeObjectsContext (cognitive 100): layoutgraph.collectRuntimeObjectsContext has cognitive complexity 100 (threshold 15). Drivers by points: loops 26 (52 pts), if/else 43 (45 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 29). Of this number, 60 points are the body\u0027s own statements and 40 belong to 9 function literals inside it that branch. To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/transaction_snapshot.go"},"region":{"startLine":362}}}],"partialFingerprints":{"codehealthFindingId/v1":"34316c1a5c6583774d7389fea80150a293c397b67ef76df74d91309a5f88d1f3"}},{"ruleId":"D2","level":"warning","message":{"text":"textPainter.texture (cognitive 100): textPainter.texture has cognitive complexity 100 (threshold 15). Drivers by points: if/else 39 (73 pts), loops 8 (14 pts), boolean chains 9, match/switch 1 (4 pts) (nesting depth added 43). Of this number, 81 points are the body\u0027s own statements and 19 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/text.go"},"region":{"startLine":145}}}],"partialFingerprints":{"codehealthFindingId/v1":"47f641217856124e9bfbe968f9921d996bdf4a074eba720914e5c0dd1ebe6802"}},{"ruleId":"D2","level":"warning","message":{"text":"d2isometricimg.svgOrderPaintUnitsWithLimits (cognitive 99): d2isometricimg.svgOrderPaintUnitsWithLimits has cognitive complexity 99 (threshold 15). Drivers by points: if/else 27 (69 pts), loops 15 (27 pts), boolean chains 3 (nesting depth added 54). Of this number, 73 points are the body\u0027s own statements and 26 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":"d2renderers/d2isometric/d2isometricimg/svg_order.go"},"region":{"startLine":29}}}],"partialFingerprints":{"codehealthFindingId/v1":"359a6b95a8025218a1aaf50bb261874faaa9a724c5cbcfbf3c53358aab052d12"}},{"ruleId":"D2","level":"warning","message":{"text":"svgImporter.declarationsFor (cognitive 99): svgImporter.declarationsFor has cognitive complexity 99 (threshold 15). Drivers by points: if/else 35 (84 pts), loops 7 (10 pts), boolean chains 5 (nesting depth added 52). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svgimport/style.go"},"region":{"startLine":63}}}],"partialFingerprints":{"codehealthFindingId/v1":"86e754ff0619f65380065b70d19493ace22485bb5df0d213437df69416fbc6d4"}},{"ruleId":"D2","level":"warning","message":{"text":"d2isometricimg.nativeSceneSVG (cognitive 97): d2isometricimg.nativeSceneSVG has cognitive complexity 97 (threshold 15). Drivers by points: if/else 33 (69 pts), loops 10 (18 pts), boolean chains 10 (nesting depth added 44). Of this number, 93 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":"d2renderers/d2isometric/d2isometricimg/svg.go"},"region":{"startLine":237}}}],"partialFingerprints":{"codehealthFindingId/v1":"ca08a99cf4a9ae50699b23b98da5cc71f7dc4f813f76fc3fca851f73cbb74f02"}},{"ruleId":"D2","level":"warning","message":{"text":"compiler.ampersandFilter (cognitive 96): compiler.ampersandFilter has cognitive complexity 96 (threshold 15). Drivers by points: if/else 28 (60 pts), loops 6 (17 pts), boolean chains 13, match/switch 2 (6 pts) (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":1364}}}],"partialFingerprints":{"codehealthFindingId/v1":"4189a52422e3af5f1aeb4b48a71d1594da118ef8cd80ac23502d165329e4a98e"}},{"ruleId":"D2","level":"warning","message":{"text":"hierarchy.newRankProblem (cognitive 96): hierarchy.newRankProblem has cognitive complexity 96 (threshold 15). Drivers by points: if/else 39 (75 pts), loops 10 (14 pts), boolean chains 7 (nesting depth added 40). Of this number, 90 points are the body\u0027s own statements and 6 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/hierarchy/rank_graph.go"},"region":{"startLine":13}}}],"partialFingerprints":{"codehealthFindingId/v1":"181d73a0c639cfeecd2e5580411d753aebde7e8428375d6c29032275d9b77c14"}},{"ruleId":"D2","level":"warning","message":{"text":"parser.parseUnquotedString (cognitive 96): parser.parseUnquotedString has cognitive complexity 96 (threshold 15). Drivers by points: if/else 31 (77 pts), match/switch 4 (12 pts), boolean chains 5, loops 2 (nesting depth added 54). Of this number, 89 points are the body\u0027s own statements and 7 belong to one function literal inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2parser/parse.go"},"region":{"startLine":1129}}}],"partialFingerprints":{"codehealthFindingId/v1":"266f11a082b5546c9014f98466db7279741e329d22d7140491c6251fc611349d"}},{"ruleId":"D2","level":"warning","message":{"text":"Edge.TraceToShape (cognitive 94): Edge.TraceToShape has cognitive complexity 94 (threshold 15). Drivers by points: if/else 26 (68 pts), boolean chains 14, loops 4 (12 pts) (nesting depth added 50). To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2graph/layout.go"},"region":{"startLine":414}}}],"partialFingerprints":{"codehealthFindingId/v1":"d55e1bdc89032c0d9a141536cc0502cd1dae6d283f59e11f266bb37aebbad005"}},{"ruleId":"D2","level":"warning","message":{"text":"d2isometricimg.nativeLaneJoinCorners (cognitive 94): d2isometricimg.nativeLaneJoinCorners has cognitive complexity 94 (threshold 15). Drivers by points: if/else 19 (63 pts), loops 9 (19 pts), boolean chains 12 (nesting depth added 54). Of this number, 84 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":"d2renderers/d2isometric/d2isometricimg/route_lanes.go"},"region":{"startLine":435}}}],"partialFingerprints":{"codehealthFindingId/v1":"a9c081a5667f6bda38786738243575150342b34f5454760066f25ea36c6990d5"}},{"ruleId":"D2","level":"warning","message":{"text":"Map.createEdge (cognitive 92): Map.createEdge has cognitive complexity 92 (threshold 15). Drivers by points: if/else 28 (70 pts), loops 6 (13 pts), boolean chains 9 (nesting depth added 49). To reduce it, split the body into named stages: move each independent step or branch into 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":1717}}}],"partialFingerprints":{"codehealthFindingId/v1":"31281b424137996c52b2985aec5e0d01c442c742decce8e627b1e06be98e5df4"}},{"ruleId":"D2","level":"warning","message":{"text":"placement.placeNodes (cognitive 92): placement.placeNodes has cognitive complexity 92 (threshold 15). Drivers by points: if/else 31 (61 pts), loops 13 (29 pts), boolean chains 2 (nesting depth added 46). Of this number, 87 points are the body\u0027s own statements and 5 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/node_placement.go"},"region":{"startLine":21}}}],"partialFingerprints":{"codehealthFindingId/v1":"de5ae7921cec3b01f5214b401aa4c0609d9aa8b6f19c9fa640c3f305a11a7fbd"}},{"ruleId":"D2","level":"warning","message":{"text":"d2isometric.BuildScene (cognitive 91): d2isometric.BuildScene has cognitive complexity 91 (threshold 15). Drivers by points: if/else 36 (56 pts), loops 14 (19 pts), boolean chains 16 (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":"d2renderers/d2isometric/scene.go"},"region":{"startLine":129}}}],"partialFingerprints":{"codehealthFindingId/v1":"884c25e6339340eb22c3f28b0b574fd15f857ac76684b02952f6f60f927f428b"}},{"ruleId":"D2","level":"warning","message":{"text":"d2raster.makeStrokeRuns (cognitive 91): d2raster.makeStrokeRuns has cognitive complexity 91 (threshold 15). Drivers by points: if/else 30 (81 pts), boolean chains 5, loops 4 (5 pts) (nesting depth added 52). To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/geometry.go"},"region":{"startLine":529}}}],"partialFingerprints":{"codehealthFindingId/v1":"8f179a2905f932b9e21c5812d23df9ebb0d40b970d64a940e1dfa91c4944d25d"}},{"ruleId":"D2","level":"warning","message":{"text":"compiler.compileMap (cognitive 90): compiler.compileMap has cognitive complexity 90 (threshold 15). Drivers by points: if/else 26 (72 pts), loops 5 (14 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 56). To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2compiler/compile.go"},"region":{"startLine":453}}}],"partialFingerprints":{"codehealthFindingId/v1":"921c22b9e3b50e1b3712ece934b4cbacb088c2e3f7c7a3e3c42e15e2d1c4f4c3"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.shortcutContactsPreserved (cognitive 90): routing.shortcutContactsPreserved has cognitive complexity 90 (threshold 15). Drivers by points: if/else 15 (60 pts), boolean chains 16, loops 5 (14 pts) (nesting depth added 54). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/shortcut_routes.go"},"region":{"startLine":300}}}],"partialFingerprints":{"codehealthFindingId/v1":"15fc3248dcc643e770e8a6ba693fd7bfff53ec805b533b152dbeaeb06cc2e44e"}},{"ruleId":"D2","level":"warning","message":{"text":"d2oracle.renameConflictsToParent (cognitive 90): d2oracle.renameConflictsToParent has cognitive complexity 90 (threshold 15). Drivers by points: if/else 23 (67 pts), loops 9 (21 pts), 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":1162}}}],"partialFingerprints":{"codehealthFindingId/v1":"120b8ec31d9f90cb8c0c171bb87cd9aca29160574fcc650c3d8aa8172b3b6561"}},{"ruleId":"D2","level":"warning","message":{"text":"Style.Apply (cognitive 89): Style.Apply has cognitive complexity 89 (threshold 15). Drivers by points: if/else 40 (80 pts), boolean chains 8, 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":313}}}],"partialFingerprints":{"codehealthFindingId/v1":"ddd0c529534780e4032eee43fa850ba7dbbe1c24b07a2c5057d67dd92d38994d"}},{"ruleId":"D2","level":"warning","message":{"text":"gridDiagram.layoutDynamic (cognitive 89): gridDiagram.layoutDynamic has cognitive complexity 89 (threshold 15). Drivers by points: loops 23 (67 pts), if/else 10 (22 pts) (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":337}}}],"partialFingerprints":{"codehealthFindingId/v1":"7bb9a777b3cfcb550384ada0eb6e30d4b64aa356a79065885835ac61bed4da92"}},{"ruleId":"D2","level":"warning","message":{"text":"d2talalayout.validateLayoutResultMetadata (cognitive 89): d2talalayout.validateLayoutResultMetadata has cognitive complexity 89 (threshold 15). Drivers by points: if/else 40 (75 pts), boolean chains 9, loops 5 (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/result_validate.go"},"region":{"startLine":129}}}],"partialFingerprints":{"codehealthFindingId/v1":"c8008e538b2eba435758043e9797b9866ea9baf6c0c51322df6efa89f2c00c08"}},{"ruleId":"D2","level":"warning","message":{"text":"trees.buildPlacementTrees (cognitive 89): trees.buildPlacementTrees has cognitive complexity 89 (threshold 15). Drivers by points: if/else 18 (67 pts), loops 6 (19 pts), boolean chains 3 (nesting depth added 62). To reduce it, split the body into named stages: move each independent step or branch into 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/d2talalayout/internal/trees/layout.go"},"region":{"startLine":1021}}}],"partialFingerprints":{"codehealthFindingId/v1":"3142fc0bfe956e3e3e7696a596ce81b0a68c90a078d17034efce5377863ac9b6"}},{"ruleId":"D2","level":"warning","message":{"text":"Raster.drawPrepared (cognitive 89): Raster.drawPrepared has cognitive complexity 89 (threshold 15). Drivers by points: if/else 24 (71 pts), loops 5 (10 pts), boolean chains 8 (nesting depth added 52). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/raster.go"},"region":{"startLine":928}}}],"partialFingerprints":{"codehealthFindingId/v1":"4141d7945cad9e9d2cca18263500529a3cfbabefe3bdd9b80e23f5835a37c859"}},{"ruleId":"D2","level":"warning","message":{"text":"grouping.ResetClusters (cognitive 87): grouping.ResetClusters has cognitive complexity 87 (threshold 15). Drivers by points: if/else 21 (53 pts), loops 13 (28 pts), boolean chains 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":"d2layouts/d2talalayout/internal/grouping/lifecycle.go"},"region":{"startLine":7}}}],"partialFingerprints":{"codehealthFindingId/v1":"dece799a2b40080c870cc03d3c1e8ce32f3b937835e6aedb3f7f2ca3fa6ba659"}},{"ruleId":"D2","level":"warning","message":{"text":"SystemFallbackResolver.ResolveFallbacks (cognitive 86): SystemFallbackResolver.ResolveFallbacks has cognitive complexity 86 (threshold 15). Drivers by points: if/else 35 (75 pts), loops 4 (9 pts), boolean chains 2 (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2fonts/fallback.go"},"region":{"startLine":121}}}],"partialFingerprints":{"codehealthFindingId/v1":"f56ab90ae5e31a340b8cf5bfe5f2fe1de42df5208bc88130b371489fa8d13a21"}},{"ruleId":"D2","level":"warning","message":{"text":"OVG.connectNodesOnSameLine (cognitive 85): OVG.connectNodesOnSameLine has cognitive complexity 85 (threshold 15). Drivers by points: if/else 28 (73 pts), boolean chains 8, loops 3 (4 pts) (nesting depth added 46). Of this number, 77 points are the body\u0027s own statements and 8 belong to 3 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/ovg.go"},"region":{"startLine":1223}}}],"partialFingerprints":{"codehealthFindingId/v1":"272206094476d7cd07619d6ec5d257233ada6fa32d8fc05dcb3846b5637e865f"}},{"ruleId":"D2","level":"warning","message":{"text":"d2lsp.getKeywordContext (cognitive 85): d2lsp.getKeywordContext has cognitive complexity 85 (threshold 15). Drivers by points: if/else 27 (72 pts), boolean chains 12, loops 1 (nesting depth added 45). To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2lsp/completion.go"},"region":{"startLine":120}}}],"partialFingerprints":{"codehealthFindingId/v1":"6c8598096a3373e6b60b71c493a782b376cdf83490dc4fe448e64704656a4983"}},{"ruleId":"D2","level":"warning","message":{"text":"d2oracle.MoveIDDeltas (cognitive 84): d2oracle.MoveIDDeltas has cognitive complexity 84 (threshold 15). Drivers by points: if/else 27 (63 pts), loops 9 (17 pts), 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, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2oracle/edit.go"},"region":{"startLine":2778}}}],"partialFingerprints":{"codehealthFindingId/v1":"434d8a379818bde093635cee14185347fca5241f74d5a7f3124522214ef4c9c6"}},{"ruleId":"D2","level":"warning","message":{"text":"packing.binPackCanUseRoutedContainerBox (cognitive 83): packing.binPackCanUseRoutedContainerBox has cognitive complexity 83 (threshold 15). Drivers by points: if/else 38 (66 pts), boolean chains 13, 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":"d2layouts/d2talalayout/internal/packing/routed_container.go"},"region":{"startLine":45}}}],"partialFingerprints":{"codehealthFindingId/v1":"e30b7070d7354361cd8851b13ac3b6ef92816a79399dfc7d5781b6ae54be1fe8"}},{"ruleId":"D2","level":"warning","message":{"text":"d2wasm.Render (cognitive 83): d2wasm.Render has cognitive complexity 83 (threshold 15). Drivers by points: if/else 42 (59 pts), boolean chains 20, match/switch 2 (4 pts) (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":"d2js/d2wasm/functions.go"},"region":{"startLine":351}}}],"partialFingerprints":{"codehealthFindingId/v1":"2019616d89080e67111ec2b120f262e2141a519cbd1a42026c21397874244196"}},{"ruleId":"D2","level":"warning","message":{"text":"Nodes.clustersWithWorkGuard (cognitive 82): Nodes.clustersWithWorkGuard has cognitive complexity 82 (threshold 15). Drivers by points: if/else 36 (64 pts), loops 11 (17 pts), boolean chains 1 (nesting depth added 34). Of this number, 57 points are the body\u0027s own statements and 25 belong to 6 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/node.go"},"region":{"startLine":300}}}],"partialFingerprints":{"codehealthFindingId/v1":"0861be9b66fea88e9b4bee559c1cd742f45ce229293daa7ae81468f5486f7770"}},{"ruleId":"D2","level":"warning","message":{"text":"placement.newSizedOptimizer (cognitive 82): placement.newSizedOptimizer has cognitive complexity 82 (threshold 15). Drivers by points: if/else 28 (63 pts), boolean chains 11, loops 5 (8 pts) (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/d2talalayout/internal/placement/sized_optimizer.go"},"region":{"startLine":106}}}],"partialFingerprints":{"codehealthFindingId/v1":"fb57427e733eb8454c8c13417dc080513ccf164b119572422dd082064ff1c66e"}},{"ruleId":"D2","level":"warning","message":{"text":"OVG.halfwayPoints (cognitive 82): OVG.halfwayPoints has cognitive complexity 82 (threshold 15). Drivers by points: if/else 29 (57 pts), loops 10 (20 pts), boolean chains 4, 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":"d2layouts/d2talalayout/internal/routing/ovg.go"},"region":{"startLine":561}}}],"partialFingerprints":{"codehealthFindingId/v1":"6c584cd5c4fdbffd86443401e883452a7226245e3683913eb67536929d2265cf"}},{"ruleId":"D2","level":"warning","message":{"text":"Graph.abductEdges (cognitive 81): Graph.abductEdges has cognitive complexity 81 (threshold 15). Drivers by points: if/else 24 (59 pts), boolean chains 11, loops 7 (11 pts) (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":"d2layouts/d2talalayout/internal/layoutgraph/layout.go"},"region":{"startLine":163}}}],"partialFingerprints":{"codehealthFindingId/v1":"706632a1fff942fda1bffa3e10efbcca60cee7ee45efffec9ac59d760c3ff4bd"}},{"ruleId":"D2","level":"warning","message":{"text":"d2raster.compositeBlendLayerOpaquePrefix (cognitive 81): d2raster.compositeBlendLayerOpaquePrefix has cognitive complexity 81 (threshold 15). Drivers by points: if/else 15 (52 pts), loops 6 (17 pts), match/switch 2 (10 pts), 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":"d2renderers/d2raster/effects.go"},"region":{"startLine":1516}}}],"partialFingerprints":{"codehealthFindingId/v1":"102941be30975cbb1bf6a9ee162f60736bcf2ef5a6d25ec6cf1c74a93cc0de92"}},{"ruleId":"D2","level":"warning","message":{"text":"d2svgimport.inspectEmbeddedJPEG (cognitive 81): d2svgimport.inspectEmbeddedJPEG has cognitive complexity 81 (threshold 15). Drivers by points: if/else 19 (60 pts), loops 4 (10 pts), boolean chains 9, match/switch 1 (2 pts) (nesting depth added 48). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svgimport/image.go"},"region":{"startLine":377}}}],"partialFingerprints":{"codehealthFindingId/v1":"60f3dad55506e33d917c77c79da5a169e7f6889e6530832b321daca1e9b17d53"}},{"ruleId":"D2","level":"warning","message":{"text":"rankSimplex.feasibleTree (cognitive 80): rankSimplex.feasibleTree has cognitive complexity 80 (threshold 15). Drivers by points: if/else 26 (69 pts), loops 6 (10 pts), boolean chains 1 (nesting depth added 47). Of this number, 60 points are the body\u0027s own statements and 20 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/hierarchy/rank_simplex.go"},"region":{"startLine":136}}}],"partialFingerprints":{"codehealthFindingId/v1":"f301027f89f093032668f94067fba2c43c29510f25e89ddeb3e5055bde6217b8"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.applyChannelProblem (cognitive 80): routing.applyChannelProblem has cognitive complexity 80 (threshold 15). Drivers by points: if/else 16 (50 pts), loops 14 (27 pts), boolean chains 3 (nesting depth added 47). Of this number, 79 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/d2talalayout/internal/routing/nudge_channels.go"},"region":{"startLine":441}}}],"partialFingerprints":{"codehealthFindingId/v1":"aaa0d6b880c98b02589435d3e26d905bc99dc751461ab66263cc02efd81ef3ce"}},{"ruleId":"D2","level":"warning","message":{"text":"BundledFallbackResolver.resolve (cognitive 80): BundledFallbackResolver.resolve has cognitive complexity 80 (threshold 15). Drivers by points: if/else 34 (74 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 42). To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2fonts/bundled_fallback.go"},"region":{"startLine":94}}}],"partialFingerprints":{"codehealthFindingId/v1":"63ed4f655fd74496bcdb251365faa28b8249d4365ad4b858e4ecf3a6b2a0907b"}},{"ruleId":"D2","level":"warning","message":{"text":"ovgEdgeRouter.bestRoute (cognitive 79): ovgEdgeRouter.bestRoute has cognitive complexity 79 (threshold 15). Drivers by points: if/else 21 (64 pts), boolean chains 9, loops 3 (6 pts) (nesting depth added 46). To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/ovg_edge_router.go"},"region":{"startLine":1490}}}],"partialFingerprints":{"codehealthFindingId/v1":"2ff3f512d0f5c21bb6cc5d44970186163db92958f4086138204f97a7fc9bc45b"}},{"ruleId":"D2","level":"warning","message":{"text":"d2raster.planNodeResources (cognitive 79): d2raster.planNodeResources has cognitive complexity 79 (threshold 15). Drivers by points: if/else 40 (74 pts), boolean chains 4, loops 1 (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/effects.go"},"region":{"startLine":322}}}],"partialFingerprints":{"codehealthFindingId/v1":"efc6bab7456dde56e0e5c3b8d5c34e1a3a3f5e4fc94f538a90ddabacb3994c38"}},{"ruleId":"D2","level":"warning","message":{"text":"builder.preflightConnection (cognitive 79): builder.preflightConnection has cognitive complexity 79 (threshold 15). Drivers by points: if/else 35 (58 pts), boolean chains 16, loops 3, match/switch 1 (2 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/build.go"},"region":{"startLine":404}}}],"partialFingerprints":{"codehealthFindingId/v1":"8e64e13f24cc77d24f225569a854061b8cd7e506448cce6be19ccb8c7ace8990"}},{"ruleId":"D2","level":"warning","message":{"text":"d2isometricimg.rasterValidate (cognitive 78): d2isometricimg.rasterValidate has cognitive complexity 78 (threshold 15). Drivers by points: if/else 20 (59 pts), boolean chains 10, loops 3 (6 pts), match/switch 1 (3 pts) (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":"d2renderers/d2isometric/d2isometricimg/raster.go"},"region":{"startLine":475}}}],"partialFingerprints":{"codehealthFindingId/v1":"e01478f430a2f13e00a4303f363cbf8fede4fe69a5cabd1d7f7e14ddbc5335bc"}},{"ruleId":"D2","level":"warning","message":{"text":"builder.buildDocument (cognitive 78): builder.buildDocument has cognitive complexity 78 (threshold 15). Drivers by points: if/else 49 (69 pts), boolean chains 5, loops 4 (nesting depth added 20). Of this number, 74 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":"d2renderers/d2scenebuild/build.go"},"region":{"startLine":542}}}],"partialFingerprints":{"codehealthFindingId/v1":"739808b7b9782593d0a67df4b7555ac71da97b6157be8dc278ff9397a07cef4b"}},{"ruleId":"D2","level":"warning","message":{"text":"labeling.findSharedSegmentsChecked (cognitive 77): labeling.findSharedSegmentsChecked has cognitive complexity 77 (threshold 15). Drivers by points: if/else 29 (69 pts), loops 4 (6 pts), boolean chains 2 (nesting depth added 42). Of this number, 36 points are the body\u0027s own statements and 41 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/d2talalayout/internal/labeling/placement.go"},"region":{"startLine":1024}}}],"partialFingerprints":{"codehealthFindingId/v1":"4652453f1870e42a5f0218f3b9b9731482c8c6a81fdb7422b0eb488aa7918cc4"}},{"ruleId":"D2","level":"warning","message":{"text":"GraphState.updateContext (cognitive 77): GraphState.updateContext has cognitive complexity 77 (threshold 15). Drivers by points: if/else 36 (60 pts), loops 10 (14 pts), boolean chains 3 (nesting depth added 28). Of this number, 62 points are the body\u0027s own statements and 15 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/transaction.go"},"region":{"startLine":167}}}],"partialFingerprints":{"codehealthFindingId/v1":"1c41aa0c0b70cc764fb29bdce256e40590250bedc73e689ef576435a22514d5d"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.overshot (cognitive 77): routing.overshot has cognitive complexity 77 (threshold 15). Drivers by points: if/else 24 (60 pts), boolean chains 16, match/switch 1 (nesting depth added 36). The drivers above price the dispatch low by construction \u2014 a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full \u2014 so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/slingshot.go"},"region":{"startLine":219}}}],"partialFingerprints":{"codehealthFindingId/v1":"e4fb03fb1d0793847ae590fa9b0f9a42972aa28aaa8ccefb763ccf937c9c2f06"}},{"ruleId":"D2","level":"warning","message":{"text":"imageasset.validateSVGWithLimits (cognitive 76): imageasset.validateSVGWithLimits has cognitive complexity 76 (threshold 15). Drivers by points: if/else 22 (64 pts), boolean chains 6, loops 2 (4 pts), match/switch 1 (2 pts) (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":"lib/imageasset/probe.go"},"region":{"startLine":457}}}],"partialFingerprints":{"codehealthFindingId/v1":"dea08f9f60e12d98af1be7452b77c20d64e5cbf377c08388288a6cd0eae392f9"}},{"ruleId":"D2","level":"warning","message":{"text":"compiler.compileField (cognitive 75): compiler.compileField has cognitive complexity 75 (threshold 15). Drivers by points: if/else 26 (56 pts), boolean chains 11, loops 3 (8 pts) (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2compiler/compile.go"},"region":{"startLine":651}}}],"partialFingerprints":{"codehealthFindingId/v1":"18d627eb607cba3778bb277ce00001fd360a3344f9b4faf1693ec72a10663b6f"}},{"ruleId":"D2","level":"warning","message":{"text":"d2talalayout.validateD2Edges (cognitive 75): d2talalayout.validateD2Edges has cognitive complexity 75 (threshold 15). Drivers by points: if/else 28 (67 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/adapter_validate.go"},"region":{"startLine":383}}}],"partialFingerprints":{"codehealthFindingId/v1":"9cdde492d7b095a41384f8e559ecc77997e7e55eb3755c2ecd0c1f15f532e6ad"}},{"ruleId":"D2","level":"warning","message":{"text":"packing.allEdgesHaveCompleteRoutesGuarded (cognitive 75): packing.allEdgesHaveCompleteRoutesGuarded has cognitive complexity 75 (threshold 15). Drivers by points: if/else 29 (60 pts), loops 6 (8 pts), boolean chains 7 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/packing/guard.go"},"region":{"startLine":471}}}],"partialFingerprints":{"codehealthFindingId/v1":"3f6c6a6d34d6a871576386a8ee9b8ca479df5540d9cacb3237b3f9967fe8590e"}},{"ruleId":"D2","level":"warning","message":{"text":"placement.initializeByGraphDistance (cognitive 75): placement.initializeByGraphDistance has cognitive complexity 75 (threshold 15). Drivers by points: if/else 14 (39 pts), loops 19 (33 pts), boolean chains 3 (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/stress_initialize.go"},"region":{"startLine":16}}}],"partialFingerprints":{"codehealthFindingId/v1":"105bac54cd164ae7efaefda91cd88b0389fcc952ef21f9040eb7a1ef78814a83"}},{"ruleId":"D2","level":"warning","message":{"text":"preflight.positionGlyphs (cognitive 75): preflight.positionGlyphs has cognitive complexity 75 (threshold 15). Drivers by points: if/else 27 (60 pts), loops 5 (11 pts), 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":"d2renderers/d2raster/text.go"},"region":{"startLine":456}}}],"partialFingerprints":{"codehealthFindingId/v1":"895961d0fa2049a42dbea3baaca8ec547b6702ea400c72cdfac88bde68bfc043"}},{"ruleId":"D2","level":"warning","message":{"text":"pathParser.parseGroup (cognitive 75): pathParser.parseGroup has cognitive complexity 75 (threshold 15). Drivers by points: if/else 35 (68 pts), boolean chains 6, match/switch 1 (nesting depth added 33). Of this number, 74 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":"d2renderers/d2svgimport/path.go"},"region":{"startLine":131}}}],"partialFingerprints":{"codehealthFindingId/v1":"fbe21f1b95192845bc0705542de0ea4c23a69ad8995aa680648dcd632a2c3c83"}},{"ruleId":"D2","level":"warning","message":{"text":"d2raster.multiplyLayerByRGBALuminance (cognitive 74): d2raster.multiplyLayerByRGBALuminance has cognitive complexity 74 (threshold 15). Drivers by points: if/else 12 (37 pts), loops 9 (28 pts), boolean chains 5, match/switch 1 (4 pts) (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":"d2renderers/d2raster/effects.go"},"region":{"startLine":1117}}}],"partialFingerprints":{"codehealthFindingId/v1":"94cc2a5ac12dacde885b5eec8d4b6f2d0ada7368e61da0062de0b57dae099c26"}},{"ruleId":"D2","level":"warning","message":{"text":"Rasterizer.WriteAlpha (cognitive 74): Rasterizer.WriteAlpha has cognitive complexity 74 (threshold 15). Drivers by points: if/else 15 (46 pts), loops 6 (23 pts), boolean chains 5 (nesting depth added 48). Most of this is not in the body itself: 6 of the 74 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 737, 781). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals\u0027 work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/internal/scanline/rasterizer.go"},"region":{"startLine":724}}}],"partialFingerprints":{"codehealthFindingId/v1":"b5823ec4a204d1e978c5785a7ee471ccb174e105ad51b1d314f453d1842cd9a5"}},{"ruleId":"D2","level":"warning","message":{"text":"sizedOptimizer.moveNodeToBestGuarded (cognitive 73): sizedOptimizer.moveNodeToBestGuarded has cognitive complexity 73 (threshold 15). Drivers by points: if/else 25 (59 pts), boolean chains 7, loops 2 (4 pts), match/switch 1 (3 pts) (nesting depth added 38). Of this number, 72 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/d2talalayout/internal/placement/sized_optimizer.go"},"region":{"startLine":887}}}],"partialFingerprints":{"codehealthFindingId/v1":"0b0c029746a36a3239a22ad824060e1d23c6eecff7cfc815c92fe1028e4794b4"}},{"ruleId":"D2","level":"warning","message":{"text":"ovgEdgeRouter.usedPorts (cognitive 73): ovgEdgeRouter.usedPorts has cognitive complexity 73 (threshold 15). Drivers by points: if/else 15 (57 pts), loops 5 (14 pts), boolean chains 2 (nesting depth added 51). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/ovg_edge_router.go"},"region":{"startLine":465}}}],"partialFingerprints":{"codehealthFindingId/v1":"b7c7d0f3cd345f2b47b571730bf67a25b1655a4edae817dadbc3ca98361fea0c"}},{"ruleId":"D2","level":"warning","message":{"text":"xgif.validatePalettedImage (cognitive 73): xgif.validatePalettedImage has cognitive complexity 73 (threshold 15). Drivers by points: if/else 25 (55 pts), loops 8 (16 pts), boolean chains 2 (nesting depth added 38). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/xgif/xgif.go"},"region":{"startLine":1341}}}],"partialFingerprints":{"codehealthFindingId/v1":"794fb99d2ffd36672f07cc17bcefdd44195bde4739ecc8c586c905aec421e8b7"}},{"ruleId":"D2","level":"warning","message":{"text":"d2talalayout.validateD2Objects (cognitive 72): d2talalayout.validateD2Objects has cognitive complexity 72 (threshold 15). Drivers by points: if/else 28 (66 pts), boolean chains 5, loops 1 (nesting depth added 38). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/adapter_validate.go"},"region":{"startLine":100}}}],"partialFingerprints":{"codehealthFindingId/v1":"f969e922ff25ccc2915b33cc1adb47a709e519fd38834d3820e2203ac7cebc27"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.captureRouteMutations (cognitive 72): routing.captureRouteMutations has cognitive complexity 72 (threshold 15). Drivers by points: if/else 24 (52 pts), loops 9 (20 pts) (nesting depth added 39). Of this number, 62 points are the body\u0027s own statements and 10 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/route_stage_guard.go"},"region":{"startLine":147}}}],"partialFingerprints":{"codehealthFindingId/v1":"ab8ed9dc4d8cc11c935be57aaf87832141f110de16fc664cc6bf562e0c488005"}},{"ruleId":"D2","level":"warning","message":{"text":"d2oracle.ReconnectEdge (cognitive 72): d2oracle.ReconnectEdge has cognitive complexity 72 (threshold 15). Drivers by points: if/else 34 (62 pts), boolean chains 7, loops 2 (3 pts) (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":"builder.buildShape (cognitive 72): builder.buildShape has cognitive complexity 72 (threshold 15). Drivers by points: if/else 39 (68 pts), boolean chains 4 (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/d2scenebuild/build.go"},"region":{"startLine":828}}}],"partialFingerprints":{"codehealthFindingId/v1":"e892746ea15e905a04e5f6fda04b43353d657e80b5ab12604853d776a5a5eeff"}},{"ruleId":"D2","level":"warning","message":{"text":"sizedOptimizer.bestSwapCandidateGuarded (cognitive 71): sizedOptimizer.bestSwapCandidateGuarded has cognitive complexity 71 (threshold 15). Drivers by points: if/else 34 (66 pts), boolean chains 3, loops 2 (nesting depth added 32). Of this number, 42 points are the body\u0027s own statements and 29 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/d2talalayout/internal/placement/sized_optimizer.go"},"region":{"startLine":1027}}}],"partialFingerprints":{"codehealthFindingId/v1":"fd6a348c27eefc2dde3de3ab1b4ea3c4be4125f063f178e9d899b6b0fbc369d0"}},{"ruleId":"D2","level":"warning","message":{"text":"trees.placeAtOrientationGuarded (cognitive 71): trees.placeAtOrientationGuarded has cognitive complexity 71 (threshold 15). Drivers by points: if/else 30 (55 pts), boolean chains 7, loops 6 (7 pts), match/switch 2 (nesting depth added 26). Of this number, 59 points are the body\u0027s own statements and 12 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/trees/layout.go"},"region":{"startLine":399}}}],"partialFingerprints":{"codehealthFindingId/v1":"129972e51f88b66e28928c921ed407e68f604cd34bed647065214c71e1c95810"}},{"ruleId":"D2","level":"warning","message":{"text":"compiler.validateNear (cognitive 70): compiler.validateNear has cognitive complexity 70 (threshold 15). Drivers by points: if/else 18 (58 pts), loops 4 (10 pts), boolean chains 2 (nesting depth added 46). To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2compiler/compile.go"},"region":{"startLine":1585}}}],"partialFingerprints":{"codehealthFindingId/v1":"df5de6bb9135b40f1fe75e7caef4ab16667b3ea7323ecefad5738d52ef82f00e"}},{"ruleId":"D2","level":"warning","message":{"text":"hierarchy.is1N1 (cognitive 70): hierarchy.is1N1 has cognitive complexity 70 (threshold 15). Drivers by points: if/else 27 (61 pts), loops 5 (6 pts), boolean chains 3 (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/hierarchy/discovery.go"},"region":{"startLine":367}}}],"partialFingerprints":{"codehealthFindingId/v1":"c7ce3d41bcd97846d2ff2e304fa90dc2c9a1713479367f0b458f32ddd6d4f036"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.shortcutRoutesGuarded (cognitive 70): routing.shortcutRoutesGuarded has cognitive complexity 70 (threshold 15). Drivers by points: if/else 18 (53 pts), loops 5 (12 pts), boolean chains 5 (nesting depth added 42). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/shortcut_routes.go"},"region":{"startLine":69}}}],"partialFingerprints":{"codehealthFindingId/v1":"14f7fd31d116f5d1ed5369015aa2dff4939285a624921440c34fe3a046e59d29"}},{"ruleId":"D2","level":"warning","message":{"text":"d2isometricimg.rasterBuildShadow (cognitive 70): d2isometricimg.rasterBuildShadow has cognitive complexity 70 (threshold 15). Drivers by points: if/else 20 (52 pts), loops 6 (10 pts), boolean chains 8 (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/d2isometric/d2isometricimg/raster.go"},"region":{"startLine":691}}}],"partialFingerprints":{"codehealthFindingId/v1":"b99ca33e3b9cc50d281dd4a6c984e0314d1ae813a69f984174b330d98fe08381"}},{"ruleId":"D2","level":"warning","message":{"text":"d2grid.Layout (cognitive 69): d2grid.Layout has cognitive complexity 69 (threshold 15). Drivers by points: if/else 26 (51 pts), boolean chains 11, match/switch 2 (6 pts), 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":23}}}],"partialFingerprints":{"codehealthFindingId/v1":"9d1aefbf6dca454cbb688a8a46b6d9aa6be254dec1b5cc4f8262cbdb5745acb6"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.swapEdgesOnAdjacentSides (cognitive 69): routing.swapEdgesOnAdjacentSides has cognitive complexity 69 (threshold 15). Drivers by points: if/else 24 (65 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 42). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/swap_ports.go"},"region":{"startLine":541}}}],"partialFingerprints":{"codehealthFindingId/v1":"4355f94f927a02669b1b65e867314495c7d9dd104f965291a9c7e1f93cf09376"}},{"ruleId":"D2","level":"warning","message":{"text":"d2oracle.deleteObject (cognitive 69): d2oracle.deleteObject has cognitive complexity 69 (threshold 15). Drivers by points: if/else 22 (54 pts), boolean chains 9, loops 3 (6 pts) (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, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2oracle/edit.go"},"region":{"startLine":1523}}}],"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 20 (67 pts), boolean chains 1, loops 1 (nesting depth added 47). To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2oracle/edit.go"},"region":{"startLine":3354}}}],"partialFingerprints":{"codehealthFindingId/v1":"9dd60311c6d70411a29055e42f35ca381bd7bd2b90ec23c634521a8c49dd66f9"}},{"ruleId":"D2","level":"warning","message":{"text":"d2raster.boxBlurRGBAGeneral (cognitive 69): d2raster.boxBlurRGBAGeneral has cognitive complexity 69 (threshold 15). Drivers by points: if/else 15 (48 pts), loops 6 (15 pts), boolean chains 6 (nesting depth added 42). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/filter.go"},"region":{"startLine":653}}}],"partialFingerprints":{"codehealthFindingId/v1":"d89dd78683cc7df4bd7623c39ad37d8fb53589b43da8f13e390530e555d4783d"}},{"ruleId":"D2","level":"warning","message":{"text":"d2raster.boxBlurAlphaPixelsGeneral (cognitive 69): d2raster.boxBlurAlphaPixelsGeneral has cognitive complexity 69 (threshold 15). Drivers by points: if/else 15 (48 pts), loops 6 (15 pts), boolean chains 6 (nesting depth added 42). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/filter.go"},"region":{"startLine":838}}}],"partialFingerprints":{"codehealthFindingId/v1":"489efd3baa008c2e2dcdd6ce03277c5645f23e5a55614df59578c76109b1911e"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.edgeCanOverlapEdges (cognitive 68): routing.edgeCanOverlapEdges has cognitive complexity 68 (threshold 15). Drivers by points: if/else 23 (44 pts), loops 8 (14 pts), boolean chains 10 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/coordinator.go"},"region":{"startLine":1208}}}],"partialFingerprints":{"codehealthFindingId/v1":"d5483d32e4900748e51b45a3fc3ac2ac87fbbe042df37ffccf3659e6b9d88c90"}},{"ruleId":"D2","level":"warning","message":{"text":"Canvas.ToByteArray (cognitive 68): Canvas.ToByteArray has cognitive complexity 68 (threshold 15). Drivers by points: if/else 18 (43 pts), loops 9 (18 pts), 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":"SystemFallbackResolver.fontPaths (cognitive 68): SystemFallbackResolver.fontPaths has cognitive complexity 68 (threshold 15). Drivers by points: if/else 14 (57 pts), loops 4 (10 pts), boolean chains 1 (nesting depth added 49). To reduce it, split the body into named stages: move each independent step or branch into 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/fallback.go"},"region":{"startLine":338}}}],"partialFingerprints":{"codehealthFindingId/v1":"8308218843c09f7717a1ed80fceac0a8b8dc2ab944c0bd8894c7ecc39b0a7837"}},{"ruleId":"D2","level":"warning","message":{"text":"d2raster.multiplyLayerByRGBAAlpha (cognitive 68): d2raster.multiplyLayerByRGBAAlpha has cognitive complexity 68 (threshold 15). Drivers by points: if/else 11 (36 pts), loops 7 (22 pts), boolean chains 7, match/switch 1 (3 pts) (nesting depth added 42). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/effects.go"},"region":{"startLine":1237}}}],"partialFingerprints":{"codehealthFindingId/v1":"202c4310c34c18210a0d3be9a0ca39d594dba5b3af2f9e4ecea872000b13e35e"}},{"ruleId":"D2","level":"warning","message":{"text":"Node.ConnectedNodeSet (cognitive 67): Node.ConnectedNodeSet has cognitive complexity 67 (threshold 15). Drivers by points: if/else 13 (30 pts), loops 14 (30 pts), boolean chains 7 (nesting depth added 33). Of this number, 66 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/d2talalayout/internal/layoutgraph/connected_set.go"},"region":{"startLine":25}}}],"partialFingerprints":{"codehealthFindingId/v1":"4b722b94a6d1605e333a5f5a5cdaf650bb1377563172e3ea1d02f6881db0c4df"}},{"ruleId":"D2","level":"warning","message":{"text":"placement.captureOptimizerMutationStateInto (cognitive 67): placement.captureOptimizerMutationStateInto has cognitive complexity 67 (threshold 15). Drivers by points: if/else 28 (52 pts), loops 8 (13 pts), boolean chains 2 (nesting depth added 29). Of this number, 63 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":"d2layouts/d2talalayout/internal/placement/optimization_guard.go"},"region":{"startLine":814}}}],"partialFingerprints":{"codehealthFindingId/v1":"874e66dd2167415faf97baa24635dcd68d4cdca5abd0ad5983c60bfee3ffbe8c"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.newOVGPortIndex (cognitive 67): routing.newOVGPortIndex has cognitive complexity 67 (threshold 15). Drivers by points: if/else 15 (48 pts), loops 8 (15 pts), boolean chains 4 (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/ovg_resource.go"},"region":{"startLine":690}}}],"partialFingerprints":{"codehealthFindingId/v1":"225c2a5ac77632be6df06eb4f18213cbaef6ed88a1b253fff1f5e26b4f895e07"}},{"ruleId":"D2","level":"warning","message":{"text":"markdownPainter.markdownInlineLineHeight (cognitive 67): markdownPainter.markdownInlineLineHeight has cognitive complexity 67 (threshold 15). Drivers by points: if/else 21 (57 pts), boolean chains 5, loops 2 (5 pts) (nesting depth added 39). To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/textmeasure/markdown_svg.go"},"region":{"startLine":875}}}],"partialFingerprints":{"codehealthFindingId/v1":"5b872faed8c8318a8d1a292e766681f79cd62e06674763b83df7229a107c9fd7"}},{"ruleId":"D2","level":"warning","message":{"text":"Map.getEdges (cognitive 66): Map.getEdges has cognitive complexity 66 (threshold 15). Drivers by points: if/else 19 (48 pts), loops 6 (13 pts), boolean chains 5 (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":"d2ir/d2ir.go"},"region":{"startLine":1593}}}],"partialFingerprints":{"codehealthFindingId/v1":"1b32d370453070dd0cdab9ed63a3377befaffd8f1a3f64f57a35d81372c36b61"}},{"ruleId":"D2","level":"warning","message":{"text":"layoutgraph.countSegmentCrossingsWithCheck (cognitive 66): layoutgraph.countSegmentCrossingsWithCheck has cognitive complexity 66 (threshold 15). Drivers by points: if/else 20 (62 pts), loops 2 (3 pts), 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":"d2layouts/d2talalayout/internal/layoutgraph/segment_crossing.go"},"region":{"startLine":54}}}],"partialFingerprints":{"codehealthFindingId/v1":"0d789f4f21bb92cf5eb668a2fc216e2dc0ab363b200aa01d0f7b9b27c39e710b"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.buildTunnelsBetween (cognitive 66): routing.buildTunnelsBetween has cognitive complexity 66 (threshold 15). Drivers by points: if/else 23 (57 pts), loops 4 (8 pts), boolean chains 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":"d2layouts/d2talalayout/internal/routing/tunnel.go"},"region":{"startLine":263}}}],"partialFingerprints":{"codehealthFindingId/v1":"f5f053c55aa518fb273440c8036fee8a7b8c094a0d7eba73acb8b0b628bd2ed4"}},{"ruleId":"D2","level":"warning","message":{"text":"OVG.flagNodesNearPorts (cognitive 66): OVG.flagNodesNearPorts has cognitive complexity 66 (threshold 15). Drivers by points: if/else 13 (51 pts), loops 5 (13 pts), boolean chains 2 (nesting depth added 46). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/ovg.go"},"region":{"startLine":1540}}}],"partialFingerprints":{"codehealthFindingId/v1":"04eb4b23f796aeacb563c4651bcf6dae57f71c04300315d0759f4783efbea65c"}},{"ruleId":"D2","level":"warning","message":{"text":"hierarchy.PlaceCompound (cognitive 65): hierarchy.PlaceCompound has cognitive complexity 65 (threshold 15). Drivers by points: if/else 29 (47 pts), loops 8 (10 pts), boolean chains 8 (nesting depth added 20). Of this number, 64 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/d2talalayout/internal/hierarchy/compound.go"},"region":{"startLine":39}}}],"partialFingerprints":{"codehealthFindingId/v1":"9e450deb6363c50df02182d3c804647e25b31aab92ade57c12310e6db7cf328a"}},{"ruleId":"D2","level":"warning","message":{"text":"labeling.placeNewEdges (cognitive 65): labeling.placeNewEdges has cognitive complexity 65 (threshold 15). Drivers by points: if/else 28 (52 pts), loops 7, boolean chains 6 (nesting depth added 24). Of this number, 63 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/labeling/placement.go"},"region":{"startLine":462}}}],"partialFingerprints":{"codehealthFindingId/v1":"dc6edf4bd63eecc2f32c1cd2e4bae079343d4f6a4a51298f07d2c7d05f5f55ea"}},{"ruleId":"D2","level":"warning","message":{"text":"placementcost.EdgeLength (cognitive 65): placementcost.EdgeLength has cognitive complexity 65 (threshold 15). Drivers by points: if/else 22 (56 pts), loops 4 (9 pts) (nesting depth added 39). Of this number, 37 points are the body\u0027s own statements and 28 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placementcost/graph.go"},"region":{"startLine":111}}}],"partialFingerprints":{"codehealthFindingId/v1":"9558abb86f935f87ebea72e75da32cf29d75c4f142b70ad41ecc9799b53dfab6"}},{"ruleId":"D2","level":"warning","message":{"text":"trees.putBackNonBranchingTrees (cognitive 65): trees.putBackNonBranchingTrees has cognitive complexity 65 (threshold 15). Drivers by points: if/else 18 (56 pts), loops 3 (6 pts), boolean chains 3 (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":"d2layouts/d2talalayout/internal/trees/layout.go"},"region":{"startLine":573}}}],"partialFingerprints":{"codehealthFindingId/v1":"dd4ccab43f82e03dfa3fa746c0978331b330857a081271c5a4397f1b3cfc3ddc"}},{"ruleId":"D2","level":"warning","message":{"text":"d2isometricimg.hierarchyBoardHeaderPlacement (cognitive 65): d2isometricimg.hierarchyBoardHeaderPlacement has cognitive complexity 65 (threshold 15). Drivers by points: if/else 23 (41 pts), boolean chains 14, loops 5 (7 pts), match/switch 1 (3 pts) (nesting depth added 22). Of this number, 60 points are the body\u0027s own statements and 5 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/hierarchy_headers.go"},"region":{"startLine":25}}}],"partialFingerprints":{"codehealthFindingId/v1":"14d9805d25d4b37997bbb0d375799d480b156c72f509c425dd959008d3ef899f"}},{"ruleId":"D2","level":"warning","message":{"text":"compiler.compilePosition (cognitive 64): compiler.compilePosition has cognitive complexity 64 (threshold 15). Drivers by points: if/else 13 (36 pts), match/switch 4 (25 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 45). To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2compiler/compile.go"},"region":{"startLine":798}}}],"partialFingerprints":{"codehealthFindingId/v1":"dbd3e73414cba3aaf0bc806b98985e3111325df389ee063695c6ea84ab7c81d5"}},{"ruleId":"D2","level":"warning","message":{"text":"sizedOptimizer.fillPlacementPointsGuarded (cognitive 64): sizedOptimizer.fillPlacementPointsGuarded has cognitive complexity 64 (threshold 15). Drivers by points: if/else 27 (50 pts), loops 5 (8 pts), boolean chains 6 (nesting depth added 26). Of this number, 57 points are the body\u0027s own statements and 7 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/sized_optimizer.go"},"region":{"startLine":715}}}],"partialFingerprints":{"codehealthFindingId/v1":"f46fb0208cd00143955f13e6d47c23f4ee421c1491d23181f1350df0458a7565"}},{"ruleId":"D2","level":"warning","message":{"text":"proximity.GroupSheep (cognitive 64): proximity.GroupSheep has cognitive complexity 64 (threshold 15). Drivers by points: if/else 17 (49 pts), boolean chains 9, loops 3 (6 pts) (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/proximity/herding.go"},"region":{"startLine":237}}}],"partialFingerprints":{"codehealthFindingId/v1":"20d6311a95b95ec67863655c3428bd8895ea5954dd7af6fb85b221998af13106"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.simplifyPoints (cognitive 64): routing.simplifyPoints has cognitive complexity 64 (threshold 15). Drivers by points: if/else 12 (33 pts), boolean chains 24, loops 3 (7 pts) (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":"d2layouts/d2talalayout/internal/routing/edge_simplify.go"},"region":{"startLine":37}}}],"partialFingerprints":{"codehealthFindingId/v1":"8b1e54d9179e486d4477d47e9fa9ab75339e77e94fd7e3afeca3bcd8d2cb49b3"}},{"ruleId":"D2","level":"warning","message":{"text":"svgImporter.validateXMLDeclaration (cognitive 64): svgImporter.validateXMLDeclaration has cognitive complexity 64 (threshold 15). Drivers by points: if/else 22 (46 pts), boolean chains 12, loops 4 (6 pts) (nesting depth added 26). Of this number, 57 points are the body\u0027s own statements and 7 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svgimport/import.go"},"region":{"startLine":604}}}],"partialFingerprints":{"codehealthFindingId/v1":"16bc265f149cafcbfdb296a466e72137c7339fd82bebbc2264b5f29436624892"}},{"ruleId":"D2","level":"warning","message":{"text":"placement.PlaceChildrenOrder (cognitive 63): placement.PlaceChildrenOrder has cognitive complexity 63 (threshold 15). Drivers by points: if/else 22 (51 pts), loops 7 (11 pts), boolean chains 1 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/node_placement.go"},"region":{"startLine":461}}}],"partialFingerprints":{"codehealthFindingId/v1":"d9b1847ed368860e766a4d56c184cf281bb167ad06b3d0e55dc35e989a7708e1"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.reorderSelectedRoutes (cognitive 63): routing.reorderSelectedRoutes has cognitive complexity 63 (threshold 15). Drivers by points: if/else 23 (54 pts), loops 6 (9 pts) (nesting depth added 34). Of this number, 52 points are the body\u0027s own statements and 11 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/coordinator.go"},"region":{"startLine":305}}}],"partialFingerprints":{"codehealthFindingId/v1":"787a522cd9b5a61936eb5fac9ed233a47eb629f916df14da4280de6645f6165f"}},{"ruleId":"D2","level":"warning","message":{"text":"nativeSurfaceSVGWriter.text (cognitive 63): nativeSurfaceSVGWriter.text has cognitive complexity 63 (threshold 15). Drivers by points: if/else 26 (50 pts), loops 5 (10 pts), boolean chains 3 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/vector_surface_text.go"},"region":{"startLine":49}}}],"partialFingerprints":{"codehealthFindingId/v1":"cb1f3827920a7e89a63b076a9fefd25eb0140ef91052ac08a5d288e9aa524594"}},{"ruleId":"D2","level":"warning","message":{"text":"preflight.finishPrimitive (cognitive 63): preflight.finishPrimitive has cognitive complexity 63 (threshold 15). Drivers by points: if/else 17 (44 pts), loops 8 (17 pts), boolean chains 2 (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/d2raster/raster.go"},"region":{"startLine":1327}}}],"partialFingerprints":{"codehealthFindingId/v1":"c64e98ba7767157be621137c56d69adce8d7835a6a686cf7ce7d05ce86a5c857"}},{"ruleId":"D2","level":"warning","message":{"text":"markdownSubstitutionMatcher.replaceBounded (cognitive 63): markdownSubstitutionMatcher.replaceBounded has cognitive complexity 63 (threshold 15). Drivers by points: if/else 23 (52 pts), loops 6 (8 pts), boolean chains 3 (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":"lib/textmeasure/substitutions.go"},"region":{"startLine":214}}}],"partialFingerprints":{"codehealthFindingId/v1":"2a22f9a0b49d6a22d79b51b6de2a7c153c66c00319940b007fab14aca79c7ec0"}},{"ruleId":"D2","level":"warning","message":{"text":"Key.Equals (cognitive 62): Key.Equals has cognitive complexity 62 (threshold 15). Drivers by points: if/else 31 (50 pts), loops 4 (7 pts), 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":"compiler.compileSubstitutionsWalk (cognitive 62): compiler.compileSubstitutionsWalk has cognitive complexity 62 (threshold 15). Drivers by points: if/else 23 (54 pts), loops 4 (6 pts), boolean chains 2 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ir/compile.go"},"region":{"startLine":270}}}],"partialFingerprints":{"codehealthFindingId/v1":"3511c1e7387d6b0af786038dfdea438509341197260385f96a8bbf70f8e4fed3"}},{"ruleId":"D2","level":"warning","message":{"text":"d2dagrelayout.shiftDown (cognitive 62): d2dagrelayout.shiftDown has cognitive complexity 62 (threshold 15). Drivers by points: if/else 14 (44 pts), loops 6 (14 pts), 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. This shape REPEATS in the file: one other method here (d2dagrelayout.shiftUp) has the same decision points, in the same order, at the same nesting depths \u2014 so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2dagrelayout/layout.go"},"region":{"startLine":664}}}],"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 14 (44 pts), loops 6 (14 pts), 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. This shape REPEATS in the file: one other method here (d2dagrelayout.shiftDown) has the same decision points, in the same order, at the same nesting depths \u2014 so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2dagrelayout/layout.go"},"region":{"startLine":728}}}],"partialFingerprints":{"codehealthFindingId/v1":"cf26384dcd1a11fdddd2db6a1bb4db96164bc3f721fe3ac994702b8a67c7d753"}},{"ruleId":"D2","level":"warning","message":{"text":"placement.alignAxes (cognitive 62): placement.alignAxes has cognitive complexity 62 (threshold 15). Drivers by points: if/else 24 (48 pts), loops 6 (9 pts), boolean chains 5 (nesting depth added 27). Of this number, 59 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/d2talalayout/internal/placement/alignment.go"},"region":{"startLine":26}}}],"partialFingerprints":{"codehealthFindingId/v1":"21a73d6b230caf6ace306f66ca6545779ec742bd3cdee328cd61ea2c8fa17c33"}},{"ruleId":"D2","level":"warning","message":{"text":"placement.candidateMoves (cognitive 62): placement.candidateMoves has cognitive complexity 62 (threshold 15). Drivers by points: if/else 33 (56 pts), boolean chains 5, 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":"d2layouts/d2talalayout/internal/placement/compaction.go"},"region":{"startLine":577}}}],"partialFingerprints":{"codehealthFindingId/v1":"aae48790ad4c01520f019d1946967cd413e700df8db642327dd84ef7a53cc120"}},{"ruleId":"D2","level":"warning","message":{"text":"placementcost.computeSymmetryScoreInto (cognitive 62): placementcost.computeSymmetryScoreInto has cognitive complexity 62 (threshold 15). Drivers by points: if/else 21 (54 pts), loops 3 (6 pts), boolean chains 2 (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":"d2layouts/d2talalayout/internal/placementcost/symmetry.go"},"region":{"startLine":397}}}],"partialFingerprints":{"codehealthFindingId/v1":"78efd42f146396a4f0d464d8a3d8e1bca46e5fcc58683a9b3575f76efeaef2ca"}},{"ruleId":"D2","level":"warning","message":{"text":"svgImporter.compileGeometry (cognitive 62): svgImporter.compileGeometry has cognitive complexity 62 (threshold 15). Drivers by points: if/else 29 (57 pts), boolean chains 4, match/switch 1 (nesting depth added 28). 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":"d2renderers/d2svgimport/geometry.go"},"region":{"startLine":33}}}],"partialFingerprints":{"codehealthFindingId/v1":"027bacd4113552e97496f36370caa4e8a6c6c74a8c52792354412663ec9fafec"}},{"ruleId":"D2","level":"warning","message":{"text":"d2exporter.applyTheme (cognitive 61): d2exporter.applyTheme has cognitive complexity 61 (threshold 15). Drivers by points: if/else 23 (54 pts), 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":"placementcost.AxisScore (cognitive 61): placementcost.AxisScore has cognitive complexity 61 (threshold 15). Drivers by points: if/else 23 (48 pts), loops 7 (13 pts) (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":"d2layouts/d2talalayout/internal/placementcost/axis.go"},"region":{"startLine":11}}}],"partialFingerprints":{"codehealthFindingId/v1":"8673bb0b93cabf86cdff497f028017aead725174b9ece5c4b943220452ea0836"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.routeEdgesWithBudgets (cognitive 61): routing.routeEdgesWithBudgets has cognitive complexity 61 (threshold 15). Drivers by points: if/else 33 (52 pts), loops 8, boolean chains 1 (nesting depth added 19). Of this number, 33 points are the body\u0027s own statements and 28 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/standalone_router.go"},"region":{"startLine":27}}}],"partialFingerprints":{"codehealthFindingId/v1":"acbc63276586ca3e5035c24cbbe5494dce8245403b271864aef33ce683c4c85a"}},{"ruleId":"D2","level":"warning","message":{"text":"d2oracle.deleteReserved (cognitive 61): d2oracle.deleteReserved has cognitive complexity 61 (threshold 15). Drivers by points: if/else 22 (55 pts), 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":1313}}}],"partialFingerprints":{"codehealthFindingId/v1":"e9e059e10548ef6cdabd6e88ea51d224b933e2eab9dfa2cf8af51ae0f17b6fe5"}},{"ruleId":"D2","level":"warning","message":{"text":"meshBuilder.sequenceEdge (cognitive 61): meshBuilder.sequenceEdge has cognitive complexity 61 (threshold 15). Drivers by points: if/else 18 (39 pts), boolean chains 12, loops 5 (10 pts) (nesting depth added 26). To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/sequence_routes.go"},"region":{"startLine":175}}}],"partialFingerprints":{"codehealthFindingId/v1":"d0b3950dc5aadecdec5d0839400effd76b4246c61ec1bbae984b65f36a326f73"}},{"ruleId":"D2","level":"warning","message":{"text":"d2dagrelayout.adjustCrossRankSpacing (cognitive 60): d2dagrelayout.adjustCrossRankSpacing has cognitive complexity 60 (threshold 15). Drivers by points: if/else 17 (43 pts), loops 5 (17 pts) (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":1306}}}],"partialFingerprints":{"codehealthFindingId/v1":"326e73940eaa018d8458026836ec611e0e785aa73fdd4f09b92c3f8b6cb277f5"}},{"ruleId":"D2","level":"warning","message":{"text":"placement.placeNodesOrthogonally (cognitive 60): placement.placeNodesOrthogonally has cognitive complexity 60 (threshold 15). Drivers by points: if/else 27 (45 pts), loops 8 (12 pts), boolean chains 3 (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":"d2layouts/d2talalayout/internal/placement/node_placement.go"},"region":{"startLine":246}}}],"partialFingerprints":{"codehealthFindingId/v1":"c661b7eb905bc5b9770f7561dcdfc6ee3668fe40d7c678abe917b4150095e5a9"}},{"ruleId":"D2","level":"warning","message":{"text":"OVGNode.hasUnobstructedLineToPorts (cognitive 60): OVGNode.hasUnobstructedLineToPorts has cognitive complexity 60 (threshold 15). Drivers by points: if/else 15 (47 pts), boolean chains 7, loops 3 (6 pts) (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/ovg_node.go"},"region":{"startLine":184}}}],"partialFingerprints":{"codehealthFindingId/v1":"80cb787a5c30c19ceca5acb060521e530547d5fb654463dabda7e1c52872ad24"}},{"ruleId":"D2","level":"warning","message":{"text":"preflight.node (cognitive 60): preflight.node has cognitive complexity 60 (threshold 15). Drivers by points: if/else 33 (49 pts), boolean chains 7, loops 2, match/switch 1 (2 pts) (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":"d2renderers/d2raster/raster.go"},"region":{"startLine":977}}}],"partialFingerprints":{"codehealthFindingId/v1":"a2f2d802cead31635fdb6652927648e11f18168d6c4f39e7a410920b01395bce"}},{"ruleId":"D2","level":"warning","message":{"text":"placement.captureOptimizerNodePositions (cognitive 59): placement.captureOptimizerNodePositions has cognitive complexity 59 (threshold 15). Drivers by points: if/else 16 (44 pts), loops 6 (14 pts), boolean chains 1 (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/optimization_guard.go"},"region":{"startLine":962}}}],"partialFingerprints":{"codehealthFindingId/v1":"7e701a8a86cc762a9aad6c1a7734d16a7d8eaa1b7987930dd8191e7add92f113"}},{"ruleId":"D2","level":"warning","message":{"text":"svgImporter.stylesheetDeclarations (cognitive 59): svgImporter.stylesheetDeclarations has cognitive complexity 59 (threshold 15). Drivers by points: if/else 20 (50 pts), loops 4 (7 pts), boolean chains 2 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svgimport/stylesheet.go"},"region":{"startLine":185}}}],"partialFingerprints":{"codehealthFindingId/v1":"ab7b6fd3938a52873891a8e932214b7bfcaf7c106aa14130b1b867d2349ec108"}},{"ruleId":"D2","level":"warning","message":{"text":"rasterimage.buildFramePNG (cognitive 59): rasterimage.buildFramePNG has cognitive complexity 59 (threshold 15). Drivers by points: if/else 23 (52 pts), boolean chains 4, match/switch 1 (2 pts), loops 1 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/rasterimage/firstframe.go"},"region":{"startLine":524}}}],"partialFingerprints":{"codehealthFindingId/v1":"c9f31913371e1b7051d9d33d0e3e9feaaf1c7cb38bd91d9cbe805075af85dd55"}},{"ruleId":"D2","level":"warning","message":{"text":"MarkdownLayout.SVG (cognitive 59): MarkdownLayout.SVG has cognitive complexity 59 (threshold 15). Drivers by points: if/else 20 (51 pts), boolean chains 3, loops 3, match/switch 1 (2 pts) (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/textmeasure/markdown_svg.go"},"region":{"startLine":219}}}],"partialFingerprints":{"codehealthFindingId/v1":"dcb8dc782ced79b30ecc6f2bc51448f90b2599d2707b59ee94afdb2b26a94dab"}},{"ruleId":"D2","level":"warning","message":{"text":"d2cli.renderIsometricImages (cognitive 58): d2cli.renderIsometricImages has cognitive complexity 58 (threshold 15). Drivers by points: if/else 27 (48 pts), boolean chains 6, loops 3 (4 pts) (nesting depth added 22). Of this number, 45 points are the body\u0027s own statements and 13 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2cli/isometric_image.go"},"region":{"startLine":120}}}],"partialFingerprints":{"codehealthFindingId/v1":"0a1776523b7f89ecae250f30b63cc6a825023acbb70e72a3e912e72b18b972bf"}},{"ruleId":"D2","level":"warning","message":{"text":"ASCIIartist.calculateExtendedBounds (cognitive 58): ASCIIartist.calculateExtendedBounds has cognitive complexity 58 (threshold 15). Drivers by points: if/else 17 (51 pts), loops 2 (4 pts), 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":133}}}],"partialFingerprints":{"codehealthFindingId/v1":"e0a58710747d8ea2cbcc91f03c820f5efe44fbc62083651e3fdfc10a450f09ef"}},{"ruleId":"D2","level":"warning","message":{"text":"d2raster.flattenScenePath (cognitive 58): d2raster.flattenScenePath has cognitive complexity 58 (threshold 15). Drivers by points: if/else 22 (51 pts), boolean chains 4, match/switch 1 (2 pts), loops 1 (nesting depth added 30). Of this number, 50 points are the body\u0027s own statements and 8 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/geometry.go"},"region":{"startLine":60}}}],"partialFingerprints":{"codehealthFindingId/v1":"1521fdfc5c300a793baa84ba2c09da07753a0058e81f76d8d6de63c8926b3b1e"}},{"ruleId":"D2","level":"warning","message":{"text":"ThemableElement.Render (cognitive 58): ThemableElement.Render has cognitive complexity 58 (threshold 15). Drivers by points: if/else 45 (53 pts), boolean chains 5 (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2themes/element.go"},"region":{"startLine":138}}}],"partialFingerprints":{"codehealthFindingId/v1":"1004132f05371fbe22489d21fc224ab60e1adb3a3f2e2c928993fb6d1ed5b26c"}},{"ruleId":"D2","level":"warning","message":{"text":"Graph.Texts (cognitive 57): Graph.Texts has cognitive complexity 57 (threshold 15). Drivers by points: if/else 11 (27 pts), loops 12 (24 pts), 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":1710}}}],"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 10 (41 pts), loops 4 (12 pts), boolean chains 4 (nesting depth added 39). To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ir/d2ir.go"},"region":{"startLine":1032}}}],"partialFingerprints":{"codehealthFindingId/v1":"ef70081fd0c1a33816089d95a46d3e9033cb46f44b667632aad410cbf33ae815"}},{"ruleId":"D2","level":"warning","message":{"text":"graphCloneState.copy (cognitive 57): graphCloneState.copy has cognitive complexity 57 (threshold 15). Drivers by points: if/else 25 (46 pts), loops 7 (9 pts), boolean chains 2 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/clone.go"},"region":{"startLine":86}}}],"partialFingerprints":{"codehealthFindingId/v1":"4740486fba84d859cc69f670696aeb2fcf53870c15aaf461f6eec96c3c410452"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.routeInSShape (cognitive 57): routing.routeInSShape has cognitive complexity 57 (threshold 15). Drivers by points: if/else 17 (42 pts), boolean chains 9, loops 4, match/switch 1 (2 pts) (nesting depth added 26). Of this number, 18 points are the body\u0027s own statements and 39 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/d2talalayout/internal/routing/coordinator.go"},"region":{"startLine":725}}}],"partialFingerprints":{"codehealthFindingId/v1":"9da1db26dd346f1de03f13838bfc83d2fd3e744615a4cbcf25131dde8caa2f22"}},{"ruleId":"D2","level":"warning","message":{"text":"Diagram.BoundingBox (cognitive 57): Diagram.BoundingBox has cognitive complexity 57 (threshold 15). Drivers by points: if/else 22 (49 pts), boolean chains 4, loops 3 (4 pts) (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":450}}}],"partialFingerprints":{"codehealthFindingId/v1":"8f9056596037cdc5a617e71df09d1887d5de86c114c058b583a27ccb0e98b439"}},{"ruleId":"D2","level":"warning","message":{"text":"main.verifyArchive (cognitive 56): main.verifyArchive has cognitive complexity 56 (threshold 15). Drivers by points: if/else 22 (42 pts), boolean chains 10, loops 2, match/switch 1 (2 pts) (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":"ci/release/releasetool/main.go"},"region":{"startLine":669}}}],"partialFingerprints":{"codehealthFindingId/v1":"108397bea8ee99f3f0cbad2422146f096e1961f3eeb79e104e7c6ef306b558a8"}},{"ruleId":"D2","level":"warning","message":{"text":"d2graph.compareSerializedObject (cognitive 56): d2graph.compareSerializedObject has cognitive complexity 56 (threshold 15). Drivers by points: if/else 34 (43 pts), 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":231}}}],"partialFingerprints":{"codehealthFindingId/v1":"31ea1b2dbf5d4c0db066041c86f3274a25d2f5e20d570c87502f9b6554cc6907"}},{"ruleId":"D2","level":"warning","message":{"text":"d2ir.walkVariableExpansion (cognitive 56): d2ir.walkVariableExpansion has cognitive complexity 56 (threshold 15). Drivers by points: if/else 17 (43 pts), loops 4 (10 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 33). To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ir/expansion.go"},"region":{"startLine":193}}}],"partialFingerprints":{"codehealthFindingId/v1":"eebddb4939cc3ee117e4f1fa9ef52adf02a7d59f4bc59860979a133670dbd360"}},{"ruleId":"D2","level":"warning","message":{"text":"builder.preflightShape (cognitive 56): builder.preflightShape has cognitive complexity 56 (threshold 15). Drivers by points: if/else 22 (45 pts), boolean chains 7, match/switch 2 (4 pts) (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":"d2renderers/d2scenebuild/build.go"},"region":{"startLine":324}}}],"partialFingerprints":{"codehealthFindingId/v1":"457b130858081c8e77ff182665c55e64751216b2b7cb5d181217ad96f6cccced"}},{"ruleId":"D2","level":"warning","message":{"text":"d2dagrelayout.adjustDeltaForEdges (cognitive 55): d2dagrelayout.adjustDeltaForEdges has cognitive complexity 55 (threshold 15). Drivers by points: if/else 27 (50 pts), 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":1712}}}],"partialFingerprints":{"codehealthFindingId/v1":"41fca2490d4323d5f18a453b188afe046ec37ae7edbc8804152da71aab1fd98a"}},{"ruleId":"D2","level":"warning","message":{"text":"Graph.splitSubgraphsWithOwnership (cognitive 55): Graph.splitSubgraphsWithOwnership has cognitive complexity 55 (threshold 15). Drivers by points: if/else 27 (46 pts), loops 7 (8 pts), boolean chains 1 (nesting depth added 20). Of this number, 40 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":"d2layouts/d2talalayout/internal/layoutgraph/graph.go"},"region":{"startLine":674}}}],"partialFingerprints":{"codehealthFindingId/v1":"5d80911386d0755631a9acad0021d6b070544a879a646881945568f3cdc0b10d"}},{"ruleId":"D2","level":"warning","message":{"text":"quality.measureGeometry (cognitive 55): quality.measureGeometry has cognitive complexity 55 (threshold 15). Drivers by points: if/else 13 (40 pts), loops 4 (8 pts), 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":"d2layouts/d2talalayout/internal/quality/inspection_geometry.go"},"region":{"startLine":15}}}],"partialFingerprints":{"codehealthFindingId/v1":"8b6ffb9d1bf7aea518bb03e513c5b5aa89ca33601cba6f61a39b349c99d0602f"}},{"ruleId":"D2","level":"warning","message":{"text":"meshBuilder.rootDecorations (cognitive 55): meshBuilder.rootDecorations has cognitive complexity 55 (threshold 15). Drivers by points: if/else 19 (41 pts), loops 4 (10 pts), boolean chains 4 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/source_panels.go"},"region":{"startLine":128}}}],"partialFingerprints":{"codehealthFindingId/v1":"703a75619715321bfbcafc5a66068953fe5cce7ef98ada85201e9b2bbfc651de"}},{"ruleId":"D2","level":"warning","message":{"text":"d2raster.planPrimitiveResources (cognitive 55): d2raster.planPrimitiveResources has cognitive complexity 55 (threshold 15). Drivers by points: if/else 23 (55 pts) (nesting depth added 32). To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/effects.go"},"region":{"startLine":502}}}],"partialFingerprints":{"codehealthFindingId/v1":"c43f48d1351859f134aa4cbb02ba9907297ef188648c9ed99a592be500d152df"}},{"ruleId":"D2","level":"warning","message":{"text":"d2layouts.extractSubgraphs (cognitive 54): d2layouts.extractSubgraphs has cognitive complexity 54 (threshold 15). Drivers by points: if/else 17 (36 pts), loops 8 (13 pts), boolean chains 5 (nesting depth added 24). Of this number, 47 points are the body\u0027s own statements and 7 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2layouts.go"},"region":{"startLine":456}}}],"partialFingerprints":{"codehealthFindingId/v1":"9056e31d654a6013aed4c7493122678abd0a41fc52fa66e929fb2c9feaf79fc8"}},{"ruleId":"D2","level":"warning","message":{"text":"OVG.addPorts (cognitive 54): OVG.addPorts has cognitive complexity 54 (threshold 15). Drivers by points: if/else 16 (40 pts), loops 7 (14 pts) (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":"d2layouts/d2talalayout/internal/routing/ovg.go"},"region":{"startLine":233}}}],"partialFingerprints":{"codehealthFindingId/v1":"0d32eaf6170b2875dd1cc1f542c83f3477f5666d0ab63c124b3ff551d319a923"}},{"ruleId":"D2","level":"warning","message":{"text":"trees.positionEdgeLabels (cognitive 54): trees.positionEdgeLabels has cognitive complexity 54 (threshold 15). Drivers by points: if/else 19 (48 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/trees/geometry.go"},"region":{"startLine":285}}}],"partialFingerprints":{"codehealthFindingId/v1":"3669fe98c4f05d2da66419b45dc656b174ecb4e3f1172157e7a62530e0c8ca73"}},{"ruleId":"D2","level":"warning","message":{"text":"trees.placeTree (cognitive 54): trees.placeTree has cognitive complexity 54 (threshold 15). Drivers by points: if/else 23 (45 pts), loops 4 (8 pts), boolean chains 1 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/trees/layout.go"},"region":{"startLine":750}}}],"partialFingerprints":{"codehealthFindingId/v1":"f7548da0061c98982d52d1266c7767d8a22f213a404395d48a9fd5ed3f48252a"}},{"ruleId":"D2","level":"warning","message":{"text":"d2isometricimg.rasterSnapshot (cognitive 54): d2isometricimg.rasterSnapshot has cognitive complexity 54 (threshold 15). Drivers by points: if/else 15 (43 pts), loops 2 (6 pts), match/switch 1 (5 pts) (nesting depth added 36). To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/raster.go"},"region":{"startLine":307}}}],"partialFingerprints":{"codehealthFindingId/v1":"5042ce544326b8273ff37b937574accc914e1774664b08e4010b8e192d02d762"}},{"ruleId":"D2","level":"warning","message":{"text":"pathParser.number (cognitive 54): pathParser.number has cognitive complexity 54 (threshold 15). Drivers by points: if/else 19 (37 pts), boolean chains 12, loops 3 (5 pts) (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/d2svgimport/path.go"},"region":{"startLine":324}}}],"partialFingerprints":{"codehealthFindingId/v1":"76ed8752ebf3c87e5de4654878dcff8ead1a1b2f4e44b3f63442903396065ca7"}},{"ruleId":"D2","level":"warning","message":{"text":"markdownPainter.paintInlineNodes (cognitive 54): markdownPainter.paintInlineNodes has cognitive complexity 54 (threshold 15). Drivers by points: if/else 12 (34 pts), loops 9 (17 pts), boolean chains 3 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/textmeasure/markdown_svg.go"},"region":{"startLine":753}}}],"partialFingerprints":{"codehealthFindingId/v1":"722fff891cbee62e9ceb3ec4e9f5312e4f2a5a77232ce3c4eb77d596028eba95"}},{"ruleId":"D2","level":"warning","message":{"text":"Ruler.scaleUnicodeFallback (cognitive 54): Ruler.scaleUnicodeFallback has cognitive complexity 54 (threshold 15). Drivers by points: if/else 12 (47 pts), loops 2 (5 pts), boolean chains 2 (nesting depth added 38). 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":322}}}],"partialFingerprints":{"codehealthFindingId/v1":"6d0ce6eac3fc03a8c5270c7348f65ea46c932f11f3520a00de7f65866d2394d6"}},{"ruleId":"D2","level":"warning","message":{"text":"d2exporter.toConnection (cognitive 53): d2exporter.toConnection has cognitive complexity 53 (threshold 15). Drivers by points: if/else 37 (49 pts), 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":"placement.BalanceSymmetry (cognitive 53): placement.BalanceSymmetry has cognitive complexity 53 (threshold 15). Drivers by points: if/else 20 (41 pts), loops 5 (9 pts), boolean chains 3 (nesting depth added 25). Of this number, 48 points are the body\u0027s own statements and 5 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/symmetry.go"},"region":{"startLine":12}}}],"partialFingerprints":{"codehealthFindingId/v1":"a0f4170363f60f9d63576e6dbc9f7b23a5ab2e3c3a743bf16498684874cc4239"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.treeEdgePathForBuild (cognitive 53): routing.treeEdgePathForBuild has cognitive complexity 53 (threshold 15). Drivers by points: if/else 18 (48 pts), loops 2 (5 pts) (nesting depth added 33). Of this number, 52 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/tree_routes.go"},"region":{"startLine":28}}}],"partialFingerprints":{"codehealthFindingId/v1":"ebb5994f6c4dacf87c383480534295daab4de09e865b6e8ed8b20c001f8eff8e"}},{"ruleId":"D2","level":"warning","message":{"text":"d2isometricimg.nativeLaneClear (cognitive 53): d2isometricimg.nativeLaneClear has cognitive complexity 53 (threshold 15). Drivers by points: if/else 10 (37 pts), loops 4 (11 pts), boolean chains 5 (nesting depth added 34). Of this number, 52 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":"d2renderers/d2isometric/d2isometricimg/route_lanes.go"},"region":{"startLine":373}}}],"partialFingerprints":{"codehealthFindingId/v1":"2172c178809ef3393530870687f7f6f08638b48843436e56324e8a334ecd7d13"}},{"ruleId":"D2","level":"warning","message":{"text":"d2isometricimg.RenderTimeline (cognitive 53): d2isometricimg.RenderTimeline has cognitive complexity 53 (threshold 15). Drivers by points: if/else 18 (33 pts), loops 7 (14 pts), boolean chains 6 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/timeline.go"},"region":{"startLine":26}}}],"partialFingerprints":{"codehealthFindingId/v1":"d32324cadbe7c79241e05028030c673d006de4e8d3d40e6cf0259462cd988871"}},{"ruleId":"D2","level":"warning","message":{"text":"svgImporter.validateNonRenderingTree (cognitive 53): svgImporter.validateNonRenderingTree has cognitive complexity 53 (threshold 15). Drivers by points: if/else 14 (40 pts), match/switch 2 (5 pts), boolean chains 4, loops 3 (4 pts) (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svgimport/boilerplate.go"},"region":{"startLine":63}}}],"partialFingerprints":{"codehealthFindingId/v1":"95f52b16d43750be1b2cc29592088f8d659a5e9bcf0b6757584a7e04b36edac2"}},{"ruleId":"D2","level":"warning","message":{"text":"svgImporter.parseStylesheet (cognitive 53): svgImporter.parseStylesheet has cognitive complexity 53 (threshold 15). Drivers by points: if/else 17 (43 pts), loops 4 (6 pts), boolean chains 4 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svgimport/stylesheet.go"},"region":{"startLine":66}}}],"partialFingerprints":{"codehealthFindingId/v1":"7d8d39bde25f5f8d1c1e5dc17da1e6b7cc754d8c73f9a4deccd5c298875b326c"}},{"ruleId":"D2","level":"warning","message":{"text":"imageasset.probeResource (cognitive 53): imageasset.probeResource has cognitive complexity 53 (threshold 15). Drivers by points: if/else 24 (50 pts), boolean chains 3 (nesting depth added 26). To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/imageasset/probe.go"},"region":{"startLine":40}}}],"partialFingerprints":{"codehealthFindingId/v1":"375d446d8aeb6c62a4a388097bf32cae49f3f8a849e0695497dfa0d167b9dae3"}},{"ruleId":"D2","level":"warning","message":{"text":"markdownPainter.wrapInlineTokens (cognitive 53): markdownPainter.wrapInlineTokens has cognitive complexity 53 (threshold 15). Drivers by points: if/else 16 (36 pts), boolean chains 10, loops 3 (6 pts), jumps 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":"lib/textmeasure/markdown_svg.go"},"region":{"startLine":983}}}],"partialFingerprints":{"codehealthFindingId/v1":"cf7acbcfa9eae1a5fa776aa87e76e9a775b786afe7e8b3fae36f61e9ee11d12e"}},{"ruleId":"D2","level":"warning","message":{"text":"hierarchy.markConflicts (cognitive 52): hierarchy.markConflicts has cognitive complexity 52 (threshold 15). Drivers by points: if/else 13 (37 pts), loops 5 (14 pts), boolean chains 1 (nesting depth added 33). Of this number, 51 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/d2talalayout/internal/hierarchy/brandes_kopf.go"},"region":{"startLine":467}}}],"partialFingerprints":{"codehealthFindingId/v1":"a70fa192bafc45f46b914a778170a66cee8e0afc41d1084d0875ce8d58a4e933"}},{"ruleId":"D2","level":"warning","message":{"text":"placement.orientSourceInterior (cognitive 52): placement.orientSourceInterior has cognitive complexity 52 (threshold 15). Drivers by points: if/else 24 (35 pts), loops 8 (10 pts), boolean chains 7 (nesting depth added 13). Of this number, 36 points are the body\u0027s own statements and 16 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/d2talalayout/internal/placement/container_orientation.go"},"region":{"startLine":37}}}],"partialFingerprints":{"codehealthFindingId/v1":"1e7092ae58e6dad189bdbfd4a29caf8e00eee6f094783da6caa3d40d009a880d"}},{"ruleId":"D2","level":"warning","message":{"text":"quality.findSharedSegments (cognitive 52): quality.findSharedSegments has cognitive complexity 52 (threshold 15). Drivers by points: if/else 22 (46 pts), loops 4 (6 pts) (nesting depth added 26). Of this number, 23 points are the body\u0027s own statements and 29 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/d2talalayout/internal/quality/labels.go"},"region":{"startLine":418}}}],"partialFingerprints":{"codehealthFindingId/v1":"5d428ed566be18119bf0e0ae5372f248059da3edbac6120adfb35394c94a48bc"}},{"ruleId":"D2","level":"warning","message":{"text":"meshBuilder.classicInkEdges (cognitive 52): meshBuilder.classicInkEdges has cognitive complexity 52 (threshold 15). Drivers by points: if/else 19 (40 pts), loops 4 (7 pts), boolean chains 5 (nesting depth added 24). Of this number, 49 points are the body\u0027s own statements and 3 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/native_edges.go"},"region":{"startLine":429}}}],"partialFingerprints":{"codehealthFindingId/v1":"200fbce3894f8e34b2b330e87036f3b1b9eddc39efe00d80d931a642a496eb59"}},{"ruleId":"D2","level":"warning","message":{"text":"d2svg.arrowheadMarker (cognitive 52): d2svg.arrowheadMarker has cognitive complexity 52 (threshold 15). Drivers by points: if/else 32 (48 pts), 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":531}}}],"partialFingerprints":{"codehealthFindingId/v1":"650fb510f1734ad23e517ccc8ed68f0735f603c7872bad0e8e588a7b0d6a8a85"}},{"ruleId":"D2","level":"warning","message":{"text":"d2svg.pruneThemeCSSWithClasses (cognitive 52): d2svg.pruneThemeCSSWithClasses has cognitive complexity 52 (threshold 15). Drivers by points: if/else 11 (37 pts), loops 4 (11 pts), boolean chains 4 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svg/theme.go"},"region":{"startLine":19}}}],"partialFingerprints":{"codehealthFindingId/v1":"c2db7466c5ea3c85fedb404365afb4510017ddb8530de7cc83309cda7ed0dab7"}},{"ruleId":"D2","level":"warning","message":{"text":"Key.D2OracleEquals (cognitive 51): Key.D2OracleEquals has cognitive complexity 51 (threshold 15). Drivers by points: if/else 25 (40 pts), loops 3 (6 pts), 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":"grouping.Cleanup (cognitive 51): grouping.Cleanup has cognitive complexity 51 (threshold 15). Drivers by points: loops 13 (29 pts), if/else 8 (22 pts) (nesting depth added 30). 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/d2talalayout/internal/grouping/lifecycle.go"},"region":{"startLine":126}}}],"partialFingerprints":{"codehealthFindingId/v1":"0db1e4079346f2c9025a35ae6a1475ba1da3bb5c5e874edf45e37ef126efa518"}},{"ruleId":"D2","level":"warning","message":{"text":"labeling.sortSharedSegmentGroup (cognitive 51): labeling.sortSharedSegmentGroup has cognitive complexity 51 (threshold 15). Drivers by points: if/else 12 (37 pts), loops 5 (12 pts), boolean chains 2 (nesting depth added 32). Of this number, 50 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/d2talalayout/internal/labeling/guard.go"},"region":{"startLine":557}}}],"partialFingerprints":{"codehealthFindingId/v1":"f0fdc8bfd436ecb87d706d7acd237c7410355cbf71e384588979e1dea7e74943"}},{"ruleId":"D2","level":"warning","message":{"text":"placement.moveNodeToBest (cognitive 51): placement.moveNodeToBest has cognitive complexity 51 (threshold 15). Drivers by points: if/else 22 (41 pts), boolean chains 7, match/switch 1 (2 pts), 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":"d2layouts/d2talalayout/internal/placement/moves.go"},"region":{"startLine":16}}}],"partialFingerprints":{"codehealthFindingId/v1":"1bd926e0d7c0450de992cc1e39f3fc7b015641f753f520908dc59ea1407278f7"}},{"ruleId":"D2","level":"warning","message":{"text":"compiler.compileArray (cognitive 50): compiler.compileArray has cognitive complexity 50 (threshold 15). Drivers by points: if/else 14 (43 pts), match/switch 2 (5 pts), boolean chains 1, loops 1 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ir/compile.go"},"region":{"startLine":2285}}}],"partialFingerprints":{"codehealthFindingId/v1":"e41aacdfc8882f840ab7c2960cae24d1bc7d84cb142bb6c099d89cf025439fe7"}},{"ruleId":"D2","level":"warning","message":{"text":"layoutgraph.buildTransactionOverlapsWithReferenceLimit (cognitive 50): layoutgraph.buildTransactionOverlapsWithReferenceLimit has cognitive complexity 50 (threshold 15). Drivers by points: if/else 19 (40 pts), boolean chains 4, loops 3 (4 pts), match/switch 1 (2 pts) (nesting depth added 23). Of this number, 42 points are the body\u0027s own statements and 8 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/transaction.go"},"region":{"startLine":509}}}],"partialFingerprints":{"codehealthFindingId/v1":"1d5e2965d422ee50c415d09b9a735adc1532ab9b4b0ef085ff2cfe62144a11c3"}},{"ruleId":"D2","level":"warning","message":{"text":"placement.Equidistance (cognitive 50): placement.Equidistance has cognitive complexity 50 (threshold 15). Drivers by points: if/else 18 (38 pts), loops 5 (11 pts), boolean chains 1 (nesting depth added 26). Of this number, 49 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/d2talalayout/internal/placement/equidistance.go"},"region":{"startLine":18}}}],"partialFingerprints":{"codehealthFindingId/v1":"f8609133edff307760571404fe6e57e5dea41d7b69ba5b0c5ef59402110fadfc"}},{"ruleId":"D2","level":"warning","message":{"text":"placement.adjacents (cognitive 50): placement.adjacents has cognitive complexity 50 (threshold 15). Drivers by points: if/else 16 (29 pts), loops 10 (18 pts), 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/d2talalayout/internal/placement/metrics.go"},"region":{"startLine":105}}}],"partialFingerprints":{"codehealthFindingId/v1":"16de25492684eb64d79cac14ff87fcba42bb036f6439f2b5ec59229a963da8ea"}},{"ruleId":"D2","level":"warning","message":{"text":"d2isometricimg.nativeDocumentGlyphCoverage (cognitive 50): d2isometricimg.nativeDocumentGlyphCoverage has cognitive complexity 50 (threshold 15). Drivers by points: if/else 21 (42 pts), loops 4 (7 pts), boolean chains 1 (nesting depth added 24). Most of this is not in the body itself: 7 of the 50 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 131, 91). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals\u0027 work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/surface_fonts.go"},"region":{"startLine":83}}}],"partialFingerprints":{"codehealthFindingId/v1":"9966d5e91a553fc512ff9516ec0f143e50c12607e564b86a1c3a05aea384a9b8"}},{"ruleId":"D2","level":"warning","message":{"text":"meshBuilder.extrudedProfile (cognitive 50): meshBuilder.extrudedProfile has cognitive complexity 50 (threshold 15). Drivers by points: if/else 14 (37 pts), loops 7 (10 pts), boolean chains 3 (nesting depth added 26). Of this number, 49 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":"d2renderers/d2isometric/d2isometricimg/native_shapes.go"},"region":{"startLine":651}}}],"partialFingerprints":{"codehealthFindingId/v1":"509841b53a87f754292be344b2131bad295288c541775e8d8f96cce01581d45d"}},{"ruleId":"D2","level":"warning","message":{"text":"d2raster.multiplyLayerByAlpha (cognitive 50): d2raster.multiplyLayerByAlpha has cognitive complexity 50 (threshold 15). Drivers by points: if/else 8 (25 pts), loops 6 (19 pts), boolean chains 3, match/switch 1 (3 pts) (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/effects.go"},"region":{"startLine":1023}}}],"partialFingerprints":{"codehealthFindingId/v1":"68bbba862e65b32fe9ded7aa4dd0f677ca3eb67e0bd5b25c2b7f5a162f0e71dc"}},{"ruleId":"D2","level":"warning","message":{"text":"main.writeArchive (cognitive 49): main.writeArchive has cognitive complexity 49 (threshold 15). Drivers by points: if/else 33 (43 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (nesting depth added 11). Of this number, 38 points are the body\u0027s own statements and 11 belong to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"ci/release/releasetool/main.go"},"region":{"startLine":158}}}],"partialFingerprints":{"codehealthFindingId/v1":"d8cc280d6226da8b6c3966f439ea69bc004d9774e2e2d7d06bf30a5cd838a1eb"}},{"ruleId":"D2","level":"warning","message":{"text":"labeling.isClusterPathSharedChecked (cognitive 49): labeling.isClusterPathSharedChecked has cognitive complexity 49 (threshold 15). Drivers by points: if/else 19 (42 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/labeling/placement.go"},"region":{"startLine":1189}}}],"partialFingerprints":{"codehealthFindingId/v1":"275efbe8bc97483a2c0852e118cab69bee4514ea8607e402273d7e1c19078ffc"}},{"ruleId":"D2","level":"warning","message":{"text":"sizedOptimizer.findClosestUnoccupiedDistanceGuarded (cognitive 49): sizedOptimizer.findClosestUnoccupiedDistanceGuarded has cognitive complexity 49 (threshold 15). Drivers by points: if/else 14 (40 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/sized_optimizer.go"},"region":{"startLine":528}}}],"partialFingerprints":{"codehealthFindingId/v1":"15a015b838f0bb93f1170b1ce7fb8276c358a15bbadcec78916705a4222b61dc"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.shortcutCandidateSafe (cognitive 49): routing.shortcutCandidateSafe has cognitive complexity 49 (threshold 15). Drivers by points: if/else 15 (33 pts), boolean chains 8, loops 5 (8 pts) (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/d2talalayout/internal/routing/shortcut_routes.go"},"region":{"startLine":227}}}],"partialFingerprints":{"codehealthFindingId/v1":"4fb216deb0caf6e02cfeb80113190c6254064397dc05d854ed73d22ffc970ef0"}},{"ruleId":"D2","level":"warning","message":{"text":"Raster.renderStrips (cognitive 49): Raster.renderStrips has cognitive complexity 49 (threshold 15). Drivers by points: if/else 14 (28 pts), loops 7 (16 pts), boolean chains 5 (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":"d2renderers/d2isometric/d2isometricimg/raster.go"},"region":{"startLine":396}}}],"partialFingerprints":{"codehealthFindingId/v1":"d94846dae68c13ebb580c8d7e88dd67eb1603c5546b1a3a2ee68f9758e528563"}},{"ruleId":"D2","level":"warning","message":{"text":"d2raster.compositeCOLRv1SoftLightLayer (cognitive 49): d2raster.compositeCOLRv1SoftLightLayer has cognitive complexity 49 (threshold 15). Drivers by points: if/else 12 (39 pts), loops 4 (9 pts), boolean chains 1 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/effects.go"},"region":{"startLine":1391}}}],"partialFingerprints":{"codehealthFindingId/v1":"e82c3bee4e07fedc7c77d93a125047068672f524a3ba60c3fd81e461c2547b72"}},{"ruleId":"D2","level":"warning","message":{"text":"prepare.main (cognitive 49): prepare.main has cognitive complexity 49 (threshold 15). Drivers by points: if/else 27 (30 pts), boolean chains 16, loops 2, ternaries 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"ci/release/prepare.py"},"region":{"startLine":27}}}],"partialFingerprints":{"codehealthFindingId/v1":"ab0c6604a7c6e2c29e2087bdc4a0d7fd9c633b91cd9b41aaa5cc969aab774ee4"}},{"ruleId":"D2","level":"warning","message":{"text":"compiler.extendLinks (cognitive 48): compiler.extendLinks has cognitive complexity 48 (threshold 15). Drivers by points: if/else 13 (36 pts), boolean chains 8, loops 2 (4 pts) (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":1928}}}],"partialFingerprints":{"codehealthFindingId/v1":"a2042ac4bb2a46d7ba59b59c970f4bb081fcae2773968844afc5deae99e0e06c"}},{"ruleId":"D2","level":"warning","message":{"text":"layoutgraph.transactionSweepPadding (cognitive 48): layoutgraph.transactionSweepPadding has cognitive complexity 48 (threshold 15). Drivers by points: if/else 15 (38 pts), loops 6 (9 pts), boolean chains 1 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/transaction.go"},"region":{"startLine":407}}}],"partialFingerprints":{"codehealthFindingId/v1":"14ca97b9a11565ff408bb479c46899e0fcc2a3acdbdbb793da2b9ec9add714f8"}},{"ruleId":"D2","level":"warning","message":{"text":"Node.IsBlocked (cognitive 48): Node.IsBlocked has cognitive complexity 48 (threshold 15). Drivers by points: if/else 20 (40 pts), boolean chains 8 (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":"d2layouts/d2talalayout/internal/layoutgraph/node.go"},"region":{"startLine":1172}}}],"partialFingerprints":{"codehealthFindingId/v1":"34d4da5b53a259dbf56902b9421b3520cacf626f8a7fd1b57029bc053ccea774"}},{"ruleId":"D2","level":"warning","message":{"text":"placement.nearestConnectedAhead (cognitive 48): placement.nearestConnectedAhead has cognitive complexity 48 (threshold 15). Drivers by points: if/else 14 (43 pts), boolean chains 4, 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/d2talalayout/internal/placement/gapreduction.go"},"region":{"startLine":197}}}],"partialFingerprints":{"codehealthFindingId/v1":"72a0924794b7d6511a7420e919dd0f95aa693402ee49d865c852883803a93c43"}},{"ruleId":"D2","level":"warning","message":{"text":"OVG.addIntersections (cognitive 48): OVG.addIntersections has cognitive complexity 48 (threshold 15). Drivers by points: if/else 21 (43 pts), loops 4 (5 pts) (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":"d2layouts/d2talalayout/internal/routing/ovg.go"},"region":{"startLine":330}}}],"partialFingerprints":{"codehealthFindingId/v1":"8a197fcf169aba08817cb8ee94a94f108bcd62d7663a62804f9a615c8d373695"}},{"ruleId":"D2","level":"warning","message":{"text":"meshBuilder.routeCaptionKnockout (cognitive 48): meshBuilder.routeCaptionKnockout has cognitive complexity 48 (threshold 15). Drivers by points: if/else 11 (34 pts), loops 4 (9 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 30). Of this number, 45 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":"d2renderers/d2isometric/d2isometricimg/route_caption_mask.go"},"region":{"startLine":10}}}],"partialFingerprints":{"codehealthFindingId/v1":"d1add17c4c7774aeb3b5bd00e413257b9ea8490068e66ece3f3c3c48b902b481"}},{"ruleId":"D2","level":"warning","message":{"text":"d2raster.compositeLayerOverOpaquePartialPrefix (cognitive 48): d2raster.compositeLayerOverOpaquePartialPrefix has cognitive complexity 48 (threshold 15). Drivers by points: if/else 11 (37 pts), loops 4 (9 pts), boolean chains 2 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/effects.go"},"region":{"startLine":1689}}}],"partialFingerprints":{"codehealthFindingId/v1":"27ab8ea7f037af7c07a0623570aa1b5ae18a14e389df8eea0edc15cbb1b7aabf"}},{"ruleId":"D2","level":"warning","message":{"text":"builder.compileLinkRegions (cognitive 48): builder.compileLinkRegions has cognitive complexity 48 (threshold 15). Drivers by points: if/else 20 (38 pts), boolean chains 5, loops 4 (5 pts) (nesting depth added 19). Of this number, 47 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into 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/d2scenebuild/metadata.go"},"region":{"startLine":16}}}],"partialFingerprints":{"codehealthFindingId/v1":"cf961f124edafc30bc1834a834d7a543b22cd7b48398790149c51f04988471ff"}},{"ruleId":"D2","level":"warning","message":{"text":"builder.buildSketchStructuredShape (cognitive 48): builder.buildSketchStructuredShape has cognitive complexity 48 (threshold 15). Drivers by points: if/else 15 (40 pts), boolean chains 5, match/switch 1 (2 pts), loops 1 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/sketch_shapes.go"},"region":{"startLine":592}}}],"partialFingerprints":{"codehealthFindingId/v1":"c2cdf153e2740bac35be028b35231515e0dce45e9f8c11a91aeec5891a8382ad"}},{"ruleId":"D2","level":"warning","message":{"text":"d2svg.dimensions (cognitive 48): d2svg.dimensions has cognitive complexity 48 (threshold 15). Drivers by points: if/else 12 (37 pts), loops 2 (6 pts), boolean chains 5 (nesting depth added 29). To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svg/d2svg.go"},"region":{"startLine":178}}}],"partialFingerprints":{"codehealthFindingId/v1":"6de1f7f820cbaa7b8eb17ba0bae0c7e127cf9c0d29abc2e0818947ff0adff4da"}},{"ruleId":"D2","level":"warning","message":{"text":"d2target.stabilizeHashURLs (cognitive 48): d2target.stabilizeHashURLs has cognitive complexity 48 (threshold 15). Drivers by points: if/else 17 (42 pts), loops 2 (4 pts), boolean chains 1, match/switch 1 (nesting depth added 27). Most of this is not in the body itself: 1 of the 48 points is its own statement and the rest belongs to one function literal inside it that branches (line 256). 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":"d2target/d2target.go"},"region":{"startLine":250}}}],"partialFingerprints":{"codehealthFindingId/v1":"c494c57d0cff7bf9aecbab9e1863931101ec8b87a9ee176b7dbdfe0c1fca31a3"}},{"ruleId":"D2","level":"warning","message":{"text":"d2dagrelayout.adjustEdges (cognitive 47): d2dagrelayout.adjustEdges has cognitive complexity 47 (threshold 15). Drivers by points: if/else 20 (42 pts), 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 1803). 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":1802}}}],"partialFingerprints":{"codehealthFindingId/v1":"00e00ee8a06826f50e921a5ac7be33f1a0a7945592c9907f76cc00c6ce7fef75"}},{"ruleId":"D2","level":"warning","message":{"text":"rankSimplex.optimize (cognitive 47): rankSimplex.optimize has cognitive complexity 47 (threshold 15). Drivers by points: if/else 15 (38 pts), loops 4 (7 pts), boolean chains 2 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/hierarchy/rank_simplex.go"},"region":{"startLine":281}}}],"partialFingerprints":{"codehealthFindingId/v1":"2170784d820f2ae36445ee4602a08c26e85775fdfd621cda1457d36f59679c22"}},{"ruleId":"D2","level":"warning","message":{"text":"packing.snapshotCombineNodePositions (cognitive 47): packing.snapshotCombineNodePositions has cognitive complexity 47 (threshold 15). Drivers by points: if/else 16 (35 pts), loops 5 (12 pts) (nesting depth added 26). Of this number, 43 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":"d2layouts/d2talalayout/internal/packing/combine_snapshot.go"},"region":{"startLine":25}}}],"partialFingerprints":{"codehealthFindingId/v1":"3eb7eba6d82cf8c8645ee23bbd3e125b3862a5cf0d30af730c047aa1bb2f7fbb"}},{"ruleId":"D2","level":"warning","message":{"text":"placement.snapshotNodePositionsContext (cognitive 47): placement.snapshotNodePositionsContext has cognitive complexity 47 (threshold 15). Drivers by points: if/else 16 (35 pts), loops 5 (12 pts) (nesting depth added 26). Of this number, 43 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":"d2layouts/d2talalayout/internal/placement/types.go"},"region":{"startLine":47}}}],"partialFingerprints":{"codehealthFindingId/v1":"49cf50c8df8658b957773fb48fb8bb6c6b70f6c25334231233cbf2b78290c033"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.finalizeSelectedRoutes (cognitive 47): routing.finalizeSelectedRoutes has cognitive complexity 47 (threshold 15). Drivers by points: if/else 20 (38 pts), loops 5 (7 pts), boolean chains 2 (nesting depth added 20). Of this number, 46 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/coordinator.go"},"region":{"startLine":205}}}],"partialFingerprints":{"codehealthFindingId/v1":"ab633d204bd4f17d1948b3faba2defc8fe4b0cf68cb613fc9da64965316e75e5"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.routeAdditionalEdgesWithResourceLimits (cognitive 47): routing.routeAdditionalEdgesWithResourceLimits has cognitive complexity 47 (threshold 15). Drivers by points: if/else 21 (40 pts), loops 5 (6 pts), boolean chains 1 (nesting depth added 20). Of this number, 31 points are the body\u0027s own statements and 16 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/d2talalayout/internal/routing/coordinator.go"},"region":{"startLine":531}}}],"partialFingerprints":{"codehealthFindingId/v1":"24266fd25a6e736679f465ab2e0bb2a9f25e9f7cc93d4390a6bae04dfffc1f9b"}},{"ruleId":"D2","level":"warning","message":{"text":"trees.handleTreeSubgraph (cognitive 47): trees.handleTreeSubgraph has cognitive complexity 47 (threshold 15). Drivers by points: if/else 16 (39 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/trees/layout.go"},"region":{"startLine":251}}}],"partialFingerprints":{"codehealthFindingId/v1":"12c6f0879e82a5721a559e6c8029ca97c6425be944bcc554c5c083a9dab1c855"}},{"ruleId":"D2","level":"warning","message":{"text":"d2isometricimg.nativeShapeProfile (cognitive 47): d2isometricimg.nativeShapeProfile has cognitive complexity 47 (threshold 15). Drivers by points: if/else 11 (25 pts), loops 6 (15 pts), boolean chains 4, match/switch 1 (3 pts) (nesting depth added 25). Of this number, 42 points are the body\u0027s own statements and 5 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/native_shapes.go"},"region":{"startLine":510}}}],"partialFingerprints":{"codehealthFindingId/v1":"11bd7408063e8ab9a927266bfc64d177c3155d5f68026897365e094e58eb4b8b"}},{"ruleId":"D2","level":"warning","message":{"text":"Rasterizer.accumulateEdgeRow (cognitive 47): Rasterizer.accumulateEdgeRow has cognitive complexity 47 (threshold 15). Drivers by points: if/else 20 (40 pts), loops 2 (5 pts), boolean chains 2 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/internal/scanline/rasterizer.go"},"region":{"startLine":1169}}}],"partialFingerprints":{"codehealthFindingId/v1":"b0b4f02c129c87a3dd65e6e32644444f4e56f3e56ee6b40e9c4f5e0ab5aa3930"}},{"ruleId":"D2","level":"warning","message":{"text":"xgif.buildFewOpaquePaletted (cognitive 47): xgif.buildFewOpaquePaletted has cognitive complexity 47 (threshold 15). Drivers by points: if/else 12 (27 pts), loops 11 (19 pts), boolean chains 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/xgif/xgif.go"},"region":{"startLine":392}}}],"partialFingerprints":{"codehealthFindingId/v1":"d7c2f1a6caa598b587ec478562fab5e24a859566430372ae79785c1b4942f4cd"}},{"ruleId":"D2","level":"warning","message":{"text":"d2cli.renderGIFWithSession (cognitive 46): d2cli.renderGIFWithSession has cognitive complexity 46 (threshold 15). Drivers by points: if/else 27 (44 pts), boolean chains 1, loops 1 (nesting depth added 17). Of this number, 35 points are the body\u0027s own statements and 11 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2cli/raster.go"},"region":{"startLine":555}}}],"partialFingerprints":{"codehealthFindingId/v1":"53539c5bc3f15bdf0217731505a00b26e2f89c6f6a401f7cffa1045623b6e50e"}},{"ruleId":"D2","level":"warning","message":{"text":"compiler.compileEdgeMap (cognitive 46): compiler.compileEdgeMap has cognitive complexity 46 (threshold 15). Drivers by points: if/else 14 (38 pts), loops 3 (7 pts), boolean chains 1 (nesting depth added 28). To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2compiler/compile.go"},"region":{"startLine":1247}}}],"partialFingerprints":{"codehealthFindingId/v1":"e77bfe1d32e8873a6990add64234e07cfc690f1ec9b817a3c8faa81d2abc16de"}},{"ruleId":"D2","level":"warning","message":{"text":"d2elklayout.ConvertGraph (cognitive 46): d2elklayout.ConvertGraph has cognitive complexity 46 (threshold 15). Drivers by points: if/else 16 (22 pts), match/switch 7 (12 pts), loops 6 (8 pts), boolean chains 4 (nesting depth added 13). Of this number, 16 points are the body\u0027s own statements and 30 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":"d2layouts/d2elklayout/wasm.go"},"region":{"startLine":23}}}],"partialFingerprints":{"codehealthFindingId/v1":"24b275178de06e31d37bae3e7582dbc9ffeacbf6aa53b926f0a374da21cefbee"}},{"ruleId":"D2","level":"warning","message":{"text":"grouping.buildClusterDiscoveryIndex (cognitive 46): grouping.buildClusterDiscoveryIndex has cognitive complexity 46 (threshold 15). Drivers by points: if/else 17 (35 pts), loops 7 (9 pts), boolean chains 2 (nesting depth added 20). Of this number, 42 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":"d2layouts/d2talalayout/internal/grouping/cluster_discovery.go"},"region":{"startLine":265}}}],"partialFingerprints":{"codehealthFindingId/v1":"da35af2b446caf6202f34c960e6fa9365aef753983f22ca9a55a16c07fdc1db8"}},{"ruleId":"D2","level":"warning","message":{"text":"placement.initializeNodes (cognitive 46): placement.initializeNodes has cognitive complexity 46 (threshold 15). Drivers by points: if/else 20 (31 pts), loops 8 (15 pts) (nesting depth added 18). Of this number, 34 points are the body\u0027s own statements and 12 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/initialize.go"},"region":{"startLine":14}}}],"partialFingerprints":{"codehealthFindingId/v1":"db81ed61fbd8166e03ce29ec7c964251df43e0620b9be5eb90c965ea189c2ada"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.validateRouteStageGeometry (cognitive 46): routing.validateRouteStageGeometry has cognitive complexity 46 (threshold 15). Drivers by points: if/else 23 (34 pts), loops 7 (8 pts), boolean chains 4 (nesting depth added 12). Of this number, 16 points are the body\u0027s own statements and 30 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/d2talalayout/internal/routing/route_stage_guard.go"},"region":{"startLine":278}}}],"partialFingerprints":{"codehealthFindingId/v1":"8a990a6306651948367023b89cc3678c24cde5cb7167693220e72d1043db83a0"}},{"ruleId":"D2","level":"warning","message":{"text":"Route.canSwapEdgesGuarded (cognitive 46): Route.canSwapEdgesGuarded has cognitive complexity 46 (threshold 15). Drivers by points: if/else 18 (36 pts), boolean chains 9, 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":"d2layouts/d2talalayout/internal/routing/route.go"},"region":{"startLine":202}}}],"partialFingerprints":{"codehealthFindingId/v1":"238e21841f96d7f9bcb53b893e3952cd4b360dbb17be04c32a34f2975e2d4713"}},{"ruleId":"D2","level":"warning","message":{"text":"d2oracle.ReconnectEdgeIDDeltas (cognitive 46): d2oracle.ReconnectEdgeIDDeltas has cognitive complexity 46 (threshold 15). Drivers by points: if/else 25 (40 pts), 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":2500}}}],"partialFingerprints":{"codehealthFindingId/v1":"fe3baeddf7d18db033a3a7ecab487bb9bb53d4b9ed4c0a68a115e44150b7ad52"}},{"ruleId":"D2","level":"warning","message":{"text":"d2isometricimg.richLabelDocumentWithResources (cognitive 46): d2isometricimg.richLabelDocumentWithResources has cognitive complexity 46 (threshold 15). Drivers by points: if/else 30 (41 pts), boolean chains 5 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/rich_labels.go"},"region":{"startLine":222}}}],"partialFingerprints":{"codehealthFindingId/v1":"03a7c4bcd2110bc558d9cee326263075a28b713ca29058471f86b0eee740d796"}},{"ruleId":"D2","level":"warning","message":{"text":"meshBuilder.classicInkJunctions (cognitive 46): meshBuilder.classicInkJunctions has cognitive complexity 46 (threshold 15). Drivers by points: if/else 13 (33 pts), loops 7 (11 pts), boolean chains 2 (nesting depth added 24). Of this number, 44 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/native_ink_joins.go"},"region":{"startLine":12}}}],"partialFingerprints":{"codehealthFindingId/v1":"133bef2a0469465072d9646c8add14545792b0797316fa5f73d6c3abd791a9af"}},{"ruleId":"D2","level":"warning","message":{"text":"d2raster.prepareWithSessionBands (cognitive 46): d2raster.prepareWithSessionBands has cognitive complexity 46 (threshold 15). Drivers by points: if/else 36 (40 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/raster.go"},"region":{"startLine":615}}}],"partialFingerprints":{"codehealthFindingId/v1":"b417b098b423b57f85645cb2c261099f7f2f2d9867361375bf59458d9960c78d"}},{"ruleId":"D2","level":"warning","message":{"text":"d2raster.flattenGlyph (cognitive 46): d2raster.flattenGlyph has cognitive complexity 46 (threshold 15). Drivers by points: if/else 18 (37 pts), loops 3 (4 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 21). Of this number, 37 points are the body\u0027s own statements and 9 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/text.go"},"region":{"startLine":626}}}],"partialFingerprints":{"codehealthFindingId/v1":"5937964079156b3207d2793cb118da0d2e17c53c882f9d2137459db7042d8277"}},{"ruleId":"D2","level":"warning","message":{"text":"builder.buildConnectionLabels (cognitive 46): builder.buildConnectionLabels has cognitive complexity 46 (threshold 15). Drivers by points: if/else 19 (44 pts), boolean chains 1, loops 1 (nesting depth added 25). To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/labels.go"},"region":{"startLine":159}}}],"partialFingerprints":{"codehealthFindingId/v1":"b4491dd9a95801820d2c4d13d6c82f1519f782181a1538e5073f1089fc2586a7"}},{"ruleId":"D2","level":"warning","message":{"text":"placement.inflateAlongAxis (cognitive 45): placement.inflateAlongAxis has cognitive complexity 45 (threshold 15). Drivers by points: if/else 17 (42 pts), boolean chains 2, loops 1 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/compaction.go"},"region":{"startLine":330}}}],"partialFingerprints":{"codehealthFindingId/v1":"196462df07973e7d86574cc51c42e0755e95f6d7361e9ac7ebf0cb70fa0c8511"}},{"ruleId":"D2","level":"warning","message":{"text":"builder.preflightAssets (cognitive 45): builder.preflightAssets has cognitive complexity 45 (threshold 15). Drivers by points: if/else 17 (37 pts), loops 5 (6 pts), boolean chains 2 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/assets.go"},"region":{"startLine":27}}}],"partialFingerprints":{"codehealthFindingId/v1":"681155b22fcaecc42e1f4d2798301c3ce615a60f2ce8dff2b0fec6dd1daa84c7"}},{"ruleId":"D2","level":"warning","message":{"text":"d2sketch.ConnectionDrawable (cognitive 45): d2sketch.ConnectionDrawable has cognitive complexity 45 (threshold 15). Drivers by points: if/else 17 (33 pts), loops 4 (6 pts), match/switch 2 (4 pts), boolean chains 2 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2sketch/scene_connection.go"},"region":{"startLine":25}}}],"partialFingerprints":{"codehealthFindingId/v1":"b800e81cf36be7bbeab1cc5dd4239dc69b42f7c139fc4102300e19185660c6c0"}},{"ruleId":"D2","level":"warning","message":{"text":"svgImporter.compileClipPathResource (cognitive 45): svgImporter.compileClipPathResource has cognitive complexity 45 (threshold 15). Drivers by points: if/else 20 (44 pts), loops 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svgimport/clip.go"},"region":{"startLine":113}}}],"partialFingerprints":{"codehealthFindingId/v1":"15f58327260cc608cd8125a6592b6ed0bc72c8d56921d5924fe05e6900d45cba"}},{"ruleId":"D2","level":"warning","message":{"text":"transformParser.number (cognitive 45): transformParser.number has cognitive complexity 45 (threshold 15). Drivers by points: if/else 14 (29 pts), boolean chains 11, loops 3 (5 pts) (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":"d2renderers/d2svgimport/transform.go"},"region":{"startLine":142}}}],"partialFingerprints":{"codehealthFindingId/v1":"4f2af72c5b88a118b2b675118f98d657357c80d518674e22f1ac15e2fdfd1846"}},{"ruleId":"D2","level":"warning","message":{"text":"d2wasm.Compile (cognitive 45): d2wasm.Compile has cognitive complexity 45 (threshold 15). Drivers by points: if/else 26 (29 pts), boolean chains 15, match/switch 1 (nesting depth added 3). Of this number, 43 points are the body\u0027s own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2js/d2wasm/functions.go"},"region":{"startLine":196}}}],"partialFingerprints":{"codehealthFindingId/v1":"ae8e8ce3fffb81b54066ea833fa513791b49d43a372ba3023b6e978864e586f6"}},{"ruleId":"D2","level":"warning","message":{"text":"watcher.watchLoop (cognitive 44): watcher.watchLoop has cognitive complexity 44 (threshold 15). Drivers by points: if/else 10 (31 pts), loops 4 (10 pts), match/switch 1 (2 pts), 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":244}}}],"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 11 (29 pts), boolean chains 11, match/switch 2 (4 pts) (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":1510}}}],"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 17 (37 pts), loops 3 (6 pts), 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":996}}}],"partialFingerprints":{"codehealthFindingId/v1":"7db490e3b7e78d07ce0fde67076740faa1b3eb890e35b3136d11145f840be1d6"}},{"ruleId":"D2","level":"warning","message":{"text":"rankSimplex.computeCutValues (cognitive 44): rankSimplex.computeCutValues has cognitive complexity 44 (threshold 15). Drivers by points: if/else 18 (36 pts), loops 6 (7 pts), boolean chains 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/hierarchy/rank_simplex.go"},"region":{"startLine":354}}}],"partialFingerprints":{"codehealthFindingId/v1":"4ec5b73739864d71686e78a8b3d23376d954af4fe518e037c2dbe84f8e577cef"}},{"ruleId":"D2","level":"warning","message":{"text":"layoutgraph.ValidatePositionedGraphSelection (cognitive 44): layoutgraph.ValidatePositionedGraphSelection has cognitive complexity 44 (threshold 15). Drivers by points: if/else 26 (35 pts), boolean chains 5, loops 4 (nesting depth added 9). Of this number, 27 points are the body\u0027s own statements and 17 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":"d2layouts/d2talalayout/internal/layoutgraph/positioned_validation.go"},"region":{"startLine":16}}}],"partialFingerprints":{"codehealthFindingId/v1":"7443799631158e974b2193def8eea7fd1d3180d9a338e0d6053b59c66c090f5a"}},{"ruleId":"D2","level":"warning","message":{"text":"Node.deltaToGuarded (cognitive 44): Node.deltaToGuarded has cognitive complexity 44 (threshold 15). Drivers by points: if/else 21 (35 pts), boolean chains 5, match/switch 3, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/node.go"},"region":{"startLine":788}}}],"partialFingerprints":{"codehealthFindingId/v1":"40b82afb0611cbcd5b7877dd8689f33cd5a4e54063021def24c9c975b36a5e5c"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.traceToShapeBorder (cognitive 44): routing.traceToShapeBorder has cognitive complexity 44 (threshold 15). Drivers by points: if/else 17 (35 pts), boolean chains 9 (nesting depth added 18). Of this number, 42 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/trace.go"},"region":{"startLine":27}}}],"partialFingerprints":{"codehealthFindingId/v1":"9610eb2ce18b54ce588b292af286f8c24d5203cfaf90926e5a02c9eaf8089f19"}},{"ruleId":"D2","level":"warning","message":{"text":"OVG.fixedOverlapsForBuild (cognitive 44): OVG.fixedOverlapsForBuild has cognitive complexity 44 (threshold 15). Drivers by points: if/else 14 (37 pts), loops 4 (5 pts), boolean chains 2 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/ovg_resource.go"},"region":{"startLine":607}}}],"partialFingerprints":{"codehealthFindingId/v1":"92fe122d8e295c88356991fe1a98c8ee5b3427e8ac0521fa4b14f74352ad08da"}},{"ruleId":"D2","level":"warning","message":{"text":"routeCaptionPlacer.Place (cognitive 44): routeCaptionPlacer.Place has cognitive complexity 44 (threshold 15). Drivers by points: if/else 14 (31 pts), boolean chains 7, loops 3 (6 pts) (nesting depth added 20). Of this number, 43 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/route_labels.go"},"region":{"startLine":58}}}],"partialFingerprints":{"codehealthFindingId/v1":"ae121f7a26314421b1bb14c75b805768e7cc022a637025ad0b06a8acec4501da"}},{"ruleId":"D2","level":"warning","message":{"text":"builder.measureLegend (cognitive 44): builder.measureLegend has cognitive complexity 44 (threshold 15). Drivers by points: if/else 26 (35 pts), boolean chains 6, loops 3 (nesting depth added 9). Of this number, 40 points are the body\u0027s own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/legend.go"},"region":{"startLine":147}}}],"partialFingerprints":{"codehealthFindingId/v1":"94188f238a7f1120656ca5ad9568a2a94ad4809b205d3205a72ed9f501bc89c9"}},{"ruleId":"D2","level":"warning","message":{"text":"svgImporter.attributes (cognitive 44): svgImporter.attributes has cognitive complexity 44 (threshold 15). Drivers by points: if/else 17 (39 pts), boolean chains 2, match/switch 1 (2 pts), 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":"d2renderers/d2svgimport/import.go"},"region":{"startLine":770}}}],"partialFingerprints":{"codehealthFindingId/v1":"8fb634bab144a00d75704dc0e4b4f9e84a0b616ecbfcde774a4744d27346c0e9"}},{"ruleId":"D2","level":"warning","message":{"text":"main.verifyStripped (cognitive 43): main.verifyStripped has cognitive complexity 43 (threshold 15). Drivers by points: if/else 11 (27 pts), loops 4 (9 pts), boolean chains 6, match/switch 1 (nesting depth added 21). The drivers above price the dispatch low by construction \u2014 a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full \u2014 so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"ci/release/releasetool/main.go"},"region":{"startLine":612}}}],"partialFingerprints":{"codehealthFindingId/v1":"cd736dcc235a030118495ea28540111362b1ae42f64783092593ffa39e2f7a19"}},{"ruleId":"D2","level":"warning","message":{"text":"printer._map (cognitive 43): printer._map has cognitive complexity 43 (threshold 15). Drivers by points: if/else 16 (34 pts), 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 15 (29 pts), loops 6 (11 pts), match/switch 1 (3 pts) (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":78}}}],"partialFingerprints":{"codehealthFindingId/v1":"8ef6ca45d8349f47886f6ed59889bc224b65d65e22f61d0c3c918642caaf6f36"}},{"ruleId":"D2","level":"warning","message":{"text":"d2talalayout.validateTopology (cognitive 43): d2talalayout.validateTopology has cognitive complexity 43 (threshold 15). Drivers by points: if/else 18 (34 pts), loops 5, boolean chains 4 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/result_validate.go"},"region":{"startLine":37}}}],"partialFingerprints":{"codehealthFindingId/v1":"dd7b202e91f93265af09369538e2cad77bd08116cad308862912ec5bf71f7f61"}},{"ruleId":"D2","level":"warning","message":{"text":"GraphState.captureGeometryStateContext (cognitive 43): GraphState.captureGeometryStateContext has cognitive complexity 43 (threshold 15). Drivers by points: if/else 11 (30 pts), loops 6 (13 pts) (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":"d2layouts/d2talalayout/internal/layoutgraph/transaction_snapshot.go"},"region":{"startLine":278}}}],"partialFingerprints":{"codehealthFindingId/v1":"f723bd1792084afb3d489ac8115345af56204c0b386d61d55c48712ac3c929c5"}},{"ruleId":"D2","level":"warning","message":{"text":"placement.optimizerDescendants (cognitive 43): placement.optimizerDescendants has cognitive complexity 43 (threshold 15). Drivers by points: if/else 18 (32 pts), loops 4 (8 pts), boolean chains 3 (nesting depth added 18). Most of this is not in the body itself: 8 of the 43 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 629, 612). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals\u0027 work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/optimization_guard.go"},"region":{"startLine":602}}}],"partialFingerprints":{"codehealthFindingId/v1":"821b9f7214d962007737db205933dcf9b7c9ceca4b51e68a439581c37e3b02b6"}},{"ruleId":"D2","level":"warning","message":{"text":"OVG.addTreeNodes (cognitive 43): OVG.addTreeNodes has cognitive complexity 43 (threshold 15). Drivers by points: if/else 14 (42 pts), loops 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":"d2layouts/d2talalayout/internal/routing/ovg.go"},"region":{"startLine":739}}}],"partialFingerprints":{"codehealthFindingId/v1":"391304d175d1622f0d423e4771dad7480e16ecb24340f70ccc64155b9c2ea163"}},{"ruleId":"D2","level":"warning","message":{"text":"d2isometricimg.writeSVGGroundShadow (cognitive 43): d2isometricimg.writeSVGGroundShadow has cognitive complexity 43 (threshold 15). Drivers by points: if/else 15 (30 pts), loops 6 (10 pts), boolean chains 3 (nesting depth added 19). Of this number, 41 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/svg_lighting.go"},"region":{"startLine":274}}}],"partialFingerprints":{"codehealthFindingId/v1":"f3e42fecd3e3c4faf42749d2f9d316627eae96d17ad01c1f13036afd7fe554ca"}},{"ruleId":"D2","level":"warning","message":{"text":"builder.arrowhead (cognitive 43): builder.arrowhead has cognitive complexity 43 (threshold 15). Drivers by points: if/else 24 (38 pts), boolean chains 2, loops 2, match/switch 1 (nesting depth added 14). Of this number, 41 points are the body\u0027s own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/connection.go"},"region":{"startLine":430}}}],"partialFingerprints":{"codehealthFindingId/v1":"76cd72f61db84cff4e16dcdb3ed5df303b1abf5de6083d9f12f58db9b60299b1"}},{"ruleId":"D2","level":"warning","message":{"text":"svgImporter.compileElement (cognitive 43): svgImporter.compileElement has cognitive complexity 43 (threshold 15). Drivers by points: if/else 26 (37 pts), boolean chains 5, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svgimport/compile.go"},"region":{"startLine":242}}}],"partialFingerprints":{"codehealthFindingId/v1":"c5dbc8c00c52d6393ec2373f6ca1ed3992a3c343ecae95c3a95e18300ec629f2"}},{"ruleId":"D2","level":"warning","message":{"text":"labeling.sortLabelPlacementEdges (cognitive 42): labeling.sortLabelPlacementEdges has cognitive complexity 42 (threshold 15). Drivers by points: if/else 10 (25 pts), loops 7 (14 pts), boolean chains 3 (nesting depth added 22). Of this number, 38 points are the body\u0027s own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into 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/d2talalayout/internal/labeling/guard.go"},"region":{"startLine":486}}}],"partialFingerprints":{"codehealthFindingId/v1":"1aed0e03f09fed7b19dc5364b809a703d1e78aee7b63546bcf8cbc94a925ea50"}},{"ruleId":"D2","level":"warning","message":{"text":"packing.blocksRoutesWithDeltasGuarded (cognitive 42): packing.blocksRoutesWithDeltasGuarded has cognitive complexity 42 (threshold 15). Drivers by points: if/else 12 (33 pts), loops 5 (9 pts) (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":"d2layouts/d2talalayout/internal/packing/binpack.go"},"region":{"startLine":1129}}}],"partialFingerprints":{"codehealthFindingId/v1":"f030449afaf77e3effea575af87bd4166aa9137ee17eed24a942d24aa7e91b0b"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.positionedArrowheadLabelCostGuarded (cognitive 42): routing.positionedArrowheadLabelCostGuarded has cognitive complexity 42 (threshold 15). Drivers by points: if/else 14 (33 pts), loops 6 (8 pts), boolean chains 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/standalone_route_guard.go"},"region":{"startLine":207}}}],"partialFingerprints":{"codehealthFindingId/v1":"9d303bc01f311de2e5040e7181c6ea7c71baac3ac011d1c52a838af8c8919966"}},{"ruleId":"D2","level":"warning","message":{"text":"meshBuilder.canonicalNode (cognitive 42): meshBuilder.canonicalNode has cognitive complexity 42 (threshold 15). Drivers by points: if/else 13 (26 pts), loops 5 (12 pts), boolean chains 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":"d2renderers/d2isometric/d2isometricimg/native_shapes.go"},"region":{"startLine":313}}}],"partialFingerprints":{"codehealthFindingId/v1":"a976fd56e23cc41fa8d2ffa28cd328e65deb785a547eb1da3ce02905c3cf316a"}},{"ruleId":"D2","level":"warning","message":{"text":"d2isometric.classifySequence (cognitive 42): d2isometric.classifySequence has cognitive complexity 42 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 9 (11 pts), boolean chains 6, match/switch 1 (2 pts) (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":"d2renderers/d2isometric/sequence.go"},"region":{"startLine":15}}}],"partialFingerprints":{"codehealthFindingId/v1":"9ea470531e6db886594a39bdf72102ba5a99aa413bda02c52873b5dcaf951e74"}},{"ruleId":"D2","level":"warning","message":{"text":"d2raster.addStrokeRun (cognitive 42): d2raster.addStrokeRun has cognitive complexity 42 (threshold 15). Drivers by points: if/else 15 (32 pts), loops 3 (5 pts), boolean chains 4, match/switch 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/geometry.go"},"region":{"startLine":677}}}],"partialFingerprints":{"codehealthFindingId/v1":"a33807a6e71b84db1bd7df8f947410c698f2abc6a919f10e2034df6c094e48d8"}},{"ruleId":"D2","level":"warning","message":{"text":"retainedVectorValidator.path (cognitive 42): retainedVectorValidator.path has cognitive complexity 42 (threshold 15). Drivers by points: if/else 13 (36 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/vector_validation.go"},"region":{"startLine":519}}}],"partialFingerprints":{"codehealthFindingId/v1":"c8126babd2ffa65f14462a913d096d51665a7b7dfcb31e353b4a728ce616c3e5"}},{"ruleId":"D2","level":"warning","message":{"text":"d2scenebuild.flattenSketchPath (cognitive 42): d2scenebuild.flattenSketchPath has cognitive complexity 42 (threshold 15). Drivers by points: if/else 16 (34 pts), loops 2 (4 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 21). Of this number, 36 points are the body\u0027s own statements and 6 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/sketch_shapes.go"},"region":{"startLine":318}}}],"partialFingerprints":{"codehealthFindingId/v1":"eac204704640ee49ca70522e22772aca4034164dcd27f3e636377636be89ec3b"}},{"ruleId":"D2","level":"warning","message":{"text":"d2svgimport.inspectEmbeddedGIF (cognitive 42): d2svgimport.inspectEmbeddedGIF has cognitive complexity 42 (threshold 15). Drivers by points: if/else 15 (39 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svgimport/image.go"},"region":{"startLine":492}}}],"partialFingerprints":{"codehealthFindingId/v1":"b5964c48fd9eeb187183ff745c388a6b14c95bf44fe16f089b8543fb2ba8d5de"}},{"ruleId":"D2","level":"warning","message":{"text":"d2layoutfeatures.Check (cognitive 42): d2layoutfeatures.Check has cognitive complexity 42 (threshold 15). Drivers by points: if/else 12 (32 pts), boolean chains 6, loops 2 (3 pts), match/switch 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/d2layoutfeatures/features.go"},"region":{"startLine":21}}}],"partialFingerprints":{"codehealthFindingId/v1":"11daaf342704b6cded03765554811047133680c658be03a9267136a86306ed1a"}},{"ruleId":"D2","level":"warning","message":{"text":"rasterimage.DecodeFirst (cognitive 42): rasterimage.DecodeFirst has cognitive complexity 42 (threshold 15). Drivers by points: if/else 20 (39 pts), boolean chains 2, match/switch 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/rasterimage/firstframe.go"},"region":{"startLine":87}}}],"partialFingerprints":{"codehealthFindingId/v1":"a146f107624338aa268b2f6f7fffa74010fbd72c083519fe0f965c40d98b0725"}},{"ruleId":"D2","level":"warning","message":{"text":"run.run (cognitive 42): run.run has cognitive complexity 42 (threshold 15). Drivers by points: if/else 17 (33 pts), loops 3 (5 pts), boolean chains 2, ternaries 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":"ci/nonlayout-perf/run.py"},"region":{"startLine":41}}}],"partialFingerprints":{"codehealthFindingId/v1":"142d1ce3d206db7569d4dae4c4e18ea0e0805c810b560eea3d91f7108c7f9702"}},{"ruleId":"D2","level":"warning","message":{"text":"graphbounds.NodeBoundingBox (cognitive 41): graphbounds.NodeBoundingBox has cognitive complexity 41 (threshold 15). Drivers by points: if/else 17 (37 pts), boolean chains 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":"d2layouts/d2talalayout/internal/graphbounds/bounds.go"},"region":{"startLine":45}}}],"partialFingerprints":{"codehealthFindingId/v1":"28c961ed2e89ad83845cf57a49270c923e0f083461045fcb3379352995cb0a60"}},{"ruleId":"D2","level":"warning","message":{"text":"labeling.clusterNodeBoundingBoxPlacement (cognitive 41): labeling.clusterNodeBoundingBoxPlacement has cognitive complexity 41 (threshold 15). Drivers by points: if/else 17 (37 pts), boolean chains 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":"d2layouts/d2talalayout/internal/labeling/guard.go"},"region":{"startLine":325}}}],"partialFingerprints":{"codehealthFindingId/v1":"cac33a9993b1f80289c6c407a94b14647c065699b12bbf71751b857de46c0028"}},{"ruleId":"D2","level":"warning","message":{"text":"Graph.doesOverlapWithDimensionsContext (cognitive 41): Graph.doesOverlapWithDimensionsContext has cognitive complexity 41 (threshold 15). Drivers by points: if/else 15 (34 pts), boolean chains 4, loops 2 (3 pts) (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":"d2layouts/d2talalayout/internal/layoutgraph/graph.go"},"region":{"startLine":338}}}],"partialFingerprints":{"codehealthFindingId/v1":"120dd4dc06c29599b1d6b316d2bb1ddba17efef5251c359b87eda3bdb23b6346"}},{"ruleId":"D2","level":"warning","message":{"text":"Transaction.markDescendantOverlapExceptions (cognitive 41): Transaction.markDescendantOverlapExceptions has cognitive complexity 41 (threshold 15). Drivers by points: if/else 16 (29 pts), loops 5 (9 pts), boolean chains 3 (nesting depth added 17). Of this number, 17 points are the body\u0027s own statements and 24 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/transaction.go"},"region":{"startLine":1021}}}],"partialFingerprints":{"codehealthFindingId/v1":"97755f9a43bf9b161f51bc122ec763e947cbb5f88bedf33c9ea55df9225694a8"}},{"ruleId":"D2","level":"warning","message":{"text":"sizedOptimizer.findUnoccupiedGuarded (cognitive 41): sizedOptimizer.findUnoccupiedGuarded has cognitive complexity 41 (threshold 15). Drivers by points: if/else 16 (37 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/sized_optimizer.go"},"region":{"startLine":619}}}],"partialFingerprints":{"codehealthFindingId/v1":"715b3ef375743e655517dad9d4b187df70cf6cad42c161f4b3ee406adeee3949"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.buildTunnels (cognitive 41): routing.buildTunnels has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (34 pts), loops 5 (7 pts) (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":"d2layouts/d2talalayout/internal/routing/tunnel.go"},"region":{"startLine":366}}}],"partialFingerprints":{"codehealthFindingId/v1":"2ef6c7760ddc28ba42e0af8d91dc32968b1c412f5cf306bc79aa20ea62a0726d"}},{"ruleId":"D2","level":"warning","message":{"text":"trees.treeContainerRDFSOrder (cognitive 41): trees.treeContainerRDFSOrder has cognitive complexity 41 (threshold 15). Drivers by points: if/else 12 (32 pts), loops 4 (8 pts), boolean chains 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/trees/preprocess_helpers.go"},"region":{"startLine":20}}}],"partialFingerprints":{"codehealthFindingId/v1":"23bba9a0e0c3faf64bf9b3d85d64dd9205a4626737a1731bddcfa93ae587f68b"}},{"ruleId":"D2","level":"warning","message":{"text":"parser.parseMap (cognitive 41): parser.parseMap has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (34 pts), loops 2 (3 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 22). To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2parser/parse.go"},"region":{"startLine":443}}}],"partialFingerprints":{"codehealthFindingId/v1":"bb97a950cd25c1240add068d4ad1f780bedd3f7d7af244a39e523ee2b4b8ea19"}},{"ruleId":"D2","level":"warning","message":{"text":"Rasterizer.rasterize (cognitive 41): Rasterizer.rasterize has cognitive complexity 41 (threshold 15). Drivers by points: if/else 13 (32 pts), loops 4 (8 pts), boolean chains 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/internal/scanline/rasterizer.go"},"region":{"startLine":1026}}}],"partialFingerprints":{"codehealthFindingId/v1":"047e43975980778c2caf55299d17653abaa1e85b650291649e499dc707135f72"}},{"ruleId":"D2","level":"warning","message":{"text":"svgImporter.parseEmbeddedRasterDataURI (cognitive 41): svgImporter.parseEmbeddedRasterDataURI has cognitive complexity 41 (threshold 15). Drivers by points: if/else 16 (29 pts), boolean chains 9, loops 2, match/switch 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svgimport/image.go"},"region":{"startLine":199}}}],"partialFingerprints":{"codehealthFindingId/v1":"0049cc11a6ddf8a61c937f883fe2bdb33e1b328fb2be95ade2e59aaf6f4a77f2"}},{"ruleId":"D2","level":"warning","message":{"text":"main.discoverTests (cognitive 41): main.discoverTests has cognitive complexity 41 (threshold 15). Drivers by points: if/else 23 (30 pts), boolean chains 7, loops 2, match/switch 1 (2 pts) (nesting depth added 8). Of this number, 23 points are the body\u0027s own statements and 18 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":"e2etests/report/main.go"},"region":{"startLine":46}}}],"partialFingerprints":{"codehealthFindingId/v1":"9fa8fd1f5302721ed02b0df0be1655dddac628934573c27b468c97fcabffe98b"}},{"ruleId":"D2","level":"warning","message":{"text":"textmeasure.newMarkdownSubstitutionMatcher (cognitive 41): textmeasure.newMarkdownSubstitutionMatcher has cognitive complexity 41 (threshold 15). Drivers by points: if/else 12 (31 pts), loops 6 (10 pts) (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":"lib/textmeasure/substitutions.go"},"region":{"startLine":139}}}],"partialFingerprints":{"codehealthFindingId/v1":"8a1ed4f64c95668878665237f2b1a4ac49cf054c7c769d4e19b729d7982a58f0"}},{"ruleId":"D2","level":"warning","message":{"text":"d2cli.bundleRasterPreview (cognitive 40): d2cli.bundleRasterPreview has cognitive complexity 40 (threshold 15). Drivers by points: if/else 19 (34 pts), loops 4, boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2cli/raster.go"},"region":{"startLine":756}}}],"partialFingerprints":{"codehealthFindingId/v1":"63aa566119b11aac4327547b4778b7650c0002900ab8f5b6da2db516affa7622"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.sourceAndTargetClusterNodesGuarded (cognitive 40): routing.sourceAndTargetClusterNodesGuarded has cognitive complexity 40 (threshold 15). Drivers by points: if/else 10 (31 pts), loops 4 (9 pts) (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":"d2layouts/d2talalayout/internal/routing/standalone_route_guard.go"},"region":{"startLine":115}}}],"partialFingerprints":{"codehealthFindingId/v1":"7679d9ffa3c84f086c40273bc544c234bcff74b094537d27f2283e0fb8e45670"}},{"ruleId":"D2","level":"warning","message":{"text":"d2lib.compileBoard (cognitive 40): d2lib.compileBoard has cognitive complexity 40 (threshold 15). Drivers by points: if/else 15 (32 pts), boolean chains 5, loops 3 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2lib/d2.go"},"region":{"startLine":184}}}],"partialFingerprints":{"codehealthFindingId/v1":"6a52565e13a37898076d09d49dda170cd4537c90fcc5bca13f21d69093bc58e4"}},{"ruleId":"D2","level":"warning","message":{"text":"d2oracle.generateUniqueKey (cognitive 40): d2oracle.generateUniqueKey has cognitive complexity 40 (threshold 15). Drivers by points: if/else 15 (32 pts), loops 3 (5 pts), boolean chains 3 (nesting depth added 19). To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2oracle/edit.go"},"region":{"startLine":2650}}}],"partialFingerprints":{"codehealthFindingId/v1":"e94f4ab9bf71bc2788c837617080a5553bfa716740c8b72828529f995680aebe"}},{"ruleId":"D2","level":"warning","message":{"text":"d2isometricimg.newRaster (cognitive 40): d2isometricimg.newRaster has cognitive complexity 40 (threshold 15). Drivers by points: if/else 22 (31 pts), boolean chains 5, loops 3 (4 pts) (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/d2isometric/d2isometricimg/raster.go"},"region":{"startLine":165}}}],"partialFingerprints":{"codehealthFindingId/v1":"45541e8d7458bf76243232d497b6042b79537cb7231e6bf9279a763158f3bd90"}},{"ruleId":"D2","level":"warning","message":{"text":"meshBuilder.hierarchyBoard (cognitive 40): meshBuilder.hierarchyBoard has cognitive complexity 40 (threshold 15). Drivers by points: if/else 15 (23 pts), loops 4 (10 pts), boolean chains 7 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/hierarchy_boards.go"},"region":{"startLine":296}}}],"partialFingerprints":{"codehealthFindingId/v1":"328533823e43bfaf70c2f71ed81aa544d94142109039480b0dd01e0534b62791"}},{"ruleId":"D2","level":"warning","message":{"text":"d2isometric.composeHierarchy (cognitive 40): d2isometric.composeHierarchy has cognitive complexity 40 (threshold 15). Drivers by points: if/else 15 (29 pts), loops 7 (10 pts), boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/hierarchy.go"},"region":{"startLine":13}}}],"partialFingerprints":{"codehealthFindingId/v1":"7f14927ec7961ef28d196a8a99cda15428781b7b2b69e530a04d54263eae5da8"}},{"ruleId":"D2","level":"warning","message":{"text":"d2raster.paintDropShadowInteger (cognitive 40): d2raster.paintDropShadowInteger has cognitive complexity 40 (threshold 15). Drivers by points: if/else 14 (32 pts), boolean chains 5, loops 2 (3 pts) (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":"d2renderers/d2raster/filter.go"},"region":{"startLine":955}}}],"partialFingerprints":{"codehealthFindingId/v1":"9cc9921665644ac34d4e7c58023c1436b3b97b791bdca6afc82ab8c7f614be8b"}},{"ruleId":"D2","level":"warning","message":{"text":"d2raster.drawSampledPreparedImage (cognitive 40): d2raster.drawSampledPreparedImage has cognitive complexity 40 (threshold 15). Drivers by points: if/else 7 (25 pts), loops 5 (13 pts), boolean chains 2 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/image.go"},"region":{"startLine":1022}}}],"partialFingerprints":{"codehealthFindingId/v1":"23a8eb5931c8ed1173375340c0df387228647eb824d1e828080b1aa1932e6bb8"}},{"ruleId":"D2","level":"warning","message":{"text":"imagediff.CompareImages (cognitive 40): imagediff.CompareImages has cognitive complexity 40 (threshold 15). Drivers by points: if/else 17 (29 pts), loops 3 (6 pts), boolean chains 5 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/testutil/imagediff/imagediff.go"},"region":{"startLine":118}}}],"partialFingerprints":{"codehealthFindingId/v1":"838a4ceb986420c299755ab8f02a96395409b66d0ec185b718716230aca18da1"}},{"ruleId":"D2","level":"warning","message":{"text":"xgif.quantizeFewOpaqueColorsWithWorkspace (cognitive 40): xgif.quantizeFewOpaqueColorsWithWorkspace has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (34 pts), loops 3 (6 pts) (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":"lib/xgif/xgif.go"},"region":{"startLine":309}}}],"partialFingerprints":{"codehealthFindingId/v1":"2c9a3e07bb8e1b21720cf1a62d282085a96981e807c732c486631632ba1472a8"}},{"ruleId":"D2","level":"warning","message":{"text":"d2cli.relink (cognitive 39): d2cli.relink has cognitive complexity 39 (threshold 15). Drivers by points: if/else 9 (28 pts), loops 7 (11 pts) (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":"d2cli/main.go"},"region":{"startLine":817}}}],"partialFingerprints":{"codehealthFindingId/v1":"3ddc37ec7d3918759524a8441252414c5f1b772d6f05861a0d0eceb3c025dec8"}},{"ruleId":"D2","level":"warning","message":{"text":"bendCollisionIndex.countEdgeIntersects (cognitive 39): bendCollisionIndex.countEdgeIntersects has cognitive complexity 39 (threshold 15). Drivers by points: if/else 12 (39 pts) (nesting depth added 27). None of this is in the body itself: all 39 points belong to one function literal inside it that branches (line 276). 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/d2elklayout/spatial_index.go"},"region":{"startLine":269}}}],"partialFingerprints":{"codehealthFindingId/v1":"2d4e1a3649c04f5883e910d18d6b567a25c1fa559124560bec5581c02f4377d0"}},{"ruleId":"D2","level":"warning","message":{"text":"d2grid.newGridDiagram (cognitive 39): d2grid.newGridDiagram has cognitive complexity 39 (threshold 15). Drivers by points: if/else 21 (34 pts), boolean chains 4, 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":"d2layouts/d2grid/grid_diagram.go"},"region":{"startLine":28}}}],"partialFingerprints":{"codehealthFindingId/v1":"24c7a24373376e26d793e6eca74915fdfab8a969a39fcaa0256aa35707048084"}},{"ruleId":"D2","level":"warning","message":{"text":"Graph.isStructurallyBadStateWithFixedOriginContext (cognitive 39): Graph.isStructurallyBadStateWithFixedOriginContext has cognitive complexity 39 (threshold 15). Drivers by points: if/else 15 (28 pts), boolean chains 8, loops 1 (3 pts) (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":"d2layouts/d2talalayout/internal/layoutgraph/graph.go"},"region":{"startLine":128}}}],"partialFingerprints":{"codehealthFindingId/v1":"162547254ebe9aaf9098347d6b00f01e9256e26919ea878f9a0d8f41d37b37a2"}},{"ruleId":"D2","level":"warning","message":{"text":"Node.boundingBoxValues (cognitive 39): Node.boundingBoxValues has cognitive complexity 39 (threshold 15). Drivers by points: if/else 20 (36 pts), boolean chains 3 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/node.go"},"region":{"startLine":93}}}],"partialFingerprints":{"codehealthFindingId/v1":"f01e1cc3e910d804161031a88bc319be237a9fab5b4202a5296c1ae84b16f9f4"}},{"ruleId":"D2","level":"warning","message":{"text":"packing.binPackHasExternalConnection (cognitive 39): packing.binPackHasExternalConnection has cognitive complexity 39 (threshold 15). Drivers by points: if/else 12 (31 pts), loops 4 (7 pts), boolean chains 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/packing/guard.go"},"region":{"startLine":86}}}],"partialFingerprints":{"codehealthFindingId/v1":"ee645ba4b393fc2286415ffe7b1dc7eae278e82d2a0377afea904c94cce515e6"}},{"ruleId":"D2","level":"warning","message":{"text":"placement.optimizerMedian (cognitive 39): placement.optimizerMedian has cognitive complexity 39 (threshold 15). Drivers by points: if/else 22 (34 pts), boolean chains 4, loops 1 (nesting depth added 12). Of this number, 35 points are the body\u0027s own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/optimization_guard.go"},"region":{"startLine":332}}}],"partialFingerprints":{"codehealthFindingId/v1":"8b1e5725cfddaaf3c4d307b6c8f102dc2059afbe780900461881be952b5d13a8"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.nudgeChannelsGuarded (cognitive 39): routing.nudgeChannelsGuarded has cognitive complexity 39 (threshold 15). Drivers by points: if/else 14 (32 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/nudge_channels.go"},"region":{"startLine":50}}}],"partialFingerprints":{"codehealthFindingId/v1":"a1bbe936b58f85311830ffed0846a4b3ca9b8d165bd565d153f5315a4adfe33c"}},{"ruleId":"D2","level":"warning","message":{"text":"OVG.addEdgesNodes (cognitive 39): OVG.addEdgesNodes has cognitive complexity 39 (threshold 15). Drivers by points: if/else 15 (35 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/ovg.go"},"region":{"startLine":433}}}],"partialFingerprints":{"codehealthFindingId/v1":"67e15b94472436ea44b857c56469ef1a4045a3fc985ad0698445f45aef2be9d5"}},{"ruleId":"D2","level":"warning","message":{"text":"asciishapes.DrawPerson (cognitive 39): asciishapes.DrawPerson has cognitive complexity 39 (threshold 15). Drivers by points: if/else 8 (23 pts), boolean chains 10, loops 2 (3 pts), match/switch 1 (3 pts) (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":"meshBuilder.arrowRetreat (cognitive 39): meshBuilder.arrowRetreat has cognitive complexity 39 (threshold 15). Drivers by points: if/else 13 (29 pts), boolean chains 5, loops 3 (5 pts) (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/d2isometric/d2isometricimg/arrow_visibility.go"},"region":{"startLine":328}}}],"partialFingerprints":{"codehealthFindingId/v1":"3ff55298fd5e2c5d2e929d82aa3790a3d2d07e59b7cdc8153125aafebe1f42b0"}},{"ruleId":"D2","level":"warning","message":{"text":"d2raster.boxBlurRGBAExpanded (cognitive 39): d2raster.boxBlurRGBAExpanded has cognitive complexity 39 (threshold 15). Drivers by points: if/else 9 (31 pts), loops 4 (8 pts) (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. This shape REPEATS in the file: one other method here (d2raster.boxBlurAlphaPixelsExpanded) has the same decision points, in the same order, at the same nesting depths \u2014 so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/filter.go"},"region":{"startLine":560}}}],"partialFingerprints":{"codehealthFindingId/v1":"d3b1be95343d982b8de8207c3924bf26040a22f365c0da962d456f5237173c3c"}},{"ruleId":"D2","level":"warning","message":{"text":"d2raster.boxBlurAlphaPixelsExpanded (cognitive 39): d2raster.boxBlurAlphaPixelsExpanded has cognitive complexity 39 (threshold 15). Drivers by points: if/else 9 (31 pts), loops 4 (8 pts) (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. This shape REPEATS in the file: one other method here (d2raster.boxBlurRGBAExpanded) has the same decision points, in the same order, at the same nesting depths \u2014 so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/filter.go"},"region":{"startLine":778}}}],"partialFingerprints":{"codehealthFindingId/v1":"69e868645b8b55ae1e229dbb3b3d5427ac0dacbb7523a20681c22b534f3716e9"}},{"ruleId":"D2","level":"warning","message":{"text":"d2raster.planFilterResources (cognitive 39): d2raster.planFilterResources has cognitive complexity 39 (threshold 15). Drivers by points: if/else 9 (30 pts), loops 3 (7 pts), match/switch 1 (2 pts) (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":"d2renderers/d2raster/filter.go"},"region":{"startLine":1214}}}],"partialFingerprints":{"codehealthFindingId/v1":"e5bba8f7abae372329ee2df7faccb7c7d7a103156d4eaec6f6a9e467ceb0c5af"}},{"ruleId":"D2","level":"warning","message":{"text":"d2raster.drawDirectPatternMaskPixels (cognitive 39): d2raster.drawDirectPatternMaskPixels has cognitive complexity 39 (threshold 15). Drivers by points: if/else 14 (34 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 21). Of this number, 37 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/gradient.go"},"region":{"startLine":1022}}}],"partialFingerprints":{"codehealthFindingId/v1":"adf2cda2a5ede90fc47c87b5c58c38baa2f1f79586600a4275fb91e8a4ab66bb"}},{"ruleId":"D2","level":"warning","message":{"text":"svgImporter.validateClipTree (cognitive 39): svgImporter.validateClipTree has cognitive complexity 39 (threshold 15). Drivers by points: if/else 11 (32 pts), boolean chains 4, loops 2 (3 pts) (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":"d2renderers/d2svgimport/clip.go"},"region":{"startLine":38}}}],"partialFingerprints":{"codehealthFindingId/v1":"13ab1ac3042f29c88f4e9c99fdf9a4be5dfa7de3a13a1cf56da2dbf435409b95"}},{"ruleId":"D2","level":"warning","message":{"text":"imageasset.expandDeclaredSVG (cognitive 39): imageasset.expandDeclaredSVG has cognitive complexity 39 (threshold 15). Drivers by points: if/else 15 (35 pts), boolean chains 3, loops 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/imageasset/probe.go"},"region":{"startLine":148}}}],"partialFingerprints":{"codehealthFindingId/v1":"9f6bc2a833b38d76be23fe81b363a4072f788b2d127f7062811a09b3dc83a8f6"}},{"ruleId":"D2","level":"warning","message":{"text":"markdownPainter.atomizeInlineTokens (cognitive 39): markdownPainter.atomizeInlineTokens has cognitive complexity 39 (threshold 15). Drivers by points: if/else 7 (22 pts), loops 6 (12 pts), boolean chains 5 (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":"lib/textmeasure/markdown_svg.go"},"region":{"startLine":1191}}}],"partialFingerprints":{"codehealthFindingId/v1":"305eaff4389dec768f7c2cca43dbcfa3f7a3996748ebf43ea2c833e00031a9d0"}},{"ruleId":"D2","level":"warning","message":{"text":"d2compiler.compileConfig (cognitive 38): d2compiler.compileConfig has cognitive complexity 38 (threshold 15). Drivers by points: if/else 15 (19 pts), match/switch 2 (10 pts), loops 2 (7 pts), 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":1823}}}],"partialFingerprints":{"codehealthFindingId/v1":"90951f009473e059cbe8d90676b48fb13bd73a77ea39fd5362817f7a05b43963"}},{"ruleId":"D2","level":"warning","message":{"text":"Graph.allDescendantNodesGuarded (cognitive 38): Graph.allDescendantNodesGuarded has cognitive complexity 38 (threshold 15). Drivers by points: if/else 15 (28 pts), loops 4 (8 pts), boolean chains 2 (nesting depth added 17). Most of this is not in the body itself: 14 of the 38 points are its own statements and the rest belongs to one function literal inside it that branches (line 971). 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/d2talalayout/internal/layoutgraph/graph.go"},"region":{"startLine":955}}}],"partialFingerprints":{"codehealthFindingId/v1":"3e7e6eece9439886e0bddf386cd096ce7438a5cfe22573a967e95c350bce350d"}},{"ruleId":"D2","level":"warning","message":{"text":"Graph.buildNodeToTreeGuarded (cognitive 38): Graph.buildNodeToTreeGuarded has cognitive complexity 38 (threshold 15). Drivers by points: if/else 8 (25 pts), loops 5 (11 pts), boolean chains 2 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/tree_access.go"},"region":{"startLine":48}}}],"partialFingerprints":{"codehealthFindingId/v1":"5312650670da6c157b9bffd3c1ba629d37a435511a199ed51579a9b0229690b8"}},{"ruleId":"D2","level":"warning","message":{"text":"Node.isVisibilityGraphCandidate (cognitive 38): Node.isVisibilityGraphCandidate has cognitive complexity 38 (threshold 15). Drivers by points: if/else 16 (36 pts), boolean chains 2 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/node.go"},"region":{"startLine":1359}}}],"partialFingerprints":{"codehealthFindingId/v1":"a96b26b74185d99c3a880112cb8dde6c7d75614fce3cb7313d59556c3b453830"}},{"ruleId":"D2","level":"warning","message":{"text":"packing.placementCandidatesGuarded (cognitive 38): packing.placementCandidatesGuarded has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (29 pts), loops 2 (4 pts), match/switch 1 (4 pts), boolean chains 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/packing/binpack.go"},"region":{"startLine":1032}}}],"partialFingerprints":{"codehealthFindingId/v1":"0ad5b43d805eb251016bb75f35e091c3c06afbcfc7f6eede2b9b2af5fd95f2bb"}},{"ruleId":"D2","level":"warning","message":{"text":"placement.mirrorAxes (cognitive 38): placement.mirrorAxes has cognitive complexity 38 (threshold 15). Drivers by points: if/else 19 (28 pts), loops 5 (6 pts), boolean chains 4 (nesting depth added 10). Of this number, 20 points are the body\u0027s own statements and 18 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/direct.go"},"region":{"startLine":167}}}],"partialFingerprints":{"codehealthFindingId/v1":"f4f63bd5d66284fd07d2c608c9f504730fff67e621f844db3621f2170c33a8e7"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.checkBalanceOrder (cognitive 38): routing.checkBalanceOrder has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (32 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/balance_route_guard.go"},"region":{"startLine":167}}}],"partialFingerprints":{"codehealthFindingId/v1":"1f48c67eb2d9ddbd3190c831eec0ccbe4940695f38fb02c2677fc423ee8ddb5d"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.buildOVGFromGraphWithGuard (cognitive 38): routing.buildOVGFromGraphWithGuard has cognitive complexity 38 (threshold 15). Drivers by points: if/else 25 (34 pts), 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/d2talalayout/internal/routing/ovg.go"},"region":{"startLine":130}}}],"partialFingerprints":{"codehealthFindingId/v1":"0a117bddfd82279a400e5c42ae32e357a80695862ae923d6a2bc65249837354e"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.fixedOverlapsForRoute (cognitive 38): routing.fixedOverlapsForRoute has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (33 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/route_search_guard.go"},"region":{"startLine":304}}}],"partialFingerprints":{"codehealthFindingId/v1":"c663296515f03026b03c84e70abbe441db82b7c54ec710c63599cb1f345736ab"}},{"ruleId":"D2","level":"warning","message":{"text":"OVG.createPortsConnectionsToBoundaries (cognitive 38): OVG.createPortsConnectionsToBoundaries has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (30 pts), match/switch 2 (5 pts), loops 2 (3 pts) (nesting depth added 23). Most of this is not in the body itself: 8 of the 38 points are its own statements and the rest belongs to one function literal inside it that branches (line 1470). 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/d2talalayout/internal/routing/ovg.go"},"region":{"startLine":1455}}}],"partialFingerprints":{"codehealthFindingId/v1":"3fbc264cbe912d4f67ae86c2e26c90874e815eba0cc656b8006ff182da222be6"}},{"ruleId":"D2","level":"warning","message":{"text":"trees.buildNodeToTreeGuarded (cognitive 38): trees.buildNodeToTreeGuarded has cognitive complexity 38 (threshold 15). Drivers by points: if/else 8 (25 pts), loops 5 (11 pts), boolean chains 2 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/trees/preprocess_helpers.go"},"region":{"startLine":651}}}],"partialFingerprints":{"codehealthFindingId/v1":"f8b8b1f4b9bb6ed83dd2605e4d2efa0a5f8b864bec7082069b87f99e827f6cee"}},{"ruleId":"D2","level":"warning","message":{"text":"d2fonts.probeFontFileCoverage (cognitive 38): d2fonts.probeFontFileCoverage has cognitive complexity 38 (threshold 15). Drivers by points: if/else 15 (30 pts), boolean chains 5, loops 2 (3 pts) (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/d2fonts/fallback.go"},"region":{"startLine":483}}}],"partialFingerprints":{"codehealthFindingId/v1":"7ac6526c268bde0299254b2fff93757ad41bb00c5319d0920b31ec11c128bb24"}},{"ruleId":"D2","level":"warning","message":{"text":"retainedVectorValidator.node (cognitive 38): retainedVectorValidator.node has cognitive complexity 38 (threshold 15). Drivers by points: if/else 23 (31 pts), boolean chains 6, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/vector_validation.go"},"region":{"startLine":127}}}],"partialFingerprints":{"codehealthFindingId/v1":"a67bcbcd2d37c6bfd1b74578f84929f72c9eb0e78b8db67def446c3a09f401f4"}},{"ruleId":"D2","level":"warning","message":{"text":"run.fingerprints (cognitive 38): run.fingerprints has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (29 pts), loops 3 (6 pts), 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":"ci/nonlayout-perf/run.py"},"region":{"startLine":142}}}],"partialFingerprints":{"codehealthFindingId/v1":"24513e65c628941553c1755ddc99338affd3fafafadef91d93b38ee5045f5367"}},{"ruleId":"D2","level":"warning","message":{"text":"gridDiagram.layoutEvenly (cognitive 37): gridDiagram.layoutEvenly has cognitive complexity 37 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 10 (18 pts) (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":233}}}],"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 8 (21 pts), if/else 5 (16 pts) (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":"hierarchy.assign (cognitive 37): hierarchy.assign has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (22 pts), loops 7 (14 pts), boolean chains 1 (nesting depth added 18). Of this number, 36 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/hierarchy/discovery.go"},"region":{"startLine":111}}}],"partialFingerprints":{"codehealthFindingId/v1":"69ad03083b94054addf885d605ff8eaff3a1f1427f5b1c351f0f2f6e328145f9"}},{"ruleId":"D2","level":"warning","message":{"text":"Cluster.arrangeNodesWithWork (cognitive 37): Cluster.arrangeNodesWithWork has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (33 pts), loops 2 (4 pts) (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":"d2layouts/d2talalayout/internal/layoutgraph/cluster.go"},"region":{"startLine":115}}}],"partialFingerprints":{"codehealthFindingId/v1":"1dfda650f8375db55f31b85d2f4da635cad7bd8effda029f51e86f9ddb464dc2"}},{"ruleId":"D2","level":"warning","message":{"text":"Graph.restoreEdgeAbductions (cognitive 37): Graph.restoreEdgeAbductions has cognitive complexity 37 (threshold 15). Drivers by points: if/else 14 (34 pts), loops 2, boolean chains 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/layout.go"},"region":{"startLine":72}}}],"partialFingerprints":{"codehealthFindingId/v1":"c1c5ad1b506e231d1b145762da518a038198494fc30f7f3d3eab797c30559089"}},{"ruleId":"D2","level":"warning","message":{"text":"packing.routedEdgeSegments (cognitive 37): packing.routedEdgeSegments has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (32 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/packing/binpack.go"},"region":{"startLine":1224}}}],"partialFingerprints":{"codehealthFindingId/v1":"1abd928c80edcab90c7e8ff05feef053988e399099f394a72b379988b9322644"}},{"ruleId":"D2","level":"warning","message":{"text":"placement.nearestFrom (cognitive 37): placement.nearestFrom has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (36 pts), loops 1 (nesting depth added 25). To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/compaction.go"},"region":{"startLine":487}}}],"partialFingerprints":{"codehealthFindingId/v1":"6b252bc9393f31a256566a0d9a358123575752760e0d9c1c47fc8554c8dbf99f"}},{"ruleId":"D2","level":"warning","message":{"text":"placement.nearestBetween (cognitive 37): placement.nearestBetween has cognitive complexity 37 (threshold 15). Drivers by points: if/else 14 (35 pts), boolean chains 1, loops 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/gapreduction.go"},"region":{"startLine":155}}}],"partialFingerprints":{"codehealthFindingId/v1":"ac88ed1d06887ff77305568e8f44624d6c92a19e0caae458d75f4cb95c8f71c9"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.shortcutParallelClearance (cognitive 37): routing.shortcutParallelClearance has cognitive complexity 37 (threshold 15). Drivers by points: if/else 9 (29 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/shortcut_routes.go"},"region":{"startLine":469}}}],"partialFingerprints":{"codehealthFindingId/v1":"a6a04a4d2ddb3c3eebe078b0362185d235e03f5c38f8d1902a7318110a85fd05"}},{"ruleId":"D2","level":"warning","message":{"text":"OVG.addNewBoundaryLayers (cognitive 37): OVG.addNewBoundaryLayers has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (34 pts), loops 2 (3 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/ovg.go"},"region":{"startLine":829}}}],"partialFingerprints":{"codehealthFindingId/v1":"afbbe3d38b2f7ce897c0c840e4ee3f55bd3136c2c68496fc885a5c973b274952"}},{"ruleId":"D2","level":"warning","message":{"text":"ovgEdgeRouter.generateRoutes (cognitive 37): ovgEdgeRouter.generateRoutes has cognitive complexity 37 (threshold 15). Drivers by points: if/else 14 (35 pts), boolean chains 1, loops 1 (nesting depth added 21). Of this number, 35 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/ovg_edge_router.go"},"region":{"startLine":349}}}],"partialFingerprints":{"codehealthFindingId/v1":"6fe88ef388e9cc04d18cdc2e6bbc1bec4a78858c5db4c15983701f87a5c5d7da"}},{"ruleId":"D2","level":"warning","message":{"text":"ASCIIartist.Render (cognitive 37): ASCIIartist.Render has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (19 pts), loops 6 (9 pts), match/switch 2 (5 pts), 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":215}}}],"partialFingerprints":{"codehealthFindingId/v1":"190f6c747f8efb02667f36daf28e80662f160a0d2a2740f85a1dfa84deb49ceb"}},{"ruleId":"D2","level":"warning","message":{"text":"preflight.assets (cognitive 37): preflight.assets has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (33 pts), loops 2, match/switch 1 (2 pts) (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":"d2renderers/d2raster/raster.go"},"region":{"startLine":837}}}],"partialFingerprints":{"codehealthFindingId/v1":"dcb8fdd4b239c0eee06cb536aa5e8d7459cfa5a80461c940318275863ced307f"}},{"ruleId":"D2","level":"warning","message":{"text":"builder.buildConnection (cognitive 37): builder.buildConnection has cognitive complexity 37 (threshold 15). Drivers by points: if/else 24 (33 pts), boolean chains 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":"d2renderers/d2scenebuild/connection.go"},"region":{"startLine":28}}}],"partialFingerprints":{"codehealthFindingId/v1":"5b962327fb4cc017667aea9275e782faf81e020a87a73c4ef7dffbadba903571"}},{"ruleId":"D2","level":"warning","message":{"text":"colrv1Builder.paint (cognitive 37): colrv1Builder.paint has cognitive complexity 37 (threshold 15). Drivers by points: if/else 18 (34 pts), loops 1 (2 pts), match/switch 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/internal/fontface/colrv1.go"},"region":{"startLine":223}}}],"partialFingerprints":{"codehealthFindingId/v1":"75311f9228755871d63bd353cc4a13661fa2abe1001130b2615dc00b060b58d0"}},{"ruleId":"D2","level":"warning","message":{"text":"d2target.validateRenderConnection (cognitive 37): d2target.validateRenderConnection has cognitive complexity 37 (threshold 15). Drivers by points: if/else 17 (29 pts), boolean chains 6, loops 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2target/render_validation.go"},"region":{"startLine":166}}}],"partialFingerprints":{"codehealthFindingId/v1":"4f8e0b188236f50ba8315a7a1d9d08df475188b27546b9aeb8080ae405db8b18"}},{"ruleId":"D2","level":"warning","message":{"text":"xgif.NormalizePalettedImage (cognitive 37): xgif.NormalizePalettedImage has cognitive complexity 37 (threshold 15). Drivers by points: if/else 16 (22 pts), loops 4 (8 pts), boolean chains 7 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/xgif/xgif.go"},"region":{"startLine":1069}}}],"partialFingerprints":{"codehealthFindingId/v1":"79b43ee0e11519e9b9d66ae734f7b58c92801fea1ab6bdbe7da4d19b15162140"}},{"ruleId":"D2","level":"warning","message":{"text":"Graph.IDA (cognitive 36): Graph.IDA has cognitive complexity 36 (threshold 15). Drivers by points: if/else 11 (25 pts), loops 5 (11 pts) (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":92}}}],"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 23 (29 pts), 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":510}}}],"partialFingerprints":{"codehealthFindingId/v1":"e31416de458b09764631e48c4476bf97588ce4825b76e20c687d36f575a1cfa1"}},{"ruleId":"D2","level":"warning","message":{"text":"d2talalayout.buildLayoutPatch (cognitive 36): d2talalayout.buildLayoutPatch has cognitive complexity 36 (threshold 15). Drivers by points: if/else 16 (32 pts), loops 4 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/patch.go"},"region":{"startLine":158}}}],"partialFingerprints":{"codehealthFindingId/v1":"01e60aece49fb1addfe0bdde3582e5957f187c9f92ee7f0ca5ef8d6668422b48"}},{"ruleId":"D2","level":"warning","message":{"text":"placementcost.flowContinuityCost (cognitive 36): placementcost.flowContinuityCost has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (24 pts), boolean chains 6, loops 4 (6 pts) (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/d2talalayout/internal/placementcost/flow_continuity.go"},"region":{"startLine":19}}}],"partialFingerprints":{"codehealthFindingId/v1":"6efb485707f661e1c0b3fc44a1fc3aa53cda6475aba79f8ff62e93006681caed"}},{"ruleId":"D2","level":"warning","message":{"text":"quality.sortSharedSegments (cognitive 36): quality.sortSharedSegments has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 5 (12 pts), boolean chains 2 (nesting depth added 20). Of this number, 35 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/quality/labels.go"},"region":{"startLine":512}}}],"partialFingerprints":{"codehealthFindingId/v1":"87ab585363404ae593b4eb413ccbbe4e631b51688a700ad37cbca7941591c900"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.routeEdgesWithResourceGuards (cognitive 36): routing.routeEdgesWithResourceGuards has cognitive complexity 36 (threshold 15). Drivers by points: if/else 15 (29 pts), loops 5 (7 pts) (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":"d2layouts/d2talalayout/internal/routing/coordinator.go"},"region":{"startLine":419}}}],"partialFingerprints":{"codehealthFindingId/v1":"cc43c3fa69e11d9f28bf546496796e47b3a103d03fd128c5b5332c75379ee7df"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.newOVGForHierarchy (cognitive 36): routing.newOVGForHierarchy has cognitive complexity 36 (threshold 15). Drivers by points: if/else 19 (26 pts), loops 5 (9 pts), match/switch 1 (nesting depth added 11). Of this number, 32 points are the body\u0027s own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/ovg_hierarchy.go"},"region":{"startLine":15}}}],"partialFingerprints":{"codehealthFindingId/v1":"33d7db4e460a18f19f63406d497f4c875a82fb593f965affaf94525b33bcb295"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.routeStageGraphBoundingBox (cognitive 36): routing.routeStageGraphBoundingBox has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14 (28 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 15). Of this number, 31 points are the body\u0027s own statements and 5 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into 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/d2talalayout/internal/routing/route_stage_guard.go"},"region":{"startLine":400}}}],"partialFingerprints":{"codehealthFindingId/v1":"8dc3ef075711feb7016ca92e7ffb83754b4d80051f4c633290ca5af4f0d7984c"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.swapEdgesOnSameSide (cognitive 36): routing.swapEdgesOnSameSide has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (32 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 21). Of this number, 30 points are the body\u0027s own statements and 6 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/swap_ports.go"},"region":{"startLine":82}}}],"partialFingerprints":{"codehealthFindingId/v1":"6beee6f905cf1887c432e0c40cfab7907d656b145ae0b01bae0938d096b839bc"}},{"ruleId":"D2","level":"warning","message":{"text":"d2oracle.deleteMapField (cognitive 36): d2oracle.deleteMapField has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (32 pts), boolean chains 3, loops 1 (nesting depth added 23). To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2oracle/edit.go"},"region":{"startLine":1417}}}],"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 10 (21 pts), boolean chains 9, loops 2 (3 pts), match/switch 1 (3 pts) (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":"d2isometricimg.surfaceIconLayout (cognitive 36): d2isometricimg.surfaceIconLayout has cognitive complexity 36 (threshold 15). Drivers by points: if/else 19 (27 pts), boolean chains 9 (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":"d2renderers/d2isometric/d2isometricimg/surface_icons.go"},"region":{"startLine":306}}}],"partialFingerprints":{"codehealthFindingId/v1":"25b3aefaeda5e9795f69303a24ff3e4da816aa540109b9e34949ef40b3eab8e2"}},{"ruleId":"D2","level":"warning","message":{"text":"d2raster.applyNonZeroClip (cognitive 36): d2raster.applyNonZeroClip has cognitive complexity 36 (threshold 15). Drivers by points: if/else 15 (26 pts), boolean chains 5, loops 3 (5 pts) (nesting depth added 13). Most of this is not in the body itself: 13 of the 36 points are its own statements and the rest belongs to one function literal inside it that branches (line 815). 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":"d2renderers/d2raster/effects.go"},"region":{"startLine":791}}}],"partialFingerprints":{"codehealthFindingId/v1":"b579dfdc5e82929ab36b5e5451d0be4a830a58f8b35bec64658f3ad79c69eb08"}},{"ruleId":"D2","level":"warning","message":{"text":"d2raster.drawRadialGradientMaskPixels (cognitive 36): d2raster.drawRadialGradientMaskPixels has cognitive complexity 36 (threshold 15). Drivers by points: if/else 11 (32 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/gradient.go"},"region":{"startLine":1268}}}],"partialFingerprints":{"codehealthFindingId/v1":"bdc8fae8b0c11d8093f019d6baa4a6885ebf19759a808384ac35e8aa6fb96616"}},{"ruleId":"D2","level":"warning","message":{"text":"preflight.prepareFilters (cognitive 36): preflight.prepareFilters has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (29 pts), boolean chains 4, match/switch 1 (2 pts), 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":"d2renderers/d2raster/filter.go"},"region":{"startLine":132}}}],"partialFingerprints":{"codehealthFindingId/v1":"17dadc937eecd66fa858567bf77674718a91e1385627416ae2462325b72aaea2"}},{"ruleId":"D2","level":"warning","message":{"text":"d2scenebuild.parsePaperPatternSource (cognitive 36): d2scenebuild.parsePaperPatternSource has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14 (25 pts), boolean chains 4, loops 3 (4 pts), match/switch 1 (3 pts) (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/d2scenebuild/pattern_sources.go"},"region":{"startLine":139}}}],"partialFingerprints":{"codehealthFindingId/v1":"7a423c11d1ecb6f26530aa53b9df2162bfc747494e2171edf1f935bda03f2885"}},{"ruleId":"D2","level":"warning","message":{"text":"builder.preflightLegend (cognitive 36): builder.preflightLegend has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (25 pts), boolean chains 9, loops 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/legend.go"},"region":{"startLine":47}}}],"partialFingerprints":{"codehealthFindingId/v1":"e297cd13147a095432ec7f21b83de5ac273fc47ae9b122fc2304223959d44c3d"}},{"ruleId":"D2","level":"warning","message":{"text":"rasterimage.inspectGIF (cognitive 36): rasterimage.inspectGIF has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (33 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/rasterimage/firstframe.go"},"region":{"startLine":232}}}],"partialFingerprints":{"codehealthFindingId/v1":"50eff2e8ab04b57d5fa432c60365550daa6b884a7c601568ad9c060633ae977e"}},{"ruleId":"D2","level":"warning","message":{"text":"boardOutputTransaction.removeStaleDirectories (cognitive 35): boardOutputTransaction.removeStaleDirectories has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (28 pts), boolean chains 4, loops 3 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2cli/board_output_publish.go"},"region":{"startLine":815}}}],"partialFingerprints":{"codehealthFindingId/v1":"2d1ecfc95dd104456e9ae239cf1c2f1e5aa52c1d6a2b234c05d0f4709204d30f"}},{"ruleId":"D2","level":"warning","message":{"text":"compiler.spreadCompositeReferencesNode (cognitive 35): compiler.spreadCompositeReferencesNode has cognitive complexity 35 (threshold 15). Drivers by points: if/else 7 (24 pts), loops 4 (10 pts), boolean chains 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ir/compile.go"},"region":{"startLine":670}}}],"partialFingerprints":{"codehealthFindingId/v1":"c8f6bfaceac98b7bd4c338ce28dac3205373407370e691c6e8d099fb7f193b86"}},{"ruleId":"D2","level":"warning","message":{"text":"Map.createEdge2 (cognitive 35): Map.createEdge2 has cognitive complexity 35 (threshold 15). Drivers by points: if/else 16 (28 pts), loops 3 (7 pts) (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":1846}}}],"partialFingerprints":{"codehealthFindingId/v1":"1f96ec58f884aa3ac855a8a14de1c96a7ab14386dcfe4c15f3eaec05e1ed25fd"}},{"ruleId":"D2","level":"warning","message":{"text":"Map.FindBoardRoot (cognitive 35): Map.FindBoardRoot has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (26 pts), loops 3 (6 pts), 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":2405}}}],"partialFingerprints":{"codehealthFindingId/v1":"0b95ca6cfa3c2587eeeda22bf27421392b7492bbcdad0ec592a5ffc232e8531c"}},{"ruleId":"D2","level":"warning","message":{"text":"grouping.SequenceDefiningEdges (cognitive 35): grouping.SequenceDefiningEdges has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 4 (10 pts), 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":"d2layouts/d2talalayout/internal/grouping/sequences.go"},"region":{"startLine":80}}}],"partialFingerprints":{"codehealthFindingId/v1":"464235ebbd137d230dc560dbc14a7b87986f30e586c556e225775ee4d713f67d"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.stableSortRouteValues (cognitive 35): routing.stableSortRouteValues has cognitive complexity 35 (threshold 15). Drivers by points: if/else 8 (22 pts), loops 5 (12 pts), boolean chains 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/route_stage_guard.go"},"region":{"startLine":554}}}],"partialFingerprints":{"codehealthFindingId/v1":"7908aeca61aa7579ff37d2e0718011097fc6a273507feb72fed4d7357fd7a55a"}},{"ruleId":"D2","level":"warning","message":{"text":"OVG.addLevelNodes (cognitive 35): OVG.addLevelNodes has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (28 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/ovg_hierarchy.go"},"region":{"startLine":351}}}],"partialFingerprints":{"codehealthFindingId/v1":"7bc2cbbda701a30707f6acac5a0ae4379d3b9485e948e219d45c59a1d7ec8f45"}},{"ruleId":"D2","level":"warning","message":{"text":"trees.treePlacementDescendants (cognitive 35): trees.treePlacementDescendants has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (26 pts), loops 4 (8 pts), boolean chains 1 (nesting depth added 16). Most of this is not in the body itself: 12 of the 35 points are its own statements and the rest belongs to one function literal inside it that branches (line 578). 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/d2talalayout/internal/trees/geometry.go"},"region":{"startLine":571}}}],"partialFingerprints":{"codehealthFindingId/v1":"ecdd56c5c95fcc1bfe1b22e2b474fae509645223eb8eed628ab33522760afdc7"}},{"ruleId":"D2","level":"warning","message":{"text":"asciiroute.drawConnectionLabel (cognitive 35): asciiroute.drawConnectionLabel has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 5 (13 pts) (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":"d2raster.normalizeNodeFilters (cognitive 35): d2raster.normalizeNodeFilters has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (27 pts), loops 3 (5 pts), match/switch 1 (2 pts), 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":"d2renderers/d2raster/filter.go"},"region":{"startLine":53}}}],"partialFingerprints":{"codehealthFindingId/v1":"e61690654bcb0abd8ade9c90f1761438367787954ccd2afc019b5ba34db1c334"}},{"ruleId":"D2","level":"warning","message":{"text":"d2raster.maskRenderBounds (cognitive 35): d2raster.maskRenderBounds has cognitive complexity 35 (threshold 15). Drivers by points: if/else 15 (23 pts), boolean chains 9, 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":"d2renderers/d2raster/mask_regions.go"},"region":{"startLine":21}}}],"partialFingerprints":{"codehealthFindingId/v1":"78a447684e83e45738f369e806361978ceedbcbf7b8fb45acc0cd3a595a8b986"}},{"ruleId":"D2","level":"warning","message":{"text":"RenderSession.memoizedCacheKeyWithDigest (cognitive 35): RenderSession.memoizedCacheKeyWithDigest has cognitive complexity 35 (threshold 15). Drivers by points: if/else 15 (34 pts), loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/session.go"},"region":{"startLine":202}}}],"partialFingerprints":{"codehealthFindingId/v1":"0a68c4bbcadadda65a10aee7fe63579299a23c75ce7d79e9fdd28e4bfedc767f"}},{"ruleId":"D2","level":"warning","message":{"text":"builder.splitAnimatedConnectionPath (cognitive 35): builder.splitAnimatedConnectionPath has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (28 pts), boolean chains 3, loops 2, match/switch 1 (2 pts) (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":"d2renderers/d2scenebuild/connection.go"},"region":{"startLine":218}}}],"partialFingerprints":{"codehealthFindingId/v1":"847419147ddabe3aeafc1568efa3e21b01fb56ee86659efe1b52b4170948eee2"}},{"ruleId":"D2","level":"warning","message":{"text":"d2svgimport.splitSVGNumberList (cognitive 35): d2svgimport.splitSVGNumberList has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (30 pts), boolean chains 4, loops 1 (nesting depth added 16). 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, split the body into named stages: move each independent step or branch into 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/d2svgimport/style.go"},"region":{"startLine":744}}}],"partialFingerprints":{"codehealthFindingId/v1":"0e07d27aea892b5f63eafd364ac288da23391c7df31772a0240a2325fc22b7cd"}},{"ruleId":"D2","level":"warning","message":{"text":"pathParser.parse (cognitive 35): pathParser.parse has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (32 pts), boolean chains 2, loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svgimport/path.go"},"region":{"startLine":80}}}],"partialFingerprints":{"codehealthFindingId/v1":"96e5fff543cd620630a35153ec25a6e58eb20a9d3e325296ad0eabf63a86cda8"}},{"ruleId":"D2","level":"warning","message":{"text":"Diagram.appendCorpus (cognitive 35): Diagram.appendCorpus has cognitive complexity 35 (threshold 15). Drivers by points: loops 8 (19 pts), if/else 9 (16 pts) (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":702}}}],"partialFingerprints":{"codehealthFindingId/v1":"24b89e824f6a4eb18f9ce0da5c7f453e6e40ebc1c4e7be0872e2a456014e6c6d"}},{"ruleId":"D2","level":"warning","message":{"text":"rasterimage.inspectWebP (cognitive 35): rasterimage.inspectWebP has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (26 pts), boolean chains 6, match/switch 1 (2 pts), 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":"internal/rasterimage/firstframe.go"},"region":{"startLine":752}}}],"partialFingerprints":{"codehealthFindingId/v1":"c20bb2069b7affdbdc198c0fc8f817c13f58588fe6be7df87111cb50e24ef622"}},{"ruleId":"D2","level":"warning","message":{"text":"testutil.orderPDFImagesByPage (cognitive 35): testutil.orderPDFImagesByPage has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (27 pts), loops 5 (7 pts), 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":"internal/testutil/pdf.go"},"region":{"startLine":149}}}],"partialFingerprints":{"codehealthFindingId/v1":"966f4d6b11bdca4705b5bd00d77236cd5bdd4068422a761f2de15baba57adced"}},{"ruleId":"D2","level":"warning","message":{"text":"png.exifChunkLocation (cognitive 35): png.exifChunkLocation has cognitive complexity 35 (threshold 15). Drivers by points: if/else 16 (33 pts), 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/png/png.go"},"region":{"startLine":135}}}],"partialFingerprints":{"codehealthFindingId/v1":"25b06e74b0d71024d3f0d156cdfb55096d7701d12c1ed67d8f194742a7b81553"}},{"ruleId":"D2","level":"warning","message":{"text":"d2cli.loadFonts (cognitive 34): d2cli.loadFonts has cognitive complexity 34 (threshold 15). Drivers by points: if/else 21 (31 pts), 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":1103}}}],"partialFingerprints":{"codehealthFindingId/v1":"e41a8afcc898412733ea79013e31a6c4799ac551f1049a919a86a999a0326ba6"}},{"ruleId":"D2","level":"warning","message":{"text":"compiler.applyLazyGlobs (cognitive 34): compiler.applyLazyGlobs has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 5 (10 pts) (nesting depth added 18). Of this number, 33 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into 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":1254}}}],"partialFingerprints":{"codehealthFindingId/v1":"1ff2c034a12915b925766c443fc40cb9cee9def7d9e391d65b1f35572e184906"}},{"ruleId":"D2","level":"warning","message":{"text":"gridDiagram.getBestLayout (cognitive 34): gridDiagram.getBestLayout has cognitive complexity 34 (threshold 15). Drivers by points: if/else 21 (27 pts), boolean chains 4, loops 3 (nesting depth added 6). Of this number, 18 points are the body\u0027s own statements and 16 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":563}}}],"partialFingerprints":{"codehealthFindingId/v1":"12887060e918d1428f99dd9ee75c2047bcaca9a499b9aa336ca814ef1b61cb41"}},{"ruleId":"D2","level":"warning","message":{"text":"grouping.identifySequences (cognitive 34): grouping.identifySequences has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (26 pts), loops 4 (5 pts), 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":"d2layouts/d2talalayout/internal/grouping/sequences.go"},"region":{"startLine":18}}}],"partialFingerprints":{"codehealthFindingId/v1":"c619b6c8b94ba6e7a7de474532f16f2103d001294c4df03f746c5319c2bf92e7"}},{"ruleId":"D2","level":"warning","message":{"text":"hierarchy.alignHierarchy (cognitive 34): hierarchy.alignHierarchy has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (26 pts), loops 6 (8 pts) (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/d2talalayout/internal/hierarchy/brandes_kopf.go"},"region":{"startLine":42}}}],"partialFingerprints":{"codehealthFindingId/v1":"102d5da74ab9278815fc491a88ab5726763b8b4a90710d1066091906bf3b0bd2"}},{"ruleId":"D2","level":"warning","message":{"text":"OVG.addPortAlignedNodes (cognitive 34): OVG.addPortAlignedNodes has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (23 pts), loops 5 (11 pts) (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/d2talalayout/internal/routing/ovg_hierarchy.go"},"region":{"startLine":302}}}],"partialFingerprints":{"codehealthFindingId/v1":"c5f898bce278c6c594fb11410394e3978e7260416b82ca678f4144f6c6ce7649"}},{"ruleId":"D2","level":"warning","message":{"text":"Raster.drawOpacityGroup (cognitive 34): Raster.drawOpacityGroup has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 5 (12 pts), boolean chains 3 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/opacity_groups.go"},"region":{"startLine":146}}}],"partialFingerprints":{"codehealthFindingId/v1":"9536471f58cf5be86dd64907c582d30478cb5332f83e1b82e0572d40d765c848"}},{"ruleId":"D2","level":"warning","message":{"text":"d2raster.renderBands (cognitive 34): d2raster.renderBands has cognitive complexity 34 (threshold 15). Drivers by points: if/else 18 (28 pts), boolean chains 4, 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":"d2renderers/d2raster/bands.go"},"region":{"startLine":38}}}],"partialFingerprints":{"codehealthFindingId/v1":"c752eb65ecf1504b78d7f2c893b6b1af6e9a7479b8ded558653e8eed536af9b5"}},{"ruleId":"D2","level":"warning","message":{"text":"d2raster.strokeRegionBounds (cognitive 34): d2raster.strokeRegionBounds has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (25 pts), boolean chains 6, loops 2 (3 pts) (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":"d2renderers/d2raster/stroke_regions.go"},"region":{"startLine":54}}}],"partialFingerprints":{"codehealthFindingId/v1":"f90e5a655cfe5d7baa07043a8a5fad2e43bfa96b9f8b8d485de0bd2394681846"}},{"ruleId":"D2","level":"warning","message":{"text":"builder.buildMarkdownPrimitive (cognitive 34): builder.buildMarkdownPrimitive has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (28 pts), boolean chains 5, match/switch 1 (nesting depth added 16). 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":"d2renderers/d2scenebuild/markdown.go"},"region":{"startLine":239}}}],"partialFingerprints":{"codehealthFindingId/v1":"79b03e69241d9393fce5d10f243490250d712758897bb74fc02a7d61b8414a7e"}},{"ruleId":"D2","level":"warning","message":{"text":"Diagram.GetBoard (cognitive 34): Diagram.GetBoard has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 6 (9 pts), 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":109}}}],"partialFingerprints":{"codehealthFindingId/v1":"e4e33d58581b7910da9f4f9191595482ddebabbdaea94d85aead98ce8d692c31"}},{"ruleId":"D2","level":"warning","message":{"text":"testutil.InspectD2PDF (cognitive 34): testutil.InspectD2PDF has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (25 pts), loops 5 (8 pts), 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":"internal/testutil/pdf.go"},"region":{"startLine":66}}}],"partialFingerprints":{"codehealthFindingId/v1":"41bcc17b7ae0599a6ed3a284f7366034df02d4f39009d9797eb761b439b52ef3"}},{"ruleId":"D2","level":"warning","message":{"text":"imageasset.parseContentEncodings (cognitive 34): imageasset.parseContentEncodings has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (27 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/imageasset/resolve.go"},"region":{"startLine":802}}}],"partialFingerprints":{"codehealthFindingId/v1":"2078fe88aed052a5a4355829e20877c57724ddc41a144dd40ed1fa9e9e1b9197"}},{"ruleId":"D2","level":"warning","message":{"text":"Resolver.loadData (cognitive 34): Resolver.loadData has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (28 pts), boolean chains 3, loops 2 (3 pts) (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/imageasset/resolve.go"},"region":{"startLine":507}}}],"partialFingerprints":{"codehealthFindingId/v1":"9e2571cbd282d85494a25f3b8307e04f4244c58da5730ddaf311315ab4bac075"}},{"ruleId":"D2","level":"warning","message":{"text":"compiler.__import (cognitive 33): compiler.__import has cognitive complexity 33 (threshold 15). Drivers by points: if/else 16 (30 pts), 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":"d2ir/import.go"},"region":{"startLine":86}}}],"partialFingerprints":{"codehealthFindingId/v1":"55b56baccd1ab47eb7c04f2fe6a76f87cc0663bd767453d738a4df10b11af7fa"}},{"ruleId":"D2","level":"warning","message":{"text":"Transaction.hasBadPostStateOverlap (cognitive 33): Transaction.hasBadPostStateOverlap has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (24 pts), boolean chains 6, loops 2 (3 pts) (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":"d2layouts/d2talalayout/internal/layoutgraph/transaction.go"},"region":{"startLine":1103}}}],"partialFingerprints":{"codehealthFindingId/v1":"19b0d71bf36122e28cb26fafb55556e803fe155262d279d8377cfa93df48319a"}},{"ruleId":"D2","level":"warning","message":{"text":"sizelessOptimizer.optimizeGuarded (cognitive 33): sizelessOptimizer.optimizeGuarded has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (30 pts), loops 2, 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":"d2layouts/d2talalayout/internal/placement/sizeless_optimizer.go"},"region":{"startLine":161}}}],"partialFingerprints":{"codehealthFindingId/v1":"ea45a4159017669600b58d4b00f15c42bdf049491c97bbb7d4c1839f94cc9173"}},{"ruleId":"D2","level":"warning","message":{"text":"sizelessOptimizer.findClosestUnoccupiedDistanceGuarded (cognitive 33): sizelessOptimizer.findClosestUnoccupiedDistanceGuarded has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (24 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 14). Of this number, 31 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/sizeless_optimizer.go"},"region":{"startLine":280}}}],"partialFingerprints":{"codehealthFindingId/v1":"2294b322b1a1e99d68233fb70c81904b5f3e66d28b3c16eb2fd4da2fb2452ce7"}},{"ruleId":"D2","level":"warning","message":{"text":"sizelessOptimizer.placementPointsGuarded (cognitive 33): sizelessOptimizer.placementPointsGuarded has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (22 pts), boolean chains 8, loops 2 (3 pts) (nesting depth added 12). Of this number, 31 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/sizeless_optimizer.go"},"region":{"startLine":350}}}],"partialFingerprints":{"codehealthFindingId/v1":"4572a240d5efe4f6db5c2443bd72de0e800f9f57449ae17bae28254ff92cfcf6"}},{"ruleId":"D2","level":"warning","message":{"text":"placementcost.isMirrored (cognitive 33): placementcost.isMirrored has cognitive complexity 33 (threshold 15). Drivers by points: if/else 15 (29 pts), boolean chains 4 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placementcost/symmetry.go"},"region":{"startLine":625}}}],"partialFingerprints":{"codehealthFindingId/v1":"3f4ef69215c3a6e5fe84624b5343659e5d1e1dd9ad5e7d0a8fbfaa96e4eda810"}},{"ruleId":"D2","level":"warning","message":{"text":"proximity.CommonUncleSiblings (cognitive 33): proximity.CommonUncleSiblings has cognitive complexity 33 (threshold 15). Drivers by points: if/else 5 (21 pts), loops 5 (11 pts), boolean chains 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/proximity/common_uncle.go"},"region":{"startLine":11}}}],"partialFingerprints":{"codehealthFindingId/v1":"1f1f1b1b3c1d04816fff7164e054e07dc17ed10930a78ef1f66d564228ade443"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.crosshatchWithWorkLimit (cognitive 33): routing.crosshatchWithWorkLimit has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (24 pts), loops 5 (9 pts) (nesting depth added 18). None of this is in the body itself: all 33 points belong to one function literal inside it that branches (line 1827). 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/d2talalayout/internal/routing/coordinator.go"},"region":{"startLine":1826}}}],"partialFingerprints":{"codehealthFindingId/v1":"6a3a8856af2bc326d2e5df7c9776db3367340c0113f730354c34ad28d3b695ca"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.sortEdges (cognitive 33): routing.sortEdges has cognitive complexity 33 (threshold 15). Drivers by points: match/switch 8 (17 pts), if/else 9 (14 pts), boolean chains 2 (nesting depth added 14). Most of this is not in the body itself: 1 of the 33 points is its own statement and the rest belongs to 4 function literals inside it that branch (lines 219, 277, 193, \u2026). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals\u0027 work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/ovg_edge_router.go"},"region":{"startLine":190}}}],"partialFingerprints":{"codehealthFindingId/v1":"c69f4543f97a7f557125a4cdb8559074dda418f339a36c2b823f1e3d80e94af7"}},{"ruleId":"D2","level":"warning","message":{"text":"trees.placeTrees (cognitive 33): trees.placeTrees has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (25 pts), loops 6 (8 pts) (nesting depth added 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, split the body into named stages: move each independent step or branch into 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/d2talalayout/internal/trees/layout.go"},"region":{"startLine":906}}}],"partialFingerprints":{"codehealthFindingId/v1":"76a00d0a8dc71ba4bffe3de9d96d5961a188a839bfb2f04325230f6591cbd2eb"}},{"ruleId":"D2","level":"warning","message":{"text":"d2isometricimg.svgOrderComponents (cognitive 33): d2isometricimg.svgOrderComponents has cognitive complexity 33 (threshold 15). Drivers by points: if/else 7 (20 pts), loops 8 (13 pts) (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/d2isometric/d2isometricimg/svg_order.go"},"region":{"startLine":394}}}],"partialFingerprints":{"codehealthFindingId/v1":"268ec775e87156cc4e84d73a2a6589672749bc999b402b12d61c5d69d3b80666"}},{"ruleId":"D2","level":"warning","message":{"text":"richLabelPainter.texture (cognitive 33): richLabelPainter.texture has cognitive complexity 33 (threshold 15). Drivers by points: if/else 19 (25 pts), loops 2 (5 pts), boolean chains 3 (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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/rich_labels.go"},"region":{"startLine":78}}}],"partialFingerprints":{"codehealthFindingId/v1":"678df566c33b3a326cae04d315ee98b5b90a6c6a167a46a59a664cba3b4b0869"}},{"ruleId":"D2","level":"warning","message":{"text":"builder.buildConnectionMask (cognitive 33): builder.buildConnectionMask has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (27 pts), boolean chains 4, loops 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/labels.go"},"region":{"startLine":17}}}],"partialFingerprints":{"codehealthFindingId/v1":"265a5811593ed3ee7236a6fb2888d22792d78f40f52a7056e04e1f737c5e8d1e"}},{"ruleId":"D2","level":"warning","message":{"text":"testutil.parsePDFLiteralString (cognitive 33): testutil.parsePDFLiteralString has cognitive complexity 33 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 2 (6 pts), match/switch 2 (5 pts), boolean chains 4 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/testutil/pdf.go"},"region":{"startLine":545}}}],"partialFingerprints":{"codehealthFindingId/v1":"9fff522303d93218b55f0814b0c744d53c42021f89a9eeac4ff34bb1cbab72d0"}},{"ruleId":"D2","level":"warning","message":{"text":"d2cli.renderPPTXWithRenderer (cognitive 32): d2cli.renderPPTXWithRenderer has cognitive complexity 32 (threshold 15). Drivers by points: if/else 15 (27 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 13). Most of this is not in the body itself: 6 of the 32 points are its own statements and the rest belongs to one function literal inside it that branches (line 523). 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":"d2cli/paged.go"},"region":{"startLine":509}}}],"partialFingerprints":{"codehealthFindingId/v1":"97b7cf5273888b0263db636afc2e9c3027c909a9e96b6e16f90994f71d9f8081"}},{"ruleId":"D2","level":"warning","message":{"text":"d2format.escapeUnquotedValue (cognitive 32): d2format.escapeUnquotedValue has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (24 pts), match/switch 2 (6 pts), 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 13 (27 pts), loops 1 (3 pts), 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":1454}}}],"partialFingerprints":{"codehealthFindingId/v1":"b3045608a1a644d200a2afda5234cb3cb071f361814c10315202bafd67fc88d3"}},{"ruleId":"D2","level":"warning","message":{"text":"d2near.boundingBox (cognitive 32): d2near.boundingBox has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 3 (5 pts), boolean chains 4, match/switch 1 (3 pts) (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":"Node.overlapsAlongDimension (cognitive 32): Node.overlapsAlongDimension has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (32 pts) (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":"d2layouts/d2talalayout/internal/layoutgraph/node.go"},"region":{"startLine":1309}}}],"partialFingerprints":{"codehealthFindingId/v1":"a8c5c6bc8ac5385f8fcba6ff016bd2884d3f1142e40027753412abe5eb591a20"}},{"ruleId":"D2","level":"warning","message":{"text":"proximity.ApplyVirally (cognitive 32): proximity.ApplyVirally has cognitive complexity 32 (threshold 15). Drivers by points: if/else 7 (20 pts), loops 4 (10 pts), 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":"d2layouts/d2talalayout/internal/proximity/herding.go"},"region":{"startLine":188}}}],"partialFingerprints":{"codehealthFindingId/v1":"0836dcc8bc3a02ce1d4f678e168c039f0a50f28e8e5f38d450487c1e90d73a58"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.routeSegmentBounds (cognitive 32): routing.routeSegmentBounds has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (30 pts), boolean chains 1, loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/balance_route_guard.go"},"region":{"startLine":91}}}],"partialFingerprints":{"codehealthFindingId/v1":"5bbac7a311a245573235f615fca0ef917c57d092a280811a28347db9a40cc259"}},{"ruleId":"D2","level":"warning","message":{"text":"Route.isEntireColinear (cognitive 32): Route.isEntireColinear has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (24 pts), boolean chains 4, loops 2 (4 pts) (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":"d2layouts/d2talalayout/internal/routing/route.go"},"region":{"startLine":34}}}],"partialFingerprints":{"codehealthFindingId/v1":"24b08a9b06f45f43831cd07e565a58b81dd24bf606ce9038b73874436ac96c53"}},{"ruleId":"D2","level":"warning","message":{"text":"asciishapes.DrawStoredData (cognitive 32): asciishapes.DrawStoredData has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 6, loops 2 (3 pts), match/switch 1 (3 pts) (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":"d2isometricimg.hierarchyTerraces (cognitive 32): d2isometricimg.hierarchyTerraces has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 6, loops 4 (6 pts) (nesting depth added 12). Of this number, 18 points are the body\u0027s own statements and 14 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":"d2renderers/d2isometric/d2isometricimg/hierarchy_boards.go"},"region":{"startLine":164}}}],"partialFingerprints":{"codehealthFindingId/v1":"d242ef892c49808e24e6ee756e8a946b3cfc145c86422e752077b15fe10b50f0"}},{"ruleId":"D2","level":"warning","message":{"text":"routeCaptionPlacer.score (cognitive 32): routeCaptionPlacer.score has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (21 pts), loops 5 (9 pts), boolean chains 2 (nesting depth added 14). Of this number, 22 points are the body\u0027s own statements and 10 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into 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/d2isometric/d2isometricimg/route_labels.go"},"region":{"startLine":265}}}],"partialFingerprints":{"codehealthFindingId/v1":"f3d3dcddab6faf2c772a8fa7bc2efbb72e36b78c39c747e7ab2e4e359e664350"}},{"ruleId":"D2","level":"warning","message":{"text":"nativeSurfaceSVGWriter.node (cognitive 32): nativeSurfaceSVGWriter.node has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (21 pts), match/switch 2 (6 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/vector_surface_svg.go"},"region":{"startLine":154}}}],"partialFingerprints":{"codehealthFindingId/v1":"d041b07bcdda9f60344a6ba8074b8a5fea31841f92d5a93396525539b4b7f302"}},{"ruleId":"D2","level":"warning","message":{"text":"builder.buildCodeTextRuns (cognitive 32): builder.buildCodeTextRuns has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (28 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/code_shape.go"},"region":{"startLine":115}}}],"partialFingerprints":{"codehealthFindingId/v1":"54da115e2a30042e75ae0caadfbb06f26639b67047387a96184a7fe95dd0c61c"}},{"ruleId":"D2","level":"warning","message":{"text":"builder.buildMarkdownLabel (cognitive 32): builder.buildMarkdownLabel has cognitive complexity 32 (threshold 15). Drivers by points: if/else 18 (28 pts), boolean chains 3, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/markdown.go"},"region":{"startLine":101}}}],"partialFingerprints":{"codehealthFindingId/v1":"b4b51347d364cf73761608a85101acdbdeb8eb253351cfcd018fd542203e614d"}},{"ruleId":"D2","level":"warning","message":{"text":"transformParser.parse (cognitive 32): transformParser.parse has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (27 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svgimport/transform.go"},"region":{"startLine":49}}}],"partialFingerprints":{"codehealthFindingId/v1":"8f35dd5d6fb990d10cbd393a790d95e7f37557be8cdea0d9cfba169d3348d231"}},{"ruleId":"D2","level":"warning","message":{"text":"rasterimage.extractWebPFrame (cognitive 32): rasterimage.extractWebPFrame has cognitive complexity 32 (threshold 15). Drivers by points: if/else 15 (25 pts), boolean chains 4, match/switch 1 (2 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/rasterimage/firstframe.go"},"region":{"startLine":840}}}],"partialFingerprints":{"codehealthFindingId/v1":"603e4648486b71f2679f63b60d907c87e60feb756cf8680d47432e16b2afbf1b"}},{"ruleId":"D2","level":"warning","message":{"text":"d2ast.RawString (cognitive 31): d2ast.RawString has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (23 pts), boolean chains 3, match/switch 1 (3 pts), loops 1 (2 pts) (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":"compiler.compileClass (cognitive 31): compiler.compileClass has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 3 (4 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2compiler/compile.go"},"region":{"startLine":1385}}}],"partialFingerprints":{"codehealthFindingId/v1":"faebd0d9ef713fd24cc2091a08f3c4e9fef87dd6d8f8a2bec483d90e7664825a"}},{"ruleId":"D2","level":"warning","message":{"text":"compiler.validatePositionsCompatibility (cognitive 31): compiler.validatePositionsCompatibility has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (27 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2compiler/compile.go"},"region":{"startLine":1664}}}],"partialFingerprints":{"codehealthFindingId/v1":"d87c6d81f23914ac28a883603aa4d47b4104359350ff30517446a52765383d72"}},{"ruleId":"D2","level":"warning","message":{"text":"Object.ShiftDescendants (cognitive 31): Object.ShiftDescendants has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (20 pts), loops 4 (8 pts), 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":"hierarchy.leafNodesContext (cognitive 31): hierarchy.leafNodesContext has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (24 pts), loops 4 (7 pts) (nesting depth added 18). Of this number, 23 points are the body\u0027s own statements and 8 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/hierarchy/brandes_kopf.go"},"region":{"startLine":289}}}],"partialFingerprints":{"codehealthFindingId/v1":"e1511d87e7c54c1beac5016027daabad478c5eddf1433b4825895715dde146b6"}},{"ruleId":"D2","level":"warning","message":{"text":"hierarchy.orderCompoundInterfaces (cognitive 31): hierarchy.orderCompoundInterfaces has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 5 (8 pts), boolean chains 2 (nesting depth added 15). Of this number, 26 points are the body\u0027s own statements and 5 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/hierarchy/compound.go"},"region":{"startLine":240}}}],"partialFingerprints":{"codehealthFindingId/v1":"f22300e0af5e8a50478e79e4f4107a26224d2fec6bcfe50224ff731c98207822"}},{"ruleId":"D2","level":"warning","message":{"text":"GraphState.captureRuntimeStateContext (cognitive 31): GraphState.captureRuntimeStateContext has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (21 pts), loops 9 (10 pts) (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":"d2layouts/d2talalayout/internal/layoutgraph/transaction_snapshot.go"},"region":{"startLine":707}}}],"partialFingerprints":{"codehealthFindingId/v1":"e3f223c7b6aa74c1b4b3673aebb315adca907825452b12299188149435258ee2"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.edgeSegmentsGuarded (cognitive 31): routing.edgeSegmentsGuarded has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (27 pts), loops 2 (3 pts), 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":"d2layouts/d2talalayout/internal/routing/balance_route_guard.go"},"region":{"startLine":54}}}],"partialFingerprints":{"codehealthFindingId/v1":"36be0818ebaf343f6cec2eb7c9f7cdc278dc9ca8d927ec35b7da4242a3c29b2a"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.collectRouteFlavorResponses (cognitive 31): routing.collectRouteFlavorResponses has cognitive complexity 31 (threshold 15). Drivers by points: if/else 6 (20 pts), loops 3 (9 pts), match/switch 1 (2 pts) (nesting depth added 21). Of this number, 30 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/coordinator.go"},"region":{"startLine":114}}}],"partialFingerprints":{"codehealthFindingId/v1":"ed91f0bc3dab13ab2767182beaa1432fb9da1641122f00dedf2980511f4f098b"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.shortcutWallClearance (cognitive 31): routing.shortcutWallClearance has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (24 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/shortcut_routes.go"},"region":{"startLine":419}}}],"partialFingerprints":{"codehealthFindingId/v1":"ed3c8703395e543d1c3beb402d1a869f83b0ac23c43c3d99158d9ddf6616003d"}},{"ruleId":"D2","level":"warning","message":{"text":"OVG.perimeterPoints (cognitive 31): OVG.perimeterPoints has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 5 (9 pts) (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/d2talalayout/internal/routing/ovg.go"},"region":{"startLine":499}}}],"partialFingerprints":{"codehealthFindingId/v1":"b7d537c65cd1a8a0c8bc619836b71dffe1e9ec244b4698db42476dba0ab92dd9"}},{"ruleId":"D2","level":"warning","message":{"text":"OVG.connectNodes (cognitive 31): OVG.connectNodes has cognitive complexity 31 (threshold 15). Drivers by points: if/else 17 (27 pts), loops 4 (nesting depth added 10). Of this number, 27 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":"d2layouts/d2talalayout/internal/routing/ovg.go"},"region":{"startLine":1115}}}],"partialFingerprints":{"codehealthFindingId/v1":"df5d7134bd2fe7573cda48e06faf9dbadc508bb7024ead08d09f10577c3406d9"}},{"ruleId":"D2","level":"warning","message":{"text":"parser.parseKey (cognitive 31): parser.parseKey has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (25 pts), boolean chains 3, loops 2 (3 pts) (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":1035}}}],"partialFingerprints":{"codehealthFindingId/v1":"3324cdf0d7ead68e3cba6fe1a29e5a356db632758042605dac3d285dcd8486ee"}},{"ruleId":"D2","level":"warning","message":{"text":"d2isometricimg.preflightPageMetadata (cognitive 31): d2isometricimg.preflightPageMetadata has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 6, loops 3 (nesting depth added 8). Most of this is not in the body itself: 14 of the 31 points are its own statements and the rest belongs to one function literal inside it that branches (line 71). 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":"d2renderers/d2isometric/d2isometricimg/page.go"},"region":{"startLine":66}}}],"partialFingerprints":{"codehealthFindingId/v1":"90680e21c3694faff959aa9a664844b55a9d25e6ec0318bad4781b70edffe850"}},{"ruleId":"D2","level":"warning","message":{"text":"d2raster.compositeBlendLayer (cognitive 31): d2raster.compositeBlendLayer has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (24 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/effects.go"},"region":{"startLine":1461}}}],"partialFingerprints":{"codehealthFindingId/v1":"0f5f71eea9109cd7674fc8dd9ddb2a90c6c7a2291c02a3d768353ab17ff0b09b"}},{"ruleId":"D2","level":"warning","message":{"text":"d2raster.drawDirectPatternCoverage (cognitive 31): d2raster.drawDirectPatternCoverage has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (27 pts), boolean chains 3, loops 1 (nesting depth added 14). Most of this is not in the body itself: 2 of the 31 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 738, 728). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals\u0027 work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/gradient.go"},"region":{"startLine":723}}}],"partialFingerprints":{"codehealthFindingId/v1":"1ffc4cd30c73637d374bd97db136f6c53f63eb7418c4a17dc61086f6c93d3b14"}},{"ruleId":"D2","level":"warning","message":{"text":"d2raster.drawPrimitive (cognitive 31): d2raster.drawPrimitive has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (25 pts), loops 2 (6 pts) (nesting depth added 15). Of this number, 25 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":"d2renderers/d2raster/raster.go"},"region":{"startLine":1559}}}],"partialFingerprints":{"codehealthFindingId/v1":"102f88079efd382935e3d1fc8585c45caf2362f95d7e8f9b73159106d9ee69dc"}},{"ruleId":"D2","level":"warning","message":{"text":"d2svg.RenderLegend (cognitive 31): d2svg.RenderLegend has cognitive complexity 31 (threshold 15). Drivers by points: if/else 15 (22 pts), loops 5, 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":"d2renderers/d2svg/d2svg.go"},"region":{"startLine":259}}}],"partialFingerprints":{"codehealthFindingId/v1":"560867fd00e147fc38ecf8617cc6429a0fb0c24cffa18f8fbfe780cde28c47ad"}},{"ruleId":"D2","level":"warning","message":{"text":"svgImporter.validateGradientTree (cognitive 31): svgImporter.validateGradientTree has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (21 pts), loops 3 (6 pts), boolean chains 2, match/switch 1 (2 pts) (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/d2svgimport/gradient.go"},"region":{"startLine":26}}}],"partialFingerprints":{"codehealthFindingId/v1":"cff5f68b155f11ba465ff429cd0d91f4b79dcef2c7151cce7e285536ff9ce919"}},{"ruleId":"D2","level":"warning","message":{"text":"Resolver.classifySource (cognitive 31): Resolver.classifySource has cognitive complexity 31 (threshold 15). Drivers by points: if/else 18 (28 pts), 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":"lib/imageasset/resolve.go"},"region":{"startLine":183}}}],"partialFingerprints":{"codehealthFindingId/v1":"ae2dbc6a4b936e02a3f1fb326632172a8c5e50fa20d6cbe6bb2095606fdabf7d"}},{"ruleId":"D2","level":"warning","message":{"text":"d2cli.publishBoardOutputWorkspace (cognitive 30): d2cli.publishBoardOutputWorkspace has cognitive complexity 30 (threshold 15). Drivers by points: if/else 21 (30 pts) (nesting depth added 9). Of this number, 29 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into 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/board_output_publish.go"},"region":{"startLine":38}}}],"partialFingerprints":{"codehealthFindingId/v1":"621034df388cd6b307b1f152c1cf31f7f7f785d694cfdc65f795b46fc74d8691"}},{"ruleId":"D2","level":"warning","message":{"text":"d2exporter.toPrettyLink (cognitive 30): d2exporter.toPrettyLink has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 3 (6 pts), match/switch 1 (4 pts), 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 16 (25 pts), boolean chains 3, loops 1 (2 pts) (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":"d2ir.walkComposite (cognitive 30): d2ir.walkComposite has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 4 (10 pts), boolean chains 2, match/switch 1 (2 pts) (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":"d2ir/compile.go"},"region":{"startLine":753}}}],"partialFingerprints":{"codehealthFindingId/v1":"0cbb44f83ef0519d4b6a636c1ae09fdf9b968496b5c185f41de6d70410b77a22"}},{"ruleId":"D2","level":"warning","message":{"text":"sequenceDiagram.placeGroup (cognitive 30): sequenceDiagram.placeGroup has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 7 (13 pts) (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":246}}}],"partialFingerprints":{"codehealthFindingId/v1":"b9def1c4b9bb86ffbb3261dff0f4b044a4888f607eb18283aaa0e02e36efc3d0"}},{"ruleId":"D2","level":"warning","message":{"text":"grouping.isValidRememberedSequence (cognitive 30): grouping.isValidRememberedSequence has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (23 pts), boolean chains 5, 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":"d2layouts/d2talalayout/internal/grouping/sequences.go"},"region":{"startLine":128}}}],"partialFingerprints":{"codehealthFindingId/v1":"0410388cfcce31200899aee46c0bfb8eea281d48cef434c23db486b4c601c17a"}},{"ruleId":"D2","level":"warning","message":{"text":"rankProblem.longestPathLevels (cognitive 30): rankProblem.longestPathLevels has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (25 pts), loops 4 (5 pts) (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":"d2layouts/d2talalayout/internal/hierarchy/rank_graph.go"},"region":{"startLine":208}}}],"partialFingerprints":{"codehealthFindingId/v1":"268095c5c9abd98a746c9e0e4e9ca23dfc4b214d314011118abc3a880ca62cbc"}},{"ruleId":"D2","level":"warning","message":{"text":"placement.optimizerDoesOverlap (cognitive 30): placement.optimizerDoesOverlap has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (22 pts), boolean chains 5, loops 2 (3 pts) (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":"d2layouts/d2talalayout/internal/placement/optimization_guard.go"},"region":{"startLine":439}}}],"partialFingerprints":{"codehealthFindingId/v1":"a25a8403f71ca93967089c3b0adb3de36a0eec4fe715c39573b37a4b3d8da8b0"}},{"ruleId":"D2","level":"warning","message":{"text":"optimizerSpatialIndex.rebuild (cognitive 30): optimizerSpatialIndex.rebuild has cognitive complexity 30 (threshold 15). Drivers by points: if/else 16 (23 pts), boolean chains 4, match/switch 1 (2 pts), loops 1 (nesting depth added 8). Of this number, 27 points are the body\u0027s own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/optimizer_spatial_index.go"},"region":{"startLine":103}}}],"partialFingerprints":{"codehealthFindingId/v1":"a3b7a02a4e0d59ff064b997127524d03c5a426ab5e3fdfb1ca117258dba18fed"}},{"ruleId":"D2","level":"warning","message":{"text":"trees.candidateTreeRoots (cognitive 30): trees.candidateTreeRoots has cognitive complexity 30 (threshold 15). Drivers by points: if/else 15 (24 pts), boolean chains 4, loops 2 (nesting depth added 9). Of this number, 27 points are the body\u0027s own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/trees/preprocess_helpers.go"},"region":{"startLine":220}}}],"partialFingerprints":{"codehealthFindingId/v1":"9591e8d5efa48ccdcf2b541fe17a7d015b56373b1f141d0154245ea1a951c78e"}},{"ruleId":"D2","level":"warning","message":{"text":"d2oracle.filterReserved (cognitive 30): d2oracle.filterReserved has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (26 pts), boolean chains 2, loops 1 (2 pts) (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":2264}}}],"partialFingerprints":{"codehealthFindingId/v1":"bb1c400c17c4ad981961ae4ca251c95c074adbfc2c83425eaae0d57b276509ad"}},{"ruleId":"D2","level":"warning","message":{"text":"d2isometricimg.svgPolygonPath (cognitive 30): d2isometricimg.svgPolygonPath has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 4 (7 pts), boolean chains 4 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/svg.go"},"region":{"startLine":119}}}],"partialFingerprints":{"codehealthFindingId/v1":"e9f95254212324eff9305699913647b79b21290bad1b9a6e5ad63a2c190c453c"}},{"ruleId":"D2","level":"warning","message":{"text":"meshBuilder.arrowOwnerCaps (cognitive 30): meshBuilder.arrowOwnerCaps has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (20 pts), loops 4 (7 pts), boolean chains 3 (nesting depth added 10). Of this number, 21 points are the body\u0027s own statements and 9 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/arrow_visibility.go"},"region":{"startLine":94}}}],"partialFingerprints":{"codehealthFindingId/v1":"3139a899fa1fb76f19b01313fd00bc20cccc590c1514172b130baa5bfd4cc540"}},{"ruleId":"D2","level":"warning","message":{"text":"meshBuilder.solidContentSupport (cognitive 30): meshBuilder.solidContentSupport has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 6 (12 pts), boolean chains 6 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/native_solids.go"},"region":{"startLine":203}}}],"partialFingerprints":{"codehealthFindingId/v1":"2bc9853a50b039795d997898feeb528dccbaea705dd2beb948c7f25768e30486"}},{"ruleId":"D2","level":"warning","message":{"text":"d2raster.drawAxisLinearGradientMaskPixels (cognitive 30): d2raster.drawAxisLinearGradientMaskPixels has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (26 pts), loops 2 (3 pts), match/switch 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/gradient.go"},"region":{"startLine":1123}}}],"partialFingerprints":{"codehealthFindingId/v1":"1306dd0fc5689158d6f1a8c2c304e52ff00ebb750b406915680be440bfab4255"}},{"ruleId":"D2","level":"warning","message":{"text":"svgImporter.resolveEmbeddedRaster (cognitive 30): svgImporter.resolveEmbeddedRaster has cognitive complexity 30 (threshold 15). Drivers by points: if/else 23 (29 pts), 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":"d2renderers/d2svgimport/image.go"},"region":{"startLine":72}}}],"partialFingerprints":{"codehealthFindingId/v1":"125842e18844f1b654533c134d2c0465df9027c6950ebeffb880e79d9e242ac7"}},{"ruleId":"D2","level":"warning","message":{"text":"rasterimage.jpegEXIFOrientation (cognitive 30): rasterimage.jpegEXIFOrientation has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 6, loops 2 (3 pts), match/switch 1 (2 pts) (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":"internal/rasterimage/jpeg_orientation.go"},"region":{"startLine":23}}}],"partialFingerprints":{"codehealthFindingId/v1":"d68b2216629ac98fa92cc1f69148465a6d73e5d497f37b9393c6553ef329e388"}},{"ruleId":"D2","level":"warning","message":{"text":"Segment.GetBounds (cognitive 30): Segment.GetBounds has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (28 pts), 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":"markdownPainter.markdownMinContentWidth (cognitive 30): markdownPainter.markdownMinContentWidth has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (21 pts), loops 3 (5 pts), boolean chains 4 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/textmeasure/markdown_svg.go"},"region":{"startLine":1592}}}],"partialFingerprints":{"codehealthFindingId/v1":"c95b200e6382068a3fc8416b9d43fc6c3ccfa8d81a818b835bb335a00169890f"}},{"ruleId":"D2","level":"warning","message":{"text":"main.main (cognitive 29): main.main has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (21 pts), boolean chains 4, loops 3 (4 pts) (nesting depth added 8). Of this number, 28 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"ci/tala-performance/main.go"},"region":{"startLine":197}}}],"partialFingerprints":{"codehealthFindingId/v1":"45a9d8f5108837b01c5872d212286ee10f3858b6d792f243c931449f7c257213"}},{"ruleId":"D2","level":"warning","message":{"text":"d2cli._renderWithPNGEncoder (cognitive 29): d2cli._renderWithPNGEncoder has cognitive complexity 29 (threshold 15). Drivers by points: if/else 17 (25 pts), boolean chains 2, match/switch 1 (2 pts) (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":"d2cli/main.go"},"region":{"startLine":965}}}],"partialFingerprints":{"codehealthFindingId/v1":"b7bd0b94710b961675dffa678e434eb941692058232306ca97b7675dcc8c2897"}},{"ruleId":"D2","level":"warning","message":{"text":"d2cli.renderPDFWithRenderer (cognitive 29): d2cli.renderPDFWithRenderer has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (24 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 11). Most of this is not in the body itself: 7 of the 29 points are its own statements and the rest belongs to one function literal inside it that branches (line 440). 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":"d2cli/paged.go"},"region":{"startLine":428}}}],"partialFingerprints":{"codehealthFindingId/v1":"0dce2bc130528219be0c5395ba66061b00ca0275f2fc1f35d9923701bf4fefe5"}},{"ruleId":"D2","level":"warning","message":{"text":"sequenceDiagram.placeActors (cognitive 29): sequenceDiagram.placeActors has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (27 pts), 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":363}}}],"partialFingerprints":{"codehealthFindingId/v1":"57084ddea75d1d0d283e082d25e67a97210f4b420e902bf2cb5ca0bc0a62d2b1"}},{"ruleId":"D2","level":"warning","message":{"text":"engine.preserveCompoundInteriors (cognitive 29): engine.preserveCompoundInteriors has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 3 (5 pts), boolean chains 3 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/engine/compound_routes.go"},"region":{"startLine":38}}}],"partialFingerprints":{"codehealthFindingId/v1":"478b5bce938714131fdb0a6befce1a372370c09d8343076b69a71574f8235d1f"}},{"ruleId":"D2","level":"warning","message":{"text":"hierarchy.placeBlock (cognitive 29): hierarchy.placeBlock has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (28 pts), loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/hierarchy/brandes_kopf.go"},"region":{"startLine":627}}}],"partialFingerprints":{"codehealthFindingId/v1":"ed38c804824a141cb1e4d39d4685c2087e58c0def40a70144dafb2e45b7920a1"}},{"ruleId":"D2","level":"warning","message":{"text":"graphCloneState.copyTrees (cognitive 29): graphCloneState.copyTrees has cognitive complexity 29 (threshold 15). Drivers by points: if/else 16 (24 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 9). Most of this is not in the body itself: 10 of the 29 points are its own statements and the rest belongs to one function literal inside it that branches (line 552). 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/d2talalayout/internal/layoutgraph/clone.go"},"region":{"startLine":546}}}],"partialFingerprints":{"codehealthFindingId/v1":"78e7a65026a149745571437236a03a5a9a72e4e4d030a8cfb41b6ef3291a427d"}},{"ruleId":"D2","level":"warning","message":{"text":"packing.routedContainerRoutesStayInsideShrink (cognitive 29): packing.routedContainerRoutesStayInsideShrink has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (23 pts), loops 3 (5 pts), 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":"d2layouts/d2talalayout/internal/packing/routed_container.go"},"region":{"startLine":216}}}],"partialFingerprints":{"codehealthFindingId/v1":"3eb1dc2b94db21496f0000ef318fc9a55622bf1c91feca41b1ab5c873c75b9ae"}},{"ruleId":"D2","level":"warning","message":{"text":"placement.chargeOptimizerTranspose (cognitive 29): placement.chargeOptimizerTranspose has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (21 pts), 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/d2talalayout/internal/placement/optimization_guard.go"},"region":{"startLine":549}}}],"partialFingerprints":{"codehealthFindingId/v1":"cb6ee03bb9f6412ca77c7726ae48b1188142ec726c0f728bf47da0711a1b9b95"}},{"ruleId":"D2","level":"warning","message":{"text":"placement.withHubSpokesSuppressed (cognitive 29): placement.withHubSpokesSuppressed has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/sized_optimizer.go"},"region":{"startLine":57}}}],"partialFingerprints":{"codehealthFindingId/v1":"ebeb5234e46e51cfa9926d8b6300a22683017bdfd5da86f234fbc0eb468bd4f7"}},{"ruleId":"D2","level":"warning","message":{"text":"sizelessOptimizer.bestSwapCandidateGuarded (cognitive 29): sizelessOptimizer.bestSwapCandidateGuarded has cognitive complexity 29 (threshold 15). Drivers by points: if/else 15 (27 pts), boolean chains 1, loops 1 (nesting depth added 12). Of this number, 17 points are the body\u0027s own statements and 12 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/sizeless_optimizer.go"},"region":{"startLine":479}}}],"partialFingerprints":{"codehealthFindingId/v1":"b9dd640c416a5a083e54b9011face9cfb87a3c54cab834caa6079232fbdb3525"}},{"ruleId":"D2","level":"warning","message":{"text":"OVG.isMisdirectedPortPair (cognitive 29): OVG.isMisdirectedPortPair has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (22 pts), boolean chains 4, loops 2 (3 pts) (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/d2talalayout/internal/routing/ovg.go"},"region":{"startLine":1355}}}],"partialFingerprints":{"codehealthFindingId/v1":"f8579c4b6a97ed00dae90f8a8df38bed4f7f2fa86d06f1989eb65731c98f3fa1"}},{"ruleId":"D2","level":"warning","message":{"text":"d2oracle.RenameIDDeltas (cognitive 29): d2oracle.RenameIDDeltas has cognitive complexity 29 (threshold 15). Drivers by points: if/else 17 (26 pts), 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":3163}}}],"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 13 (24 pts), 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":1490}}}],"partialFingerprints":{"codehealthFindingId/v1":"c6ca4294a41cdc55a1975c4a348be6a6fd81df453d88fd06121b451d0873726b"}},{"ruleId":"D2","level":"warning","message":{"text":"nativeScene.frameRaster (cognitive 29): nativeScene.frameRaster has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 5 (12 pts), boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/source_panels.go"},"region":{"startLine":281}}}],"partialFingerprints":{"codehealthFindingId/v1":"777c486f6d0b4ddde21c7423e9076206e6a72712c911c495f7d46083547f6b77"}},{"ruleId":"D2","level":"warning","message":{"text":"preflight.animationValueAt (cognitive 29): preflight.animationValueAt has cognitive complexity 29 (threshold 15). Drivers by points: if/else 19 (26 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/animation_value.go"},"region":{"startLine":15}}}],"partialFingerprints":{"codehealthFindingId/v1":"a506f4d93820ed196e56fb7f361f08de51250230f9900f7209c47cfb670efab0"}},{"ruleId":"D2","level":"warning","message":{"text":"RenderSession.getOrLoad (cognitive 29): RenderSession.getOrLoad has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (28 pts), loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/session.go"},"region":{"startLine":342}}}],"partialFingerprints":{"codehealthFindingId/v1":"f2654ff789167abd2ca42d7ffd92636f199033e21b25e2666a57b4898c0b5d5c"}},{"ruleId":"D2","level":"warning","message":{"text":"utf8FontFile.GenerateCutFont (cognitive 29): utf8FontFile.GenerateCutFont has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 4 (8 pts), boolean chains 1 (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/font/subsetFont.go"},"region":{"startLine":338}}}],"partialFingerprints":{"codehealthFindingId/v1":"cfcc4be086ba5f0c5eb2c99a8fe4e83806ca9e2f97aae811e6d29224182f6412"}},{"ruleId":"D2","level":"warning","message":{"text":"geo.cubicRoots (cognitive 29): geo.cubicRoots has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 3 (7 pts), 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":"compiler.getClassMap (cognitive 28): compiler.getClassMap has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (22 pts), boolean chains 3, loops 1 (3 pts) (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":"d2compiler/compile.go"},"region":{"startLine":570}}}],"partialFingerprints":{"codehealthFindingId/v1":"f23ad2aacc14852be40687a259e3eb256479219080db82d00492bedeb4f404bf"}},{"ruleId":"D2","level":"warning","message":{"text":"compiler.validateConfigs (cognitive 28): compiler.validateConfigs has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (23 pts), boolean chains 2, match/switch 1 (2 pts), 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":359}}}],"partialFingerprints":{"codehealthFindingId/v1":"934254b9dbb05d73c54dd164313691e80370f98ebc49f00feca6c2676271bd77"}},{"ruleId":"D2","level":"warning","message":{"text":"Map.DeleteField (cognitive 28): Map.DeleteField has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 3 (9 pts), 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":"d2ir/d2ir.go"},"region":{"startLine":1488}}}],"partialFingerprints":{"codehealthFindingId/v1":"89a67fe91385f61481ccd16de81fa07996b2a6ce7f9f4b04ed968ca21f1a803b"}},{"ruleId":"D2","level":"warning","message":{"text":"d2layouts.ExtractSubgraph (cognitive 28): d2layouts.ExtractSubgraph has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (19 pts), loops 5 (7 pts), 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":637}}}],"partialFingerprints":{"codehealthFindingId/v1":"14d519aa02efa5a4a322e8b3ffb8f25a0886879ce1b323093f54ab21e8c26d96"}},{"ruleId":"D2","level":"warning","message":{"text":"hierarchy.sifting (cognitive 28): hierarchy.sifting has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (23 pts), loops 3 (4 pts), 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":"d2layouts/d2talalayout/internal/hierarchy/sifting.go"},"region":{"startLine":94}}}],"partialFingerprints":{"codehealthFindingId/v1":"91f7fc4fe4abeda3ea8a8df574c90cbb0281f7a684262dc25e1207c66b70bd88"}},{"ruleId":"D2","level":"warning","message":{"text":"rankSimplex.certify (cognitive 28): rankSimplex.certify has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (26 pts), loops 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/hierarchy/rank_simplex.go"},"region":{"startLine":497}}}],"partialFingerprints":{"codehealthFindingId/v1":"2011d9d021e17f765e9cbd77e99c741d06bcf251add06bb32400e2260f097580"}},{"ruleId":"D2","level":"warning","message":{"text":"graphCloneState.copySequences (cognitive 28): graphCloneState.copySequences has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 3 (5 pts), 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":"d2layouts/d2talalayout/internal/layoutgraph/clone.go"},"region":{"startLine":406}}}],"partialFingerprints":{"codehealthFindingId/v1":"fe604eda0f54e0bfc5d54cbb6c83f20ebb3f46dd7f6e9d018d1c050f864e082b"}},{"ruleId":"D2","level":"warning","message":{"text":"Graph.containerRDFSOrderContext (cognitive 28): Graph.containerRDFSOrderContext has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (23 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/graph.go"},"region":{"startLine":877}}}],"partialFingerprints":{"codehealthFindingId/v1":"bb7ba219e7159d7c41e6d157b66750d4598e39197f125f719a5532079ba93014"}},{"ruleId":"D2","level":"warning","message":{"text":"packing.binPackReverseDFSWalk (cognitive 28): packing.binPackReverseDFSWalk has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (25 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/packing/guard.go"},"region":{"startLine":336}}}],"partialFingerprints":{"codehealthFindingId/v1":"ce0b7fea38beaeae4556f7dcff812188fac913441bf3690fefa8a582663a454d"}},{"ruleId":"D2","level":"warning","message":{"text":"placement.appendOptimizerTreeNears (cognitive 28): placement.appendOptimizerTreeNears has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (25 pts), loops 2 (3 pts) (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":"d2layouts/d2talalayout/internal/placement/optimization_guard.go"},"region":{"startLine":125}}}],"partialFingerprints":{"codehealthFindingId/v1":"51c483e6c84eccb5efa930ee6ca15444490ee9bdff64eca89c39f3136c999dd0"}},{"ruleId":"D2","level":"warning","message":{"text":"optimizerSpatialIndex.doesOverlap (cognitive 28): optimizerSpatialIndex.doesOverlap has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 5, loops 2 (3 pts) (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/d2talalayout/internal/placement/optimizer_spatial_index.go"},"region":{"startLine":281}}}],"partialFingerprints":{"codehealthFindingId/v1":"b8df7ad5399c2974d30b87d7d8fc219da250ffb88fb866bb400e601e6f737f1e"}},{"ruleId":"D2","level":"warning","message":{"text":"quality.inspectWithLimit (cognitive 28): quality.inspectWithLimit has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (21 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/quality/inspection.go"},"region":{"startLine":27}}}],"partialFingerprints":{"codehealthFindingId/v1":"5ea54b99c99eca71541682efa56ef55ad654e86242584dfc9056497c7d717159"}},{"ruleId":"D2","level":"warning","message":{"text":"trees.normalizedAspectRatio (cognitive 28): trees.normalizedAspectRatio has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 4 (6 pts), 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":"d2layouts/d2talalayout/internal/trees/layout.go"},"region":{"startLine":701}}}],"partialFingerprints":{"codehealthFindingId/v1":"731b55f87f4e06f27fc8afdeec518c5744e86445bd1b7271b5a53b088424a454"}},{"ruleId":"D2","level":"warning","message":{"text":"d2lsp.GetRefRanges (cognitive 28): d2lsp.GetRefRanges has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 5 (11 pts), 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":"d2isometricimg.sceneOutputDensity (cognitive 28): d2isometricimg.sceneOutputDensity has cognitive complexity 28 (threshold 15). Drivers by points: loops 9 (19 pts), if/else 5 (8 pts), boolean chains 1 (nesting depth added 13). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/framing.go"},"region":{"startLine":208}}}],"partialFingerprints":{"codehealthFindingId/v1":"75aa65d73f4d014fc421817b998518e602c743f0e3a80d64e5969a0776447742"}},{"ruleId":"D2","level":"warning","message":{"text":"d2isometricimg.nativeShapeProfiles (cognitive 28): d2isometricimg.nativeShapeProfiles has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 4 (7 pts), boolean chains 3 (nesting depth added 13). Of this number, 21 points are the body\u0027s own statements and 7 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/native_shapes.go"},"region":{"startLine":593}}}],"partialFingerprints":{"codehealthFindingId/v1":"d8cb2f62fd53645f4847a7b095787fe7b73eb544df654cc2b49a23700db8ff2a"}},{"ruleId":"D2","level":"warning","message":{"text":"d2isometricimg.richSourceSize (cognitive 28): d2isometricimg.richSourceSize has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 6 (9 pts), boolean chains 1 (nesting depth added 12). Of this number, 26 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/rich_labels.go"},"region":{"startLine":165}}}],"partialFingerprints":{"codehealthFindingId/v1":"b470911d9c8b74675daf9dadc279ff7e768005d13da1d3381c00577a5a0bc68a"}},{"ruleId":"D2","level":"warning","message":{"text":"d2isometricimg.nativeFallbackTextTexture (cognitive 28): d2isometricimg.nativeFallbackTextTexture has cognitive complexity 28 (threshold 15). Drivers by points: if/else 17 (21 pts), loops 4 (6 pts), boolean chains 1 (nesting depth added 6). Of this number, 16 points are the body\u0027s own statements and 12 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/surface_fonts.go"},"region":{"startLine":206}}}],"partialFingerprints":{"codehealthFindingId/v1":"0c06ce3281d510c1fcfabc93a853f1ec932d1b8d40ee50932d4b7d4992a81deb"}},{"ruleId":"D2","level":"warning","message":{"text":"d2raster.paintDropShadowIntegerGeneral (cognitive 28): d2raster.paintDropShadowIntegerGeneral has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (23 pts), loops 2 (3 pts), 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":"d2renderers/d2raster/filter.go"},"region":{"startLine":1079}}}],"partialFingerprints":{"codehealthFindingId/v1":"a845eb1b2a22364fe1149b4e8c3349a592879062dd268e6198d7b022adad1695"}},{"ruleId":"D2","level":"warning","message":{"text":"d2raster.drawLinearGradientMaskPixels (cognitive 28): d2raster.drawLinearGradientMaskPixels has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (25 pts), loops 2 (3 pts) (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":"d2renderers/d2raster/gradient.go"},"region":{"startLine":1184}}}],"partialFingerprints":{"codehealthFindingId/v1":"ce2b8cc3d8cacd10dd4eea488dff5de83eef169433025420ee80854989e932d9"}},{"ruleId":"D2","level":"warning","message":{"text":"preflight.path (cognitive 28): preflight.path has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (22 pts), loops 2 (5 pts), 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":"d2renderers/d2raster/raster.go"},"region":{"startLine":1277}}}],"partialFingerprints":{"codehealthFindingId/v1":"a44c0d018f638f2b40934a20b239f32f45c50fb7f45c151e105a0a3bf3f1aecb"}},{"ruleId":"D2","level":"warning","message":{"text":"d2svg.wrapIsometricSVG (cognitive 28): d2svg.wrapIsometricSVG has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 8, match/switch 1 (2 pts), loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svg/isometric.go"},"region":{"startLine":104}}}],"partialFingerprints":{"codehealthFindingId/v1":"55d55f074b7f41b7bc9f77a33eec07d71e0d16a919b0e63bffa9abb0308a27ad"}},{"ruleId":"D2","level":"warning","message":{"text":"d2svg.validateRenderPaints (cognitive 28): d2svg.validateRenderPaints has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (22 pts), loops 4 (6 pts) (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/d2svg/paint_validation.go"},"region":{"startLine":16}}}],"partialFingerprints":{"codehealthFindingId/v1":"18fc09562949dd00ff62a017a607a6a369a6d0e286467e8ba21d6c8d86a0fd5d"}},{"ruleId":"D2","level":"warning","message":{"text":"svgImporter.validateIgnoredUnnamespacedAttribute (cognitive 28): svgImporter.validateIgnoredUnnamespacedAttribute has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (23 pts), boolean chains 3, loops 1 (2 pts) (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/d2svgimport/boilerplate.go"},"region":{"startLine":243}}}],"partialFingerprints":{"codehealthFindingId/v1":"4abdd1b117fa9f286142521bb1f2cace141339a2af69f61f01ecb9425d4e22a5"}},{"ruleId":"D2","level":"warning","message":{"text":"svgImporter.compileLinearGradient (cognitive 28): svgImporter.compileLinearGradient has cognitive complexity 28 (threshold 15). Drivers by points: if/else 19 (26 pts), boolean chains 1, loops 1 (nesting depth added 7). 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":"d2renderers/d2svgimport/gradient.go"},"region":{"startLine":90}}}],"partialFingerprints":{"codehealthFindingId/v1":"91fc7eee5dca5cf47c75c81aa1c7db3e7a957f1bc2bc12b40c4b2d0d27bca75d"}},{"ruleId":"D2","level":"warning","message":{"text":"compiler.collectVariables (cognitive 27): compiler.collectVariables has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 2 (4 pts), 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":"d2ir/compile.go"},"region":{"startLine":798}}}],"partialFingerprints":{"codehealthFindingId/v1":"5b88a5d0cdd7ca1d20b385983cd36fc77a2969918e1240fc1f21e0e9eadee9a7"}},{"ruleId":"D2","level":"warning","message":{"text":"Map._tripleGlob (cognitive 27): Map._tripleGlob has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (23 pts), boolean chains 3, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ir/pattern.go"},"region":{"startLine":166}}}],"partialFingerprints":{"codehealthFindingId/v1":"7c56e619e7b1824c52d369e9eb31e8f620cb5388245ca68b75fddaf731cb6159"}},{"ruleId":"D2","level":"warning","message":{"text":"d2talalayout.validateCompletedGraph (cognitive 27): d2talalayout.validateCompletedGraph has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (25 pts), loops 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/result_validate.go"},"region":{"startLine":421}}}],"partialFingerprints":{"codehealthFindingId/v1":"6f7e14222703c9c9c1bb9266de2a763d9b1a3e428d028bf42d3c897545fe72d6"}},{"ruleId":"D2","level":"warning","message":{"text":"packing.estimateEdgeSegments (cognitive 27): packing.estimateEdgeSegments has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (22 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 9). Of this number, 25 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/packing/binpack.go"},"region":{"startLine":1283}}}],"partialFingerprints":{"codehealthFindingId/v1":"d5aca98efe5f93c2f69e27b5011f1390e9d4ab4673ba05ff202257b5aeefa079"}},{"ruleId":"D2","level":"warning","message":{"text":"packing.routedContainerSegmentBoxInterval (cognitive 27): packing.routedContainerSegmentBoxInterval has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (25 pts), boolean chains 1, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/packing/routed_container.go"},"region":{"startLine":382}}}],"partialFingerprints":{"codehealthFindingId/v1":"1d072c929a88fa33447d8b64198a5ce57715e2d23ead5cb97221b83a43b4f4ef"}},{"ruleId":"D2","level":"warning","message":{"text":"placement.scaleBasedOnEdges (cognitive 27): placement.scaleBasedOnEdges has cognitive complexity 27 (threshold 15). Drivers by points: if/else 16 (23 pts), loops 3, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/stages.go"},"region":{"startLine":26}}}],"partialFingerprints":{"codehealthFindingId/v1":"65cbd9b538a6e134035b9fe4dc4a409c88b0ed344df31bf921b1f3c85ed1c404"}},{"ruleId":"D2","level":"warning","message":{"text":"placementcost.ContainerAlignmentCost (cognitive 27): placementcost.ContainerAlignmentCost has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placementcost/graph.go"},"region":{"startLine":358}}}],"partialFingerprints":{"codehealthFindingId/v1":"0e737b8aa6087c6ee0ae5cca8400d8e578d005e6aaa22359eb625e99952f6f38"}},{"ruleId":"D2","level":"warning","message":{"text":"proximity.connectedHerds (cognitive 27): proximity.connectedHerds has cognitive complexity 27 (threshold 15). Drivers by points: if/else 4 (14 pts), loops 6 (13 pts) (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/d2talalayout/internal/proximity/herding.go"},"region":{"startLine":148}}}],"partialFingerprints":{"codehealthFindingId/v1":"88b94a80cbbdf63002a358f734f46d2d6af1417c0695a3670e34ddca6ce6585b"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.sourceAndTargetClusterNodes (cognitive 27): routing.sourceAndTargetClusterNodes has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 4 (9 pts) (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/d2talalayout/internal/routing/coordinator.go"},"region":{"startLine":1354}}}],"partialFingerprints":{"codehealthFindingId/v1":"384abcd5f67559afc6b665a8eec3fabc0de2bf6bac1d894fd39e96897a8460f1"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.newOVGEdgeRouterWithWorkLimit (cognitive 27): routing.newOVGEdgeRouterWithWorkLimit has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (21 pts), loops 4 (5 pts), boolean chains 1 (nesting depth added 9). Of this number, 26 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into 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/d2talalayout/internal/routing/ovg_edge_router.go"},"region":{"startLine":102}}}],"partialFingerprints":{"codehealthFindingId/v1":"4e7e491bcae72154aef226002b19e82e4d5872884975bd7aa4f035be84b554ee"}},{"ruleId":"D2","level":"warning","message":{"text":"OVG.addTunnels (cognitive 27): OVG.addTunnels has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 3 (7 pts) (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":"d2layouts/d2talalayout/internal/routing/ovg.go"},"region":{"startLine":1008}}}],"partialFingerprints":{"codehealthFindingId/v1":"affe29cc8826164c7ecf461e29b701278808847fbd72b6f1e3943eb53011cf3f"}},{"ruleId":"D2","level":"warning","message":{"text":"ovgEdgeRouter.fillPathGuarded (cognitive 27): ovgEdgeRouter.fillPathGuarded has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 8, loops 2 (3 pts) (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/d2talalayout/internal/routing/slingshot.go"},"region":{"startLine":413}}}],"partialFingerprints":{"codehealthFindingId/v1":"8f186f0a809bbe368d2e2c33dcb0699c0e6044287adbaab046d12e65a990b957"}},{"ruleId":"D2","level":"warning","message":{"text":"ovgBuildGuard.containerRDFSOrder (cognitive 27): ovgBuildGuard.containerRDFSOrder has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (22 pts), loops 2 (4 pts), 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":"d2layouts/d2talalayout/internal/routing/ovg_resource.go"},"region":{"startLine":539}}}],"partialFingerprints":{"codehealthFindingId/v1":"3e08ab6c48a4511732a1704258b1079a214d1a0a6d791f5bc2875bbff4bee8a9"}},{"ruleId":"D2","level":"warning","message":{"text":"meshBuilder.structuredNode (cognitive 27): meshBuilder.structuredNode has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (18 pts), loops 4 (6 pts), boolean chains 3 (nesting depth added 9). Of this number, 25 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/native_structured.go"},"region":{"startLine":142}}}],"partialFingerprints":{"codehealthFindingId/v1":"e5f12381a86813f8955e36053c6771c6783ca57282b13a66c24e7b9bf677f0e8"}},{"ruleId":"D2","level":"warning","message":{"text":"d2raster.countEvenOddPathSamples (cognitive 27): d2raster.countEvenOddPathSamples has cognitive complexity 27 (threshold 15). Drivers by points: if/else 4 (16 pts), loops 3 (6 pts), match/switch 1 (5 pts) (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":"d2renderers/d2raster/effects.go"},"region":{"startLine":980}}}],"partialFingerprints":{"codehealthFindingId/v1":"04bcf51181fb2cc954ae1f0a0a4fd4c8a5e3409ea21d6f63f2845954b800ce88"}},{"ruleId":"D2","level":"warning","message":{"text":"d2raster.render (cognitive 27): d2raster.render has cognitive complexity 27 (threshold 15). Drivers by points: if/else 20 (22 pts), boolean chains 4, loops 1 (nesting depth added 2). Of this number, 26 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/raster.go"},"region":{"startLine":341}}}],"partialFingerprints":{"codehealthFindingId/v1":"cca4cea329686ceec861e66c495a9b437b8d1ed5be0410042c6b5b865050e7fa"}},{"ruleId":"D2","level":"warning","message":{"text":"builder.buildLegend (cognitive 27): builder.buildLegend has cognitive complexity 27 (threshold 15). Drivers by points: if/else 17 (24 pts), 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":"d2renderers/d2scenebuild/legend.go"},"region":{"startLine":351}}}],"partialFingerprints":{"codehealthFindingId/v1":"69d512fd480cc756a72fde05fdd61d52ae353a953533f39c771982b030a1734d"}},{"ruleId":"D2","level":"warning","message":{"text":"d2sketch.CompileScenePaths (cognitive 27): d2sketch.CompileScenePaths has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (20 pts), match/switch 2 (4 pts), loops 2, boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2sketch/scene.go"},"region":{"startLine":34}}}],"partialFingerprints":{"codehealthFindingId/v1":"571c02be1b263275373cad3f0b50807fcec2aa2440a34fcde617e9d58c7f6ec4"}},{"ruleId":"D2","level":"warning","message":{"text":"d2svg.themeRuleSelector (cognitive 27): d2svg.themeRuleSelector has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 8, loops 4 (6 pts) (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/d2svg/theme.go"},"region":{"startLine":120}}}],"partialFingerprints":{"codehealthFindingId/v1":"e464dc04e0bfef30d1a53f68c0dc09107d0091c6fba686278f95c01445f9f190"}},{"ruleId":"D2","level":"warning","message":{"text":"d2svgimport.parseSVGNumber (cognitive 27): d2svgimport.parseSVGNumber has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 10, loops 3 (5 pts) (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/d2svgimport/style.go"},"region":{"startLine":648}}}],"partialFingerprints":{"codehealthFindingId/v1":"5fe464418c68e1d5d6934da49d41ee6339a1177003c9d257070b5466a96ae1ae"}},{"ruleId":"D2","level":"warning","message":{"text":"clusterFaceResolver.resolveCluster (cognitive 27): clusterFaceResolver.resolveCluster has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (20 pts), loops 4 (6 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/internal/fontface/shaping.go"},"region":{"startLine":500}}}],"partialFingerprints":{"codehealthFindingId/v1":"8d1e643c4bac881426523640917d9e4d1a59c67e54f2abcf8061c32b3484c24e"}},{"ruleId":"D2","level":"warning","message":{"text":"GoFPDF.AddPDFPage (cognitive 27): GoFPDF.AddPDFPage has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (22 pts), loops 3 (5 pts) (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":"lib/pdf/pdf.go"},"region":{"startLine":71}}}],"partialFingerprints":{"codehealthFindingId/v1":"6513c649da1f922c8d0d059caad4186f5ccab08b25bd232ea056d77c91eb0f3b"}},{"ruleId":"D2","level":"warning","message":{"text":"textmeasure.fitMarkdownTableColumns (cognitive 27): textmeasure.fitMarkdownTableColumns has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 8 (12 pts), 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":"lib/textmeasure/markdown_svg.go"},"region":{"startLine":1668}}}],"partialFingerprints":{"codehealthFindingId/v1":"966fb064540c5f80c1a2a62025185474770b47bb9b1a2f096cad8f019f3cf70c"}},{"ruleId":"D2","level":"warning","message":{"text":"run.compare (cognitive 27): run.compare has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 4 (10 pts) (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":"ci/nonlayout-perf/run.py"},"region":{"startLine":190}}}],"partialFingerprints":{"codehealthFindingId/v1":"a760fd13dd6f26946bc415aeec72de787b2b1c06bf20098674461fbd518297ab"}},{"ruleId":"D2","level":"warning","message":{"text":"d2cli.renderWithPNGEncoderToPaths (cognitive 26): d2cli.renderWithPNGEncoderToPaths has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 8, 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":894}}}],"partialFingerprints":{"codehealthFindingId/v1":"3acdc4f728b4ad566796507ffd8d9c8897a7b8d4bcb18153664bcbc1b5649c62"}},{"ruleId":"D2","level":"warning","message":{"text":"boardOutputTransaction.prepareBackups (cognitive 26): boardOutputTransaction.prepareBackups has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (24 pts), boolean chains 1, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2cli/board_output_publish.go"},"region":{"startLine":510}}}],"partialFingerprints":{"codehealthFindingId/v1":"6c115facc0dc592af2ff4aa0fe7ebc9fc32be2e8febbae35e848cc601a4d795d"}},{"ruleId":"D2","level":"warning","message":{"text":"isometricPagedRenderer.admitPage (cognitive 26): isometricPagedRenderer.admitPage has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 3 (5 pts), boolean chains 4 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2cli/isometric_paged.go"},"region":{"startLine":135}}}],"partialFingerprints":{"codehealthFindingId/v1":"91640caa0226e8a84843810f3972f5e7541c24e152afd1507eed9dd28e1f6470"}},{"ruleId":"D2","level":"warning","message":{"text":"compiler.validateBoardLinks (cognitive 26): compiler.validateBoardLinks has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 4, boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2compiler/compile.go"},"region":{"startLine":1726}}}],"partialFingerprints":{"codehealthFindingId/v1":"9e2dbc1d17dd8c4c541f4d296acbca306b28395b433c3741d4e45ad0529c81bc"}},{"ruleId":"D2","level":"warning","message":{"text":"Map._doubleGlob (cognitive 26): Map._doubleGlob has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (23 pts), boolean chains 2, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ir/pattern.go"},"region":{"startLine":134}}}],"partialFingerprints":{"codehealthFindingId/v1":"2bce6d2c973a7fc3904aeb40fbec1d43dbcc56d25569102b8f1367cb48b816ff"}},{"ruleId":"D2","level":"warning","message":{"text":"engine.compoundEnclosedRoute (cognitive 26): engine.compoundEnclosedRoute has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 5, loops 2 (nesting depth added 8). Of this number, 23 points are the body\u0027s own statements and 3 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/engine/compound_routes.go"},"region":{"startLine":108}}}],"partialFingerprints":{"codehealthFindingId/v1":"32ea25e5174b7ecf63fbaa74c8bd39a32eb4545604f9ff312b7769effc4bab44"}},{"ruleId":"D2","level":"warning","message":{"text":"graphCloneState.copyClusters (cognitive 26): graphCloneState.copyClusters has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/clone.go"},"region":{"startLine":347}}}],"partialFingerprints":{"codehealthFindingId/v1":"218c6e7223a27516628aa86bae86cc12ad40226447edc3bd4086c3fd3701af44"}},{"ruleId":"D2","level":"warning","message":{"text":"OVG.addBoundaryNodesAboveLevelNodes (cognitive 26): OVG.addBoundaryNodesAboveLevelNodes has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 4 (5 pts), 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":"d2layouts/d2talalayout/internal/routing/ovg_hierarchy.go"},"region":{"startLine":233}}}],"partialFingerprints":{"codehealthFindingId/v1":"f359468fe0bf2bec043caf99922fe6df1002de86fac29b1135130b1c6b9c33b6"}},{"ruleId":"D2","level":"warning","message":{"text":"d2isometricimg.nativeSolidContactRoutes (cognitive 26): d2isometricimg.nativeSolidContactRoutes has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 3, loops 2 (nesting depth added 9). Of this number, 23 points are the body\u0027s own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/solid_contacts.go"},"region":{"startLine":79}}}],"partialFingerprints":{"codehealthFindingId/v1":"b44af4492d9dcb5c09a4ddb1fffbadde93f4cb2035242437ba2772c11b6099ae"}},{"ruleId":"D2","level":"warning","message":{"text":"meshBuilder.prepareGradientMaterials (cognitive 26): meshBuilder.prepareGradientMaterials has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 5 (7 pts), 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":"d2renderers/d2isometric/d2isometricimg/gradient_paints.go"},"region":{"startLine":58}}}],"partialFingerprints":{"codehealthFindingId/v1":"2ac45d429516fad885b85b8eb1e6d58dbae5c959dd893e6a426cd8782e35e715"}},{"ruleId":"D2","level":"warning","message":{"text":"budget.check (cognitive 26): budget.check has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 2 (4 pts), boolean chains 2, match/switch 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/scene.go"},"region":{"startLine":343}}}],"partialFingerprints":{"codehealthFindingId/v1":"fd74137b2f3ff509e0a8b11b02ef3c159879ee21afecd9c54168ad9200d7c9fa"}},{"ruleId":"D2","level":"warning","message":{"text":"d2scene.EndpointArcToCenter (cognitive 26): d2scene.EndpointArcToCenter has cognitive complexity 26 (threshold 15). Drivers by points: if/else 16 (17 pts), boolean chains 9 (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":"d2renderers/d2scene/path.go"},"region":{"startLine":356}}}],"partialFingerprints":{"codehealthFindingId/v1":"855a0b9b37d2fe627e6ee8c40620cfce53d51f346651e50d3a62c1277e7afdf8"}},{"ruleId":"D2","level":"warning","message":{"text":"builder.preflightAppendix (cognitive 26): builder.preflightAppendix has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/appendix.go"},"region":{"startLine":87}}}],"partialFingerprints":{"codehealthFindingId/v1":"902bcd4c795892d8309762cd8ad2f09d5c31daa1d8b586ec00b3f7cb31cfb1ca"}},{"ruleId":"D2","level":"warning","message":{"text":"builder.sceneTextReferences (cognitive 26): builder.sceneTextReferences has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 3, match/switch 1 (2 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/font_fallback.go"},"region":{"startLine":802}}}],"partialFingerprints":{"codehealthFindingId/v1":"f8e1f31d2c77e59d701ad51e86d848ce408437fa4a2f60369644ccad20b8814d"}},{"ruleId":"D2","level":"warning","message":{"text":"d2svgimport.validateImportedBounds (cognitive 26): d2svgimport.validateImportedBounds has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 2 (3 pts), 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":"d2renderers/d2svgimport/import.go"},"region":{"startLine":199}}}],"partialFingerprints":{"codehealthFindingId/v1":"0294578b24a7d4ff6f7f639cceb158ade5c12f271ff838fc6ed2ace8a71b1449"}},{"ruleId":"D2","level":"warning","message":{"text":"Resolver.Resolve (cognitive 26): Resolver.Resolve has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (21 pts), match/switch 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/imageasset/resolve.go"},"region":{"startLine":72}}}],"partialFingerprints":{"codehealthFindingId/v1":"92cc8b84211c218593389bad126b90f5275cb4de29285fd6c5093d08c673c077"}},{"ruleId":"D2","level":"warning","message":{"text":"textmeasure.markdownListMarker (cognitive 26): textmeasure.markdownListMarker has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2 (5 pts), boolean chains 4, match/switch 1 (3 pts) (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":"lib/textmeasure/markdown_svg.go"},"region":{"startLine":1780}}}],"partialFingerprints":{"codehealthFindingId/v1":"1315eb9e2bbbc5583ef4e30e624ef0090c69f4554d0c7f4fb874bd9e492fa511"}},{"ruleId":"D2","level":"warning","message":{"text":"compare.main (cognitive 26): compare.main has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (15 pts), ternaries 3 (5 pts), boolean chains 4, 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":"ci/tala-performance/compare.py"},"region":{"startLine":48}}}],"partialFingerprints":{"codehealthFindingId/v1":"c13ec0637e94d4cd7a1c1f6cf7a54b390bd2fd8eae07a296e88eb7ac1c6ce9b4"}},{"ruleId":"D2","level":"warning","message":{"text":"d2cli.fmtCmd (cognitive 25): d2cli.fmtCmd has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (23 pts), 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":"compiler.compileArrowheads (cognitive 25): compiler.compileArrowheads has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 2, loops 1 (2 pts) (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":"d2compiler/compile.go"},"region":{"startLine":1327}}}],"partialFingerprints":{"codehealthFindingId/v1":"5e7f847b7506ac22f208ed9bbe5f301c72bf3d663490c6cc6acc2e087d5f4173"}},{"ruleId":"D2","level":"warning","message":{"text":"Map.QueryAll (cognitive 25): Map.QueryAll has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 3 (5 pts) (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 6 (14 pts), loops 6 (8 pts), 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":611}}}],"partialFingerprints":{"codehealthFindingId/v1":"b137bc65497b1ec3dc471bf9bc750ead3113e3ac3552c047e3ba88791605c0f2"}},{"ruleId":"D2","level":"warning","message":{"text":"d2grid.layoutGrid (cognitive 25): d2grid.layoutGrid has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (21 pts), 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":184}}}],"partialFingerprints":{"codehealthFindingId/v1":"76a503a027f810a0fba8646b1634e0ece8f85278285386cd84a588efe3799609"}},{"ruleId":"D2","level":"warning","message":{"text":"sequenceDiagram.adjustGroupLabel (cognitive 25): sequenceDiagram.adjustGroupLabel has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 7 (9 pts), 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":313}}}],"partialFingerprints":{"codehealthFindingId/v1":"812c0c79d2d0b28e53eabbd3a0c2a60116fc19a5c59d09b5b857e732075a3aac"}},{"ruleId":"D2","level":"warning","message":{"text":"quality.chargeEvaluationAreaWork (cognitive 25): quality.chargeEvaluationAreaWork has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 4 (7 pts), 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":"d2layouts/d2talalayout/internal/quality/evaluation_guard.go"},"region":{"startLine":57}}}],"partialFingerprints":{"codehealthFindingId/v1":"bb933a79cec740fff2bfd0f81c0cdef82cf11d2bd98e716d61604171d34f26fa"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.positionedArrowheadLabelCost (cognitive 25): routing.positionedArrowheadLabelCost has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 5 (7 pts), 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":"d2layouts/d2talalayout/internal/routing/slingshot.go"},"region":{"startLine":518}}}],"partialFingerprints":{"codehealthFindingId/v1":"7d18304137f1c3e91c03e9629134146589da4e0c184f667c844e26e8c856c469"}},{"ruleId":"D2","level":"warning","message":{"text":"trees.positionTreeEdgeLabels (cognitive 25): trees.positionTreeEdgeLabels has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 4 (6 pts) (nesting depth added 11). Of this number, 24 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/trees/layout.go"},"region":{"startLine":858}}}],"partialFingerprints":{"codehealthFindingId/v1":"69f27567a211d893ea5527fc8d847a9970bc895f05179b8d6c099421b9a90c41"}},{"ruleId":"D2","level":"warning","message":{"text":"trees.dominantTreeEdgeDirection (cognitive 25): trees.dominantTreeEdgeDirection has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/trees/preprocess_helpers.go"},"region":{"startLine":158}}}],"partialFingerprints":{"codehealthFindingId/v1":"5f172580635944e65af5d00b9fc9fbc1380ef6d5956cae9a61d32d3d6ab492b3"}},{"ruleId":"D2","level":"warning","message":{"text":"trees.disconnectTreeEdge (cognitive 25): trees.disconnectTreeEdge has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (21 pts), loops 2 (3 pts), 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":"d2layouts/d2talalayout/internal/trees/preprocess_helpers.go"},"region":{"startLine":512}}}],"partialFingerprints":{"codehealthFindingId/v1":"680c790f371a84ed393cbb552d95ed8f0e6d3c6ec8a19d75c2eb59b7c4dee0a7"}},{"ruleId":"D2","level":"warning","message":{"text":"layoutguard.CheckGraph (cognitive 25): layoutguard.CheckGraph has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (22 pts), loops 2, boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/internal/layoutguard/graph.go"},"region":{"startLine":31}}}],"partialFingerprints":{"codehealthFindingId/v1":"f30e7cfe68841f2526ebe054f7ba6ea208a87d0cf46427b9227570d92f379f5e"}},{"ruleId":"D2","level":"warning","message":{"text":"d2isometricimg.nativeGIFLoopScene (cognitive 25): d2isometricimg.nativeGIFLoopScene has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 4, loops 3 (nesting depth added 6). Most of this is not in the body itself: 9 of the 25 points are its own statements and the rest belongs to one function literal inside it that branches (line 26). 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":"d2renderers/d2isometric/d2isometricimg/gif_loop.go"},"region":{"startLine":16}}}],"partialFingerprints":{"codehealthFindingId/v1":"346852c8fd7ce3312d89faceae1999f4fa597d5a22a97ffaf1824c47ec48ffdf"}},{"ruleId":"D2","level":"warning","message":{"text":"d2isometricimg.svgNewVisibilityGrid (cognitive 25): d2isometricimg.svgNewVisibilityGrid has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 4 (9 pts), 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":"d2renderers/d2isometric/d2isometricimg/svg_visibility.go"},"region":{"startLine":157}}}],"partialFingerprints":{"codehealthFindingId/v1":"62c0a827b6b51613d1e726b0e87b36181200fa31e6ab3c7f352e5f1681d606e5"}},{"ruleId":"D2","level":"warning","message":{"text":"nativeScene.Frame (cognitive 25): nativeScene.Frame has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 5, loops 2 (5 pts) (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/d2isometric/d2isometricimg/geometry.go"},"region":{"startLine":687}}}],"partialFingerprints":{"codehealthFindingId/v1":"bdefa9fd07de23013ec387741a8f685cafebab468da06942f83118e42b5becea"}},{"ruleId":"D2","level":"warning","message":{"text":"meshBuilder.arrowWithOpacity (cognitive 25): meshBuilder.arrowWithOpacity has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (14 pts), loops 5 (6 pts), boolean chains 4, match/switch 1 (nesting depth added 4). Of this number, 16 points are the body\u0027s own statements and 9 belong to 4 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":"d2renderers/d2isometric/d2isometricimg/geometry_routes.go"},"region":{"startLine":171}}}],"partialFingerprints":{"codehealthFindingId/v1":"eb1b5966ecce847a2c9ca34afbb3ab6d42bbcbaca3608a5c53bb8626670c52fa"}},{"ruleId":"D2","level":"warning","message":{"text":"nativeSurfaceSVGWriter.primitive (cognitive 25): nativeSurfaceSVGWriter.primitive has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (22 pts), match/switch 2 (3 pts) (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/d2isometric/d2isometricimg/vector_surface_svg.go"},"region":{"startLine":371}}}],"partialFingerprints":{"codehealthFindingId/v1":"93e5a0e1f393e8cf8bb858effa700413b7956a3004281899dd141b6e3d3a8ec4"}},{"ruleId":"D2","level":"warning","message":{"text":"d2raster.drawLinearYOnlyGradientMaskPixels (cognitive 25): d2raster.drawLinearYOnlyGradientMaskPixels has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (21 pts), loops 2 (3 pts), 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":"d2renderers/d2raster/gradient.go"},"region":{"startLine":1228}}}],"partialFingerprints":{"codehealthFindingId/v1":"9d1d3aa340ccff0aabb3e817cbfb53e031fdafdc36dc7dc3776b777259404ce3"}},{"ruleId":"D2","level":"warning","message":{"text":"Path.transformedGeometryBounds (cognitive 25): Path.transformedGeometryBounds has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (22 pts), match/switch 1 (2 pts), 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":"d2renderers/d2scene/path.go"},"region":{"startLine":99}}}],"partialFingerprints":{"codehealthFindingId/v1":"2e824042fc112cfe6c1ac811d6d37b3714cc7f3ffbd55ae2bf33dcf11f077e3c"}},{"ruleId":"D2","level":"warning","message":{"text":"builder.measureAppendix (cognitive 25): builder.measureAppendix has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15 (23 pts), 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":"d2renderers/d2scenebuild/appendix.go"},"region":{"startLine":139}}}],"partialFingerprints":{"codehealthFindingId/v1":"3ef29aa53bd3712ecab5cbcd58e85a4fd5951f17dfe63942a2428ffecc4af10b"}},{"ruleId":"D2","level":"warning","message":{"text":"d2svgimport.validatePrimitiveBounds (cognitive 25): d2svgimport.validatePrimitiveBounds has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 3, match/switch 2 (3 pts), loops 1 (nesting depth added 10). Of this number, 22 points are the body\u0027s own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svgimport/import.go"},"region":{"startLine":242}}}],"partialFingerprints":{"codehealthFindingId/v1":"3fa4f27879af549231f959ff8482f8e4a3dca78a94a044b579097b3858a92311"}},{"ruleId":"D2","level":"warning","message":{"text":"svgImporter.compileGradientResources (cognitive 25): svgImporter.compileGradientResources has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (19 pts), loops 3 (6 pts) (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/d2svgimport/gradient.go"},"region":{"startLine":243}}}],"partialFingerprints":{"codehealthFindingId/v1":"bc2b1c4e15f3bf1690ea5a07be9c9cf52c499dc558dd7dd65158b0755f934af2"}},{"ruleId":"D2","level":"warning","message":{"text":"svgImporter.validateFrozenMathJaxTextElement (cognitive 25): svgImporter.validateFrozenMathJaxTextElement has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 7, loops 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svgimport/mathjax_text.go"},"region":{"startLine":57}}}],"partialFingerprints":{"codehealthFindingId/v1":"595d4cc6f32d453430aadfbf5b00a1776aae21a2ae5da089ab2898999d83d9a2"}},{"ruleId":"D2","level":"warning","message":{"text":"transformParser.arguments (cognitive 25): transformParser.arguments has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 4, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svgimport/transform.go"},"region":{"startLine":103}}}],"partialFingerprints":{"codehealthFindingId/v1":"34104a2caff2645ca29f3acb968f8e9c52fd94add6038639df97f1ba8c20f0f8"}},{"ruleId":"D2","level":"warning","message":{"text":"d2target.ValidateRenderTarget (cognitive 25): d2target.ValidateRenderTarget has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (19 pts), loops 3 (6 pts) (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":"d2target/render_validation.go"},"region":{"startLine":23}}}],"partialFingerprints":{"codehealthFindingId/v1":"f2813cf6de4b542aa8dfbf443ca98a7e4fc613527f434eb51dd9188ebfe299de"}},{"ruleId":"D2","level":"warning","message":{"text":"Resolver.validateCached (cognitive 25): Resolver.validateCached has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 6, 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":"lib/imageasset/resolve.go"},"region":{"startLine":633}}}],"partialFingerprints":{"codehealthFindingId/v1":"550bcc267d8953bfee7bf701f7c147c01ee26b74cab49d2daaf1ac2e25e0938f"}},{"ruleId":"D2","level":"warning","message":{"text":"xgif.AnimateCenteredOpaquePalettedImagesWithLimit (cognitive 25): xgif.AnimateCenteredOpaquePalettedImagesWithLimit has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (22 pts), loops 2, boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/xgif/encode.go"},"region":{"startLine":38}}}],"partialFingerprints":{"codehealthFindingId/v1":"d13cbdcbcde4de7313a775cb0e57abe5aacebcce3a261639002a806d7fb3f032"}},{"ruleId":"D2","level":"warning","message":{"text":"paletteTree.nearest (cognitive 25): paletteTree.nearest has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 5, loops 2 (3 pts) (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":"lib/xgif/xgif.go"},"region":{"startLine":722}}}],"partialFingerprints":{"codehealthFindingId/v1":"dbf0d2671c8eeaade080bdcecb513bab78e150f7ebe9626f68c724674710689b"}},{"ruleId":"D2","level":"warning","message":{"text":"d2graph.ResolveUnderscoreKey (cognitive 24): d2graph.ResolveUnderscoreKey has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 2 (4 pts), 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":775}}}],"partialFingerprints":{"codehealthFindingId/v1":"2bd7f362536e8569b8e192ff3c40396ec2eae1e78995c42e73e8fc4114f04db4"}},{"ruleId":"D2","level":"warning","message":{"text":"astCloner.cloneArray (cognitive 24): astCloner.cloneArray has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (21 pts), match/switch 1 (2 pts), 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":"d2ir/import_cache.go"},"region":{"startLine":91}}}],"partialFingerprints":{"codehealthFindingId/v1":"7a3cd98c896ed580a635afb0465e6ecb1e329352692e8e7303c6e7f1a0544f11"}},{"ruleId":"D2","level":"warning","message":{"text":"d2dagrelayout.positionLabelsIcons (cognitive 24): d2dagrelayout.positionLabelsIcons has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (20 pts), 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":577}}}],"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 13 (20 pts), 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":1153}}}],"partialFingerprints":{"codehealthFindingId/v1":"46cb5f4a96702e9cfdc1fbb21c24b4b828c87f183762f32690249584950a2568"}},{"ruleId":"D2","level":"warning","message":{"text":"sequenceDiagram.placeSpans (cognitive 24): sequenceDiagram.placeSpans has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 4, loops 3 (4 pts) (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":525}}}],"partialFingerprints":{"codehealthFindingId/v1":"18bf3c657856b80733835ce0b4122c1b0f5f18bd3fa3d6765d70fd5e3cd8ab30"}},{"ruleId":"D2","level":"warning","message":{"text":"d2talalayout.collectD2ObjectVisits (cognitive 24): d2talalayout.collectD2ObjectVisits has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 2 (3 pts) (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":"d2layouts/d2talalayout/adapter_validate.go"},"region":{"startLine":27}}}],"partialFingerprints":{"codehealthFindingId/v1":"08cc019c76caf452a6d160d13a71d8b5f2b7b63a600121f86d27836b5642a519"}},{"ruleId":"D2","level":"warning","message":{"text":"hierarchy.verticalAlignment (cognitive 24): hierarchy.verticalAlignment has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 9). 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":"d2layouts/d2talalayout/internal/hierarchy/brandes_kopf.go"},"region":{"startLine":535}}}],"partialFingerprints":{"codehealthFindingId/v1":"68f50155da74b3f8be3b7d877c6821c130807631ae37729db8a18efc10b0cc24"}},{"ruleId":"D2","level":"warning","message":{"text":"hierarchy.compoundInterfaceScore (cognitive 24): hierarchy.compoundInterfaceScore has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 3 (4 pts), 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":"d2layouts/d2talalayout/internal/hierarchy/compound.go"},"region":{"startLine":309}}}],"partialFingerprints":{"codehealthFindingId/v1":"3362984d43a7a23af2ce415e47a433467373c9b65b1d8f72e3bf2b047807f2f4"}},{"ruleId":"D2","level":"warning","message":{"text":"hierarchy.Assign (cognitive 24): hierarchy.Assign has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (19 pts), loops 4 (5 pts) (nesting depth added 8). 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":"d2layouts/d2talalayout/internal/hierarchy/discovery.go"},"region":{"startLine":38}}}],"partialFingerprints":{"codehealthFindingId/v1":"f810b65ec7337b329ada61c38a14b18d5273dbe2608a3a8bd85b44dfa1574d30"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.changedRouteIsClear (cognitive 24): routing.changedRouteIsClear has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 5, loops 2 (3 pts) (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/d2talalayout/internal/routing/port_interior_balance.go"},"region":{"startLine":87}}}],"partialFingerprints":{"codehealthFindingId/v1":"72575ac464a4a83ea14bf2857bd9cb51caca95c1faa74ba0ba4f18cb9a223cbd"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.shortcutLabelBoxes (cognitive 24): routing.shortcutLabelBoxes has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 4, loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/shortcut_routes.go"},"region":{"startLine":518}}}],"partialFingerprints":{"codehealthFindingId/v1":"9ee30fb9ae8236937bda203e46387f2579e5a92447d83be4db75076d570b7448"}},{"ruleId":"D2","level":"warning","message":{"text":"d2lsp.getBoardPathAtPosition (cognitive 24): d2lsp.getBoardPathAtPosition has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (20 pts), 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 10 (18 pts), boolean chains 3, loops 2 (3 pts) (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":1652}}}],"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 10 (22 pts), 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":1357}}}],"partialFingerprints":{"codehealthFindingId/v1":"d302c8f4b5cb047e666139d6efaaa7e7bfeffe910f713d083677305ab2aae1bf"}},{"ruleId":"D2","level":"warning","message":{"text":"d2isometricimg.renderGIF (cognitive 24): d2isometricimg.renderGIF has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 4 (7 pts) (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":"d2renderers/d2isometric/d2isometricimg/gif.go"},"region":{"startLine":20}}}],"partialFingerprints":{"codehealthFindingId/v1":"a22af791bb657d8b5f4031144b17ee1d18c8916866d3e746d19363f8d6e13ae7"}},{"ruleId":"D2","level":"warning","message":{"text":"d2isometricimg.hierarchyStrongTerraces (cognitive 24): d2isometricimg.hierarchyStrongTerraces has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 5, boolean chains 4 (nesting depth added 6). Of this number, 19 points are the body\u0027s own statements and 5 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into 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/d2isometric/d2isometricimg/hierarchy_support.go"},"region":{"startLine":20}}}],"partialFingerprints":{"codehealthFindingId/v1":"a4413afd7ee251c68668a4288f5da4d793b4db1fa2582a96fb8f283dff0acfa3"}},{"ruleId":"D2","level":"warning","message":{"text":"d2isometricimg.nativeSequenceCaptionData (cognitive 24): d2isometricimg.nativeSequenceCaptionData has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 5, loops 3 (4 pts) (nesting depth added 4). Of this number, 22 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: 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/d2isometric/d2isometricimg/sequence_routes.go"},"region":{"startLine":100}}}],"partialFingerprints":{"codehealthFindingId/v1":"472995412120845ea11a1926c18ed9a84e5cd2287294d6b49014596913abd9e2"}},{"ruleId":"D2","level":"warning","message":{"text":"meshBuilder.box (cognitive 24): meshBuilder.box has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 4 (10 pts), boolean chains 1 (nesting depth added 13). Of this number, 18 points are the body\u0027s own statements and 6 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/geometry.go"},"region":{"startLine":163}}}],"partialFingerprints":{"codehealthFindingId/v1":"4c3d46741848fe2d48acaa3cf303e4ccd19450c572de350b65e7ab3427c546f8"}},{"ruleId":"D2","level":"warning","message":{"text":"d2raster.paintDropShadow (cognitive 24): d2raster.paintDropShadow has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/filter.go"},"region":{"startLine":918}}}],"partialFingerprints":{"codehealthFindingId/v1":"f14c17bf779fce234d744879b16cd39e05206c992b2f302704e07809749f4f6b"}},{"ruleId":"D2","level":"warning","message":{"text":"d2raster.roundedRectSubpaths (cognitive 24): d2raster.roundedRectSubpaths has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 8). Of this number, 21 points are the body\u0027s own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into 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/d2raster/geometry.go"},"region":{"startLine":176}}}],"partialFingerprints":{"codehealthFindingId/v1":"80830474083d123ba0b0e2e2e3ef709b5ec92f793c8ffa07e9d89723c6e142d4"}},{"ruleId":"D2","level":"warning","message":{"text":"d2raster.prepareAnimatedPaintWithPattern (cognitive 24): d2raster.prepareAnimatedPaintWithPattern has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (23 pts), match/switch 1 (nesting depth added 12). The drivers above price the dispatch low by construction \u2014 a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full \u2014 so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/gradient.go"},"region":{"startLine":62}}}],"partialFingerprints":{"codehealthFindingId/v1":"ec289b68febd9c3f5727b97ee9905794deaf8e3c74307eaba992cf68810afb15"}},{"ruleId":"D2","level":"warning","message":{"text":"retainedVectorValidator.stroke (cognitive 24): retainedVectorValidator.stroke has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 5, match/switch 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/vector_validation.go"},"region":{"startLine":756}}}],"partialFingerprints":{"codehealthFindingId/v1":"f5ac5f262762c94ce1132d07d4b4e896e9215ed479498b2ab046fa630d5e1bc1"}},{"ruleId":"D2","level":"warning","message":{"text":"d2svg.addAppendixItems (cognitive 24): d2svg.addAppendixItems has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 2, match/switch 1 (2 pts) (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":2268}}}],"partialFingerprints":{"codehealthFindingId/v1":"779cd5447750c62ce774748b02aaf0636c50bece23a2177ac0769739707e6e86"}},{"ruleId":"D2","level":"warning","message":{"text":"svgImporter.validateUseGraph (cognitive 24): svgImporter.validateUseGraph has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 3 (4 pts), match/switch 1 (2 pts) (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":"d2renderers/d2svgimport/compile.go"},"region":{"startLine":96}}}],"partialFingerprints":{"codehealthFindingId/v1":"0363c8690c10e49071bff38d6f823cca383f813dbbcf74050ae20d442a9401ee"}},{"ruleId":"D2","level":"warning","message":{"text":"clusterFaceResolver.supports (cognitive 24): clusterFaceResolver.supports has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15 (23 pts), 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":"d2renderers/internal/fontface/shaping.go"},"region":{"startLine":445}}}],"partialFingerprints":{"codehealthFindingId/v1":"b062f5d1fc769ef19d8be1c1dd0f729fa105eb5000b22d6a3d8cb385a5eb4943"}},{"ruleId":"D2","level":"warning","message":{"text":"testutil.inspectPDFImage (cognitive 24): testutil.inspectPDFImage has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 4, loops 2 (3 pts), match/switch 1 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth \u2014 many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/testutil/pdf.go"},"region":{"startLine":343}}}],"partialFingerprints":{"codehealthFindingId/v1":"cfb9baa7d30ba86a3932a97213bed65005e00f9275b537fd142d898d781306ec"}},{"ruleId":"D2","level":"warning","message":{"text":"testutil.ValidatePPTX (cognitive 24): testutil.ValidatePPTX has cognitive complexity 24 (threshold 15). Drivers by points: if/else 16 (22 pts), 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":"internal/testutil/pptx.go"},"region":{"startLine":18}}}],"partialFingerprints":{"codehealthFindingId/v1":"67356ca47e9e2bba76d251dc444dced5d2b4d80c63cd394f8b07e2b9818c3a02"}},{"ruleId":"D2","level":"warning","message":{"text":"paletteTree.nearestRGBA (cognitive 24): paletteTree.nearestRGBA has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 5, loops 2 (3 pts) (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":"lib/xgif/xgif.go"},"region":{"startLine":796}}}],"partialFingerprints":{"codehealthFindingId/v1":"fdebec65665f87d1b39fc349d4b8c649ac8795458160cd0f1172c6302d0ed548"}},{"ruleId":"D2","level":"warning","message":{"text":"d2cli.validateBoardOutputManifest (cognitive 23): d2cli.validateBoardOutputManifest has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 4 (5 pts), boolean chains 3 (nesting depth added 6). Of this number, 18 points are the body\u0027s own statements and 5 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2cli/board_output_publish.go"},"region":{"startLine":272}}}],"partialFingerprints":{"codehealthFindingId/v1":"aa9c3894eb28d247a7b958f4be8feb0e8c8cf0157c5825c9d7ec6c3f11714777"}},{"ruleId":"D2","level":"warning","message":{"text":"compiler.compileBoard (cognitive 23): compiler.compileBoard has cognitive complexity 23 (threshold 15). Drivers by points: if/else 18 (21 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2compiler/compile.go"},"region":{"startLine":145}}}],"partialFingerprints":{"codehealthFindingId/v1":"ef2036e7e7e7e7d65ccbbba44f97128cbde53cc2935cec7ae3d107fe2d951e33"}},{"ruleId":"D2","level":"warning","message":{"text":"compiler.overlayClasses (cognitive 23): compiler.overlayClasses has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ir/compile.go"},"region":{"startLine":215}}}],"partialFingerprints":{"codehealthFindingId/v1":"86283e2882e4b49e2d7492f1abf82be3eb3bd437f2c0f4b100206904f4ee1705"}},{"ruleId":"D2","level":"warning","message":{"text":"d2ir.canSelectImportNode (cognitive 23): d2ir.canSelectImportNode has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 3 (6 pts), boolean chains 3, match/switch 1 (nesting depth added 11). The drivers above price the dispatch low by construction \u2014 a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full \u2014 so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ir/import_cache.go"},"region":{"startLine":407}}}],"partialFingerprints":{"codehealthFindingId/v1":"9468b9d4a36f1e3ed5b6896480de912f117796d11e40300547f5552e0749f710"}},{"ruleId":"D2","level":"warning","message":{"text":"containerTopology.longestChainEndpoints (cognitive 23): containerTopology.longestChainEndpoints has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 5 (8 pts), 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":"d2layouts/d2dagrelayout/layout.go"},"region":{"startLine":507}}}],"partialFingerprints":{"codehealthFindingId/v1":"986f950b70ef7a1634f8cd141e36203c187e477cd932265bc55d30057aabc0d3"}},{"ruleId":"D2","level":"warning","message":{"text":"d2talalayout.validateResultEdge (cognitive 23): d2talalayout.validateResultEdge has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 2, boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/result_validate.go"},"region":{"startLine":510}}}],"partialFingerprints":{"codehealthFindingId/v1":"e573ebb26f2fb5aeffe2a07193c030033e4a4c9a8a0879c5504535084eac603d"}},{"ruleId":"D2","level":"warning","message":{"text":"pipeline.runAllStages (cognitive 23): pipeline.runAllStages has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (19 pts), 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/d2talalayout/internal/engine/pipeline.go"},"region":{"startLine":403}}}],"partialFingerprints":{"codehealthFindingId/v1":"be0d75463e0528c9232fa28dacd85ebe5b4b54413865135b1fa9c269ccba2147"}},{"ruleId":"D2","level":"warning","message":{"text":"hierarchy.medianNeighborsContext (cognitive 23): hierarchy.medianNeighborsContext has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 2 (4 pts) (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":"d2layouts/d2talalayout/internal/hierarchy/brandes_kopf.go"},"region":{"startLine":407}}}],"partialFingerprints":{"codehealthFindingId/v1":"80504136be701c6fedf5da08a82f14dfef71b9a7600515ed42a09e67ce790ac3"}},{"ruleId":"D2","level":"warning","message":{"text":"rankProblem.makeResult (cognitive 23): rankProblem.makeResult has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 3, boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/hierarchy/rank.go"},"region":{"startLine":100}}}],"partialFingerprints":{"codehealthFindingId/v1":"c1a903757f28d6654c6eb16a9c273f4a4f77730fa813cd933be33dc117d88b6c"}},{"ruleId":"D2","level":"warning","message":{"text":"placement.compaction (cognitive 23): placement.compaction has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 2, loops 2 (nesting depth added 4). Of this number, 22 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: 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":"d2layouts/d2talalayout/internal/placement/compaction.go"},"region":{"startLine":32}}}],"partialFingerprints":{"codehealthFindingId/v1":"215ce3d477bc55e0ac16043521627474acd6e9b7096ac277862565f8f55ae07a"}},{"ruleId":"D2","level":"warning","message":{"text":"placement.newSizelessOptimizer (cognitive 23): placement.newSizelessOptimizer has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 2, loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/sizeless_optimizer.go"},"region":{"startLine":29}}}],"partialFingerprints":{"codehealthFindingId/v1":"bf8523c579eb08526f8372acc8b25ad864cf6e3f0e00c4b8e8a18235df4761a0"}},{"ruleId":"D2","level":"warning","message":{"text":"sizelessOptimizer.moveNodeToBestGuarded (cognitive 23): sizelessOptimizer.moveNodeToBestGuarded has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 8). Of this number, 22 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/sizeless_optimizer.go"},"region":{"startLine":403}}}],"partialFingerprints":{"codehealthFindingId/v1":"3001e2dd13600efe65e89777b181d61558f6774ca5c139725d3d49ed264a3eb8"}},{"ruleId":"D2","level":"warning","message":{"text":"ovgEdgeRouter.slingshot (cognitive 23): ovgEdgeRouter.slingshot has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 3, loops 1 (nesting depth added 4). Of this number, 14 points are the body\u0027s own statements and 9 belong to one function literal inside it that branches. To reduce it, 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":"d2layouts/d2talalayout/internal/routing/slingshot.go"},"region":{"startLine":566}}}],"partialFingerprints":{"codehealthFindingId/v1":"3fe6adb4ba8b8dc7944187de0db9679c3a8041c55c5a3e084905c9d80522e784"}},{"ruleId":"D2","level":"warning","message":{"text":"trees.reconnectTreeGuarded (cognitive 23): trees.reconnectTreeGuarded has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 2 (3 pts), 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":"d2layouts/d2talalayout/internal/trees/preprocess_helpers.go"},"region":{"startLine":578}}}],"partialFingerprints":{"codehealthFindingId/v1":"69284831a588348a24164c8d736f6d5716c6b7d1a3b5e43c1b4c0628951e20ff"}},{"ruleId":"D2","level":"warning","message":{"text":"d2isometricimg.nativeArrowOverlap (cognitive 23): d2isometricimg.nativeArrowOverlap has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (16 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 14). Of this number, 20 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":"d2renderers/d2isometric/d2isometricimg/arrow_visibility.go"},"region":{"startLine":285}}}],"partialFingerprints":{"codehealthFindingId/v1":"8b1c0f6c3162910b394539336b0aa361115e993a339f2a10b924e39b49ee2716"}},{"ruleId":"D2","level":"warning","message":{"text":"meshBuilder.classicInkFace (cognitive 23): meshBuilder.classicInkFace has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 5 (7 pts), boolean chains 1 (nesting depth added 8). Of this number, 16 points are the body\u0027s own statements and 7 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/native_edges.go"},"region":{"startLine":594}}}],"partialFingerprints":{"codehealthFindingId/v1":"972ffd837499bd1758d3a028d59056d803fe5f1f32288c83caef13a213710806"}},{"ruleId":"D2","level":"warning","message":{"text":"d2raster.planBandResources (cognitive 23): d2raster.planBandResources has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (21 pts), 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":"d2renderers/d2raster/bands.go"},"region":{"startLine":120}}}],"partialFingerprints":{"codehealthFindingId/v1":"925c0de07e7e7eb639d81491be0f7b3bf44897e998a3caf7a5db26cb2f076461"}},{"ruleId":"D2","level":"warning","message":{"text":"d2raster.renderFilteredEffectNode (cognitive 23): d2raster.renderFilteredEffectNode has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 2, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/effects.go"},"region":{"startLine":718}}}],"partialFingerprints":{"codehealthFindingId/v1":"9333b5c92b3aacef747ff942966438f70c2c1ba726e54df5e61b354c61cdc564"}},{"ruleId":"D2","level":"warning","message":{"text":"d2raster.regionalFilters (cognitive 23): d2raster.regionalFilters has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 2 (3 pts) (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/d2raster/filter.go"},"region":{"startLine":318}}}],"partialFingerprints":{"codehealthFindingId/v1":"a001a301d9ef35643ec088519d7c3a2c3540a18ca797a3ede1b1e7932bc0c572"}},{"ruleId":"D2","level":"warning","message":{"text":"d2raster.drawRadialGradientCoverage (cognitive 23): d2raster.drawRadialGradientCoverage has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 2, loops 1 (nesting depth added 10). None of this is in the body itself: all 23 points belong to one function literal inside it that branches (line 935). 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":"d2renderers/d2raster/gradient.go"},"region":{"startLine":934}}}],"partialFingerprints":{"codehealthFindingId/v1":"7d4843e62b72af644a436c6dd71f36929b8a7a0d7b61f2fccbe8d56b0006b357"}},{"ruleId":"D2","level":"warning","message":{"text":"d2raster.bilinearPremultiplied (cognitive 23): d2raster.bilinearPremultiplied has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (17 pts), loops 3 (5 pts), 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":"d2renderers/d2raster/image.go"},"region":{"startLine":1089}}}],"partialFingerprints":{"codehealthFindingId/v1":"f5d5b24c5dd33c083af7738b93b691481f43cb7fd395676089d1121650644d6a"}},{"ruleId":"D2","level":"warning","message":{"text":"d2raster.prepareAnimatedStrokeWithPaint (cognitive 23): d2raster.prepareAnimatedStrokeWithPaint has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 4, match/switch 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/raster.go"},"region":{"startLine":1475}}}],"partialFingerprints":{"codehealthFindingId/v1":"78c8dd08389e8a24813443ce0b59fa6de247375047f8177c025ac397deaf637f"}},{"ruleId":"D2","level":"warning","message":{"text":"d2scenebuild.validateShapeEffectIntegerBounds (cognitive 23): d2scenebuild.validateShapeEffectIntegerBounds has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 2, loops 1 (nesting depth added 8). Of this number, 20 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":"d2renderers/d2scenebuild/shape_effects.go"},"region":{"startLine":202}}}],"partialFingerprints":{"codehealthFindingId/v1":"c7ce2ddd63840fa8acbd5fa4d472837fc0754bada793c77a8af9d6ae3b11f89f"}},{"ruleId":"D2","level":"warning","message":{"text":"d2scenebuild.sketchStreakRoot (cognitive 23): d2scenebuild.sketchStreakRoot has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 3, boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/sketch_shapes.go"},"region":{"startLine":866}}}],"partialFingerprints":{"codehealthFindingId/v1":"0457b6154ae063070389264e1d1adadebf8f28066bbc1d8d128b0c5522be67e8"}},{"ruleId":"D2","level":"warning","message":{"text":"builder.buildSketchTypedShapePaths (cognitive 23): builder.buildSketchTypedShapePaths has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 3 (4 pts) (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":"d2renderers/d2scenebuild/sketch_shapes.go"},"region":{"startLine":241}}}],"partialFingerprints":{"codehealthFindingId/v1":"23525ea2c3f51195c004d5cbcc956c6a7b94c19dbac7ffae1707bbe10b52fc69"}},{"ruleId":"D2","level":"warning","message":{"text":"legendLayout.expandViewBox (cognitive 23): legendLayout.expandViewBox has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15 (21 pts), 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":"d2renderers/d2scenebuild/legend.go"},"region":{"startLine":293}}}],"partialFingerprints":{"codehealthFindingId/v1":"92a7c1dc6205cc5badec9846949a01337986c04ce21a225bda4da8928272bcab"}},{"ruleId":"D2","level":"warning","message":{"text":"d2sketch.compileRoughOperationSet (cognitive 23): d2sketch.compileRoughOperationSet has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (20 pts), match/switch 1 (2 pts), 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":"d2renderers/d2sketch/scene.go"},"region":{"startLine":117}}}],"partialFingerprints":{"codehealthFindingId/v1":"236555b7fe1adb7479f5be4c845b815b718d98877fcf33d9c44c2e65516fd80a"}},{"ruleId":"D2","level":"warning","message":{"text":"d2svgimport.inspectEmbeddedWebP (cognitive 23): d2svgimport.inspectEmbeddedWebP has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 4, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svgimport/image.go"},"region":{"startLine":583}}}],"partialFingerprints":{"codehealthFindingId/v1":"9b65a3da8a9328d70f8b0ab3d028b31bc9fd2b6feccf36218a8e26142f7877f2"}},{"ruleId":"D2","level":"warning","message":{"text":"Resolver.resolveOne (cognitive 23): Resolver.resolveOne has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 1, match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/imageasset/resolve.go"},"region":{"startLine":134}}}],"partialFingerprints":{"codehealthFindingId/v1":"7218f27adf202e11d99666fdc1ff08fea2919b6e66a35b65a9c692fee87ce539"}},{"ruleId":"D2","level":"warning","message":{"text":"markdownPainter.flowUnits (cognitive 23): markdownPainter.flowUnits has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 5, loops 1 (nesting depth added 9). Of this number, 21 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/textmeasure/markdown_svg.go"},"region":{"startLine":681}}}],"partialFingerprints":{"codehealthFindingId/v1":"88e0a8641e17fc25579a59d958d4c0e2741ef80a73c71bf77d9a6ec1f4a39e24"}},{"ruleId":"D2","level":"warning","message":{"text":"overlay.prepare (cognitive 23): overlay.prepare has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 6 (8 pts) (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":"ci/nonlayout-perf/overlay.py"},"region":{"startLine":24}}}],"partialFingerprints":{"codehealthFindingId/v1":"0779dd9bd0f99233821f476d530abc1faec393003fa500fe0eadcf37424bf679"}},{"ruleId":"D2","level":"warning","message":{"text":"d2cli.indexPagedBoards (cognitive 22): d2cli.indexPagedBoards has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (19 pts), loops 2 (3 pts) (nesting depth added 7). Most of this is not in the body itself: 3 of the 22 points are its own statements and the rest belongs to one function literal inside it that branches (line 355). 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":"d2cli/paged.go"},"region":{"startLine":344}}}],"partialFingerprints":{"codehealthFindingId/v1":"766307216f2ed1145142a88e48a6042aeed5dffa07d1a2ea0a3c0cf1176e98dd"}},{"ruleId":"D2","level":"warning","message":{"text":"d2cli.addPPTXLinks (cognitive 22): d2cli.addPPTXLinks has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 2, match/switch 1 (2 pts), 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":"d2cli/paged.go"},"region":{"startLine":631}}}],"partialFingerprints":{"codehealthFindingId/v1":"0e335394bd6496758a0ef39890c5d49010a182c3298676b63e9d23159d0b0ad5"}},{"ruleId":"D2","level":"warning","message":{"text":"compiler.compileLegend (cognitive 22): compiler.compileLegend has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 5, loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2compiler/compile.go"},"region":{"startLine":256}}}],"partialFingerprints":{"codehealthFindingId/v1":"a5490d0bcd0f43ffb530120e610cc865736d1e88a0763608dc1cded84b7fe239"}},{"ruleId":"D2","level":"warning","message":{"text":"d2graph.addSQLTableColumnIndices (cognitive 22): d2graph.addSQLTableColumnIndices has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (6 pts) (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":1348}}}],"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 16 (18 pts), 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":387}}}],"partialFingerprints":{"codehealthFindingId/v1":"c1965a7246c189ef4f5377fc0da3b399cd842ba5b0476a506c91ef89ebbe04c0"}},{"ruleId":"D2","level":"warning","message":{"text":"compiler.ampersandFilterMap (cognitive 22): compiler.ampersandFilterMap has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (19 pts), match/switch 1 (2 pts), 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":934}}}],"partialFingerprints":{"codehealthFindingId/v1":"d0418ea410023b19d953af8a734de984824470984fb0bf3943f942bb1767bbd9"}},{"ruleId":"D2","level":"warning","message":{"text":"sequenceDiagram.routeMessages (cognitive 22): sequenceDiagram.routeMessages has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 4 (7 pts), 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":590}}}],"partialFingerprints":{"codehealthFindingId/v1":"0e6c6f30860f50a178fe3af5f6449da7fb85d03686f5ff7f3c630d8ef6228b09"}},{"ruleId":"D2","level":"warning","message":{"text":"hierarchy.createAlignmentNodes (cognitive 22): hierarchy.createAlignmentNodes has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 3 (4 pts), 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":"d2layouts/d2talalayout/internal/hierarchy/brandes_kopf.go"},"region":{"startLine":223}}}],"partialFingerprints":{"codehealthFindingId/v1":"eaed73bec9d5769eabecccb9911e886a3915cabd276838dc940cb538aa78322f"}},{"ruleId":"D2","level":"warning","message":{"text":"hierarchy.isEligibleContainer (cognitive 22): hierarchy.isEligibleContainer has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 3, loops 2 (3 pts) (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/d2talalayout/internal/hierarchy/eligibility.go"},"region":{"startLine":51}}}],"partialFingerprints":{"codehealthFindingId/v1":"a90f16456f0698e51df0b34c0f946204d70a97c23bd979f493f930ea2d6b4293"}},{"ruleId":"D2","level":"warning","message":{"text":"graphCloneState.copyAbductions (cognitive 22): graphCloneState.copyAbductions has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 3, boolean chains 1 (nesting depth added 9). Most of this is not in the body itself: 6 of the 22 points are its own statements and the rest belongs to one function literal inside it that branches (line 487). 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/d2talalayout/internal/layoutgraph/clone.go"},"region":{"startLine":486}}}],"partialFingerprints":{"codehealthFindingId/v1":"20c2bee3d81fb6de86c08fbc0225b6572a51f4b7b086922bce155a24235e95ea"}},{"ruleId":"D2","level":"warning","message":{"text":"Graph.containerPadding (cognitive 22): Graph.containerPadding has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 3, loops 1 (2 pts), match/switch 1 (2 pts) (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/d2talalayout/internal/layoutgraph/graph.go"},"region":{"startLine":1168}}}],"partialFingerprints":{"codehealthFindingId/v1":"cee49b21b629cd236780007131ef1dd405d285812ffb680c08f0056ae6cdcf63"}},{"ruleId":"D2","level":"warning","message":{"text":"placement.visibilityEdges (cognitive 22): placement.visibilityEdges has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 2 (3 pts) (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":"d2layouts/d2talalayout/internal/placement/compaction.go"},"region":{"startLine":427}}}],"partialFingerprints":{"codehealthFindingId/v1":"0b1ee5a0e336de57c6247352848dfc5fa3509647fca50a3ae1e3af86336e5b74"}},{"ruleId":"D2","level":"warning","message":{"text":"placement.direct (cognitive 22): placement.direct has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 4, loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/direct.go"},"region":{"startLine":270}}}],"partialFingerprints":{"codehealthFindingId/v1":"7b0e09d0bc5631928d9f3449d8287987f7a4c55aa86e79c08c4691448ba24143"}},{"ruleId":"D2","level":"warning","message":{"text":"placement.isBetween (cognitive 22): placement.isBetween has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (22 pts) (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/d2talalayout/internal/placement/gapreduction.go"},"region":{"startLine":92}}}],"partialFingerprints":{"codehealthFindingId/v1":"1436477e6d1d36fe990220307de5527e71bcb766606cec3cdc721384a483eb39"}},{"ruleId":"D2","level":"warning","message":{"text":"placementcost.GraphEdgeCrossings (cognitive 22): placementcost.GraphEdgeCrossings has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 2, boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placementcost/graph.go"},"region":{"startLine":301}}}],"partialFingerprints":{"codehealthFindingId/v1":"ac999807a0d8cd0bc4560ea1ba02f56ff51e67f735cbe3fb0c47e8219faf1b68"}},{"ruleId":"D2","level":"warning","message":{"text":"placementcost.obstructed (cognitive 22): placementcost.obstructed has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 6, loops 1 (nesting depth added 7). Most of this is not in the body itself: 2 of the 22 points are its own statements and the rest belongs to one function literal inside it that branches (line 516). 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/d2talalayout/internal/placementcost/symmetry.go"},"region":{"startLine":514}}}],"partialFingerprints":{"codehealthFindingId/v1":"2d97e00a3cb8e98fb9a00e773567edb0bf3583c3baaa06ce2be3716f5f3ca5f2"}},{"ruleId":"D2","level":"warning","message":{"text":"quality.evaluateWithAreaLimit (cognitive 22): quality.evaluateWithAreaLimit has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 2 (3 pts), 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":"d2layouts/d2talalayout/internal/quality/scoring.go"},"region":{"startLine":21}}}],"partialFingerprints":{"codehealthFindingId/v1":"5d134d9791126f8a8c377d575ffa398ff6fe5d9c3b149a6e842aee57f49a01bc"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.refineEdgeGuarded (cognitive 22): routing.refineEdgeGuarded has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (20 pts), 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":"d2layouts/d2talalayout/internal/routing/swap_ports.go"},"region":{"startLine":248}}}],"partialFingerprints":{"codehealthFindingId/v1":"811da37ba894d5798319042a6ddd903af8566f7a1bdac2a18a3a394fe6507112"}},{"ruleId":"D2","level":"warning","message":{"text":"OVG.mergePorts (cognitive 22): OVG.mergePorts has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 3 (7 pts) (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":"d2layouts/d2talalayout/internal/routing/ovg.go"},"region":{"startLine":1705}}}],"partialFingerprints":{"codehealthFindingId/v1":"e10ea5c81997d8cfe890bd12455a8d28eed50a32515d5bff19e214a32620a126"}},{"ruleId":"D2","level":"warning","message":{"text":"routeWorkGuard.add (cognitive 22): routeWorkGuard.add has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (17 pts), 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":"d2layouts/d2talalayout/internal/routing/route_stage_guard.go"},"region":{"startLine":61}}}],"partialFingerprints":{"codehealthFindingId/v1":"208e8587a21c01ee4e35445825d37d8bc96367e1bacf54fa1edf0db14b9d0b62"}},{"ruleId":"D2","level":"warning","message":{"text":"trees.validateBottomOrientation (cognitive 22): trees.validateBottomOrientation has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 2 (3 pts), 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":"d2layouts/d2talalayout/internal/trees/geometry.go"},"region":{"startLine":251}}}],"partialFingerprints":{"codehealthFindingId/v1":"b019d75fa17038a49227ec773342fa4727f5689a9462ca0e2d500392050b49dd"}},{"ruleId":"D2","level":"warning","message":{"text":"trees.spaceChildrenEvenly (cognitive 22): trees.spaceChildrenEvenly has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (19 pts), 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":"d2layouts/d2talalayout/internal/trees/geometry.go"},"region":{"startLine":409}}}],"partialFingerprints":{"codehealthFindingId/v1":"2311b14ab2e8ee2e6eb00cb3a13a7cffcbeb491c889a97083b2d9f67bc68af4e"}},{"ruleId":"D2","level":"warning","message":{"text":"d2oracle.deleteObjField (cognitive 22): d2oracle.deleteObjField has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (17 pts), 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":1476}}}],"partialFingerprints":{"codehealthFindingId/v1":"d6975d3bbe70ab42fc7c39870fc42b07e103480768caf16bc6977245acc03a7e"}},{"ruleId":"D2","level":"warning","message":{"text":"parser.parseArray (cognitive 22): parser.parseArray has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 2 (3 pts), match/switch 1 (2 pts), 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":1603}}}],"partialFingerprints":{"codehealthFindingId/v1":"58d190702f50d0318a120bbacd69a9b9297460df0f75cbcb44394e472d6c1895"}},{"ruleId":"D2","level":"warning","message":{"text":"asciishapes.DrawDocument (cognitive 22): asciishapes.DrawDocument has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 5, loops 3 (4 pts) (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":"d2fonts.init (cognitive 22): d2fonts.init has cognitive complexity 22 (threshold 15). Drivers by points: if/else 22. 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/d2fonts/d2fonts_embed_wasm.go"},"region":{"startLine":50}}}],"partialFingerprints":{"codehealthFindingId/v1":"a8495d23863ef4cfbc166d9a4cfa498ca6ccab312360656584adb5ebae029068"}},{"ruleId":"D2","level":"warning","message":{"text":"d2isometricimg.nativeUprightContact (cognitive 22): d2isometricimg.nativeUprightContact has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 4, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/solid_contacts.go"},"region":{"startLine":151}}}],"partialFingerprints":{"codehealthFindingId/v1":"c3290d21862ec9a7f3c5baf8e0eac99762458cda40a82a91f3ffac7e8faeee01"}},{"ruleId":"D2","level":"warning","message":{"text":"Raster.rasterPrepareOpacityGroups (cognitive 22): Raster.rasterPrepareOpacityGroups has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 4 (5 pts), boolean chains 3 (nesting depth added 6). Of this number, 16 points are the body\u0027s own statements and 6 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into 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/d2isometric/d2isometricimg/opacity_groups.go"},"region":{"startLine":60}}}],"partialFingerprints":{"codehealthFindingId/v1":"f6d1ba570c5f2ef28d94c4ea1359049b12f698ffd0132407bdfe8a0aed9d9ed6"}},{"ruleId":"D2","level":"warning","message":{"text":"surfaceIconPainter.texture (cognitive 22): surfaceIconPainter.texture has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 5, loops 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth \u2014 many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/surface_icons.go"},"region":{"startLine":130}}}],"partialFingerprints":{"codehealthFindingId/v1":"52de383807094baddc24d1112e4fdccaa55a080f9618be3e95b94e163a9f744c"}},{"ruleId":"D2","level":"warning","message":{"text":"svgVisibleFragmentSet.changeCells (cognitive 22): svgVisibleFragmentSet.changeCells has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (19 pts), loops 2 (3 pts) (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":"d2renderers/d2isometric/d2isometricimg/svg_fragments.go"},"region":{"startLine":41}}}],"partialFingerprints":{"codehealthFindingId/v1":"ede1172230d59c4f43365300273df9d396991eb65fca5ceeffdf155dd4bed16f"}},{"ruleId":"D2","level":"warning","message":{"text":"d2raster.drawPaintMaskPixels (cognitive 22): d2raster.drawPaintMaskPixels has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/gradient.go"},"region":{"startLine":1092}}}],"partialFingerprints":{"codehealthFindingId/v1":"0380571dba8dbdcd70ac5836e544475ab87bf6eab101afca31c58c193f115b43"}},{"ruleId":"D2","level":"warning","message":{"text":"Rasterizer.prepareScanEdges (cognitive 22): Rasterizer.prepareScanEdges has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/internal/scanline/rasterizer.go"},"region":{"startLine":1095}}}],"partialFingerprints":{"codehealthFindingId/v1":"bdade0606030671cb51d29d1feed1c9d0eb0bbc4601ed1cdda8ede656cf28e43"}},{"ruleId":"D2","level":"warning","message":{"text":"d2scenebuild.Build (cognitive 22): d2scenebuild.Build has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16 (18 pts), boolean chains 3, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/build.go"},"region":{"startLine":165}}}],"partialFingerprints":{"codehealthFindingId/v1":"2f71965d4422ea24da2ea1c974d37ce2809bec60dbff361a60f0f085de113547"}},{"ruleId":"D2","level":"warning","message":{"text":"d2svgimport.containsASCIIEqualFold (cognitive 22): d2svgimport.containsASCIIEqualFold has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 2 (3 pts), 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":"d2renderers/d2svgimport/style.go"},"region":{"startLine":222}}}],"partialFingerprints":{"codehealthFindingId/v1":"7e0a8d48ef4e4fe24a13072e2a7a938ab2d595dc4e86e2dd932d3cc64617f032"}},{"ruleId":"D2","level":"warning","message":{"text":"d2svgimport.paintWithOpacity (cognitive 22): d2svgimport.paintWithOpacity has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 2 (4 pts), match/switch 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svgimport/style.go"},"region":{"startLine":811}}}],"partialFingerprints":{"codehealthFindingId/v1":"1cd3041403327b04606bcb2fca6cde78a4ad57369aac021afefed3cb6120acfd"}},{"ruleId":"D2","level":"warning","message":{"text":"d2svgimport.transformFunction (cognitive 22): d2svgimport.transformFunction has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 3, 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":"d2renderers/d2svgimport/transform.go"},"region":{"startLine":247}}}],"partialFingerprints":{"codehealthFindingId/v1":"c07467967ad074929ee0c732401b83cda0fd0d09c69b7d9755b85df5e6852818"}},{"ruleId":"D2","level":"warning","message":{"text":"svgGeometry.primitive (cognitive 22): svgGeometry.primitive has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 7, match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svgimport/compile.go"},"region":{"startLine":597}}}],"partialFingerprints":{"codehealthFindingId/v1":"d3ca25ffb9d57fff737b8c47427dccf4602015d2b5d7bc3762c7bafecd501c1a"}},{"ruleId":"D2","level":"warning","message":{"text":"svgImporter.pointCommands (cognitive 22): svgImporter.pointCommands has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15 (20 pts), boolean chains 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svgimport/geometry.go"},"region":{"startLine":195}}}],"partialFingerprints":{"codehealthFindingId/v1":"e8343245527a3eb7f8bcb2d2ce2a872a4eb01c14baa43672fa58952fdb0fa528"}},{"ruleId":"D2","level":"warning","message":{"text":"imgbundler.runResolverWorkersWithLimit (cognitive 22): imgbundler.runResolverWorkersWithLimit has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 4 (5 pts), match/switch 2 (4 pts) (nesting depth added 12). Of this number, 14 points are the body\u0027s own statements and 8 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/imgbundler/imgbundler.go"},"region":{"startLine":298}}}],"partialFingerprints":{"codehealthFindingId/v1":"d2df0599a4567b6a51ae6c55f8725d42697eb07d04d0721e48467634fd7edad1"}},{"ruleId":"D2","level":"warning","message":{"text":"textmeasure.normalizeMarkdownWhitespaceTree (cognitive 22): textmeasure.normalizeMarkdownWhitespaceTree has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 4 (7 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 9). Most of this is not in the body itself: 1 of the 22 points is its own statement and the rest belongs to 4 function literals inside it that branch (lines 266, 300, 257, \u2026). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals\u0027 work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/textmeasure/markdown.go"},"region":{"startLine":241}}}],"partialFingerprints":{"codehealthFindingId/v1":"5ffca08e356099b80211c7c52a96efa38fe32919e72d2654f361b1221c1f7315"}},{"ruleId":"D2","level":"warning","message":{"text":"upload-draft.upload (cognitive 22): upload-draft.upload has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 3, boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"ci/release/upload-draft.py"},"region":{"startLine":116}}}],"partialFingerprints":{"codehealthFindingId/v1":"885880e0ca218510c0c5277637aa87566e603b18761aa2384a7904437fd9fa30"}},{"ruleId":"D2","level":"warning","message":{"text":"init::onmessage (cognitive 22): init::onmessage has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (22 pts) (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/static/watch.js"},"region":{"startLine":18}}}],"partialFingerprints":{"codehealthFindingId/v1":"d1dc4885f92ab47bfe8de33d0f244f4ca959c910e370b2e83de04cf4dcfc0f1f"}},{"ruleId":"D2","level":"warning","message":{"text":"dslGenState.edge (cognitive 21): dslGenState.edge has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (19 pts), 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.mapPagedLinks (cognitive 21): d2cli.mapPagedLinks has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 3, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2cli/paged.go"},"region":{"startLine":273}}}],"partialFingerprints":{"codehealthFindingId/v1":"7e79fda6d24dd83b8acdf3282bcf322075a7f2a810ebbcd5438ad3c0084dc0fc"}},{"ruleId":"D2","level":"warning","message":{"text":"watcher.replaceWatchList (cognitive 21): watcher.replaceWatchList has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 4 (6 pts) (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":396}}}],"partialFingerprints":{"codehealthFindingId/v1":"0b8c97f4d1a0a903dfbb3425c7ddc3bd7462e1526cf24184788ca2136538a273"}},{"ruleId":"D2","level":"warning","message":{"text":"d2compiler.foldClassName (cognitive 21): d2compiler.foldClassName has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 4 (6 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2compiler/compile.go"},"region":{"startLine":612}}}],"partialFingerprints":{"codehealthFindingId/v1":"4b7247ba95e9ed75c8238de42742a889d24ff8eb8a8c2cc1f12e250d24c5ae55"}},{"ruleId":"D2","level":"warning","message":{"text":"compiler.validateEdges (cognitive 21): compiler.validateEdges has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 6, 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":"d2compiler/compile.go"},"region":{"startLine":1690}}}],"partialFingerprints":{"codehealthFindingId/v1":"1765ec72f7a78674ee9412781c5db0857e85c68ebf41ececa82167524ff1678c"}},{"ruleId":"D2","level":"warning","message":{"text":"d2exporter.toShape (cognitive 21): d2exporter.toShape has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14 (19 pts), 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 8 (17 pts), 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 9 (15 pts), boolean chains 4, loops 1 (2 pts) (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":878}}}],"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 11 (18 pts), 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":945}}}],"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 7 (14 pts), loops 2 (4 pts), 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":1608}}}],"partialFingerprints":{"codehealthFindingId/v1":"40b039cbf62b2101344ee51fb4ee22d70b8d7af29c0545bafe060284651d7894"}},{"ruleId":"D2","level":"warning","message":{"text":"d2ir.foldString (cognitive 21): d2ir.foldString has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 4 (6 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ir/d2ir.go"},"region":{"startLine":200}}}],"partialFingerprints":{"codehealthFindingId/v1":"87b07da61558b354c1f7964d880208d6180cb948df476d664f08892392beb98d"}},{"ruleId":"D2","level":"warning","message":{"text":"spatialIndex.query (cognitive 21): spatialIndex.query has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 4 (6 pts) (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/d2elklayout/spatial_index.go"},"region":{"startLine":119}}}],"partialFingerprints":{"codehealthFindingId/v1":"5ce88533613e71ed82628ae05b43a0449f1d015a30f75e98c026a23771c4b464"}},{"ruleId":"D2","level":"warning","message":{"text":"d2talalayout.allocateD2EntityIDs (cognitive 21): d2talalayout.allocateD2EntityIDs has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 3, boolean chains 1 (nesting depth added 8). Of this number, 20 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/adapter.go"},"region":{"startLine":52}}}],"partialFingerprints":{"codehealthFindingId/v1":"1f9a0340eaa4199bd8f4c8d02c7aa339b2e9a2dbdca327d5c0ab71601599659a"}},{"ruleId":"D2","level":"warning","message":{"text":"d2talalayout.validateD2GraphStructure (cognitive 21): d2talalayout.validateD2GraphStructure has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 4 (5 pts), 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":"d2layouts/d2talalayout/adapter_validate.go"},"region":{"startLine":330}}}],"partialFingerprints":{"codehealthFindingId/v1":"7db0236edc91700018e83262ab6da040fdc273b25f81bee34570603289d694c6"}},{"ruleId":"D2","level":"warning","message":{"text":"grouping.abductClusterEdges (cognitive 21): grouping.abductClusterEdges has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 3 (7 pts) (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":"d2layouts/d2talalayout/internal/grouping/clusters.go"},"region":{"startLine":130}}}],"partialFingerprints":{"codehealthFindingId/v1":"1c0f7ea7b3f605422df6d0e3bf95019db7e76a177fe981ea72ea4f2369d6dce0"}},{"ruleId":"D2","level":"warning","message":{"text":"clusterDiscoveryIndex.sequenceOriginal (cognitive 21): clusterDiscoveryIndex.sequenceOriginal has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (15 pts), match/switch 1 (3 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/grouping/cluster_discovery.go"},"region":{"startLine":100}}}],"partialFingerprints":{"codehealthFindingId/v1":"f70f524470d6771aba4202de2b769b8fce83f4ef38a55aa93399d98ecda1548e"}},{"ruleId":"D2","level":"warning","message":{"text":"Edge.isAxisAligned (cognitive 21): Edge.isAxisAligned has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (19 pts), 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":"d2layouts/d2talalayout/internal/layoutgraph/edge.go"},"region":{"startLine":253}}}],"partialFingerprints":{"codehealthFindingId/v1":"565853fe23fe3b86529910bcea51615e702007c0d1997d0f96526de3b8493d0e"}},{"ruleId":"D2","level":"warning","message":{"text":"Transaction.Rollback (cognitive 21): Transaction.Rollback has cognitive complexity 21 (threshold 15). Drivers by points: loops 12 (20 pts), if/else 1 (nesting depth added 8). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/transaction.go"},"region":{"startLine":1352}}}],"partialFingerprints":{"codehealthFindingId/v1":"acb2a235477920a3c665b28f73f053f7cbb3b2b8bac9ef8e609a20478fd412b2"}},{"ruleId":"D2","level":"warning","message":{"text":"packing.routedContainerRoundedCornersStayInsideShrink (cognitive 21): packing.routedContainerRoundedCornersStayInsideShrink has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 4, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/packing/routed_container.go"},"region":{"startLine":271}}}],"partialFingerprints":{"codehealthFindingId/v1":"0702c8ef1b541c7e2f0f78597b7cdc37d31e85efcf8be3cfc11f066a8c197dcf"}},{"ruleId":"D2","level":"warning","message":{"text":"placement.clusterExternalConnectedNodes (cognitive 21): placement.clusterExternalConnectedNodes has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (14 pts), boolean chains 4, match/switch 1 (2 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/cluster_connections.go"},"region":{"startLine":9}}}],"partialFingerprints":{"codehealthFindingId/v1":"d82f33fac584de5b9f05a681ea27458bae0b9559ff14e5843973cb2400707df5"}},{"ruleId":"D2","level":"warning","message":{"text":"placementcost.clusterExactlyTwoExternalConnectedNodes (cognitive 21): placementcost.clusterExactlyTwoExternalConnectedNodes has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 6, match/switch 1 (2 pts), 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":"d2layouts/d2talalayout/internal/placementcost/cluster.go"},"region":{"startLine":5}}}],"partialFingerprints":{"codehealthFindingId/v1":"ce3f3e4b4d4f7e64b8d03254daeffa4c29ca27a03c122684a3d5ea208470db22"}},{"ruleId":"D2","level":"warning","message":{"text":"proximity.AddHubs (cognitive 21): proximity.AddHubs has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 2 (3 pts), 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/d2talalayout/internal/proximity/hubs.go"},"region":{"startLine":13}}}],"partialFingerprints":{"codehealthFindingId/v1":"4055499862b3660d4ccd8232ad4245a11cc56e1c03e8ef544f011e8db17de2e6"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.estimateRouteCostGuarded (cognitive 21): routing.estimateRouteCostGuarded has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 4 (7 pts) (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":"d2layouts/d2talalayout/internal/routing/cluster_route_guard.go"},"region":{"startLine":10}}}],"partialFingerprints":{"codehealthFindingId/v1":"68f3712074b3a432dbfaa8b17b9701b58b4f75008109c0f9f71cd6890b7cd3bb"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.undershot (cognitive 21): routing.undershot has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 8, match/switch 1 (nesting depth added 4). 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":"d2layouts/d2talalayout/internal/routing/slingshot.go"},"region":{"startLine":176}}}],"partialFingerprints":{"codehealthFindingId/v1":"da2b888c13062f9db993725c7ca854554dad2f3951aa47aa9d672565bbdeeb32"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.isOnFlightPlan (cognitive 21): routing.isOnFlightPlan has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 8, match/switch 1 (nesting depth added 4). 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":"d2layouts/d2talalayout/internal/routing/slingshot.go"},"region":{"startLine":289}}}],"partialFingerprints":{"codehealthFindingId/v1":"78c18f97177a7d07e4fedcaeddb8d551aebcb663126949ea0aab1eeb64d9d943"}},{"ruleId":"D2","level":"warning","message":{"text":"ovgEdgeRouter.findOverlappingRoutes (cognitive 21): ovgEdgeRouter.findOverlappingRoutes has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 3 (6 pts), 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":"d2layouts/d2talalayout/internal/routing/ovg_edge_router.go"},"region":{"startLine":1626}}}],"partialFingerprints":{"codehealthFindingId/v1":"6c784a0d60b3b636e79f1b713791986e8867eac29e0d3c9e1de3b4b0d075f689"}},{"ruleId":"D2","level":"warning","message":{"text":"d2oracle.getMostNestedRefs (cognitive 21): d2oracle.getMostNestedRefs has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (18 pts), 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":3280}}}],"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 5 (15 pts), loops 3 (4 pts), 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":"projectedExtent.preparedGroundShadows (cognitive 21): projectedExtent.preparedGroundShadows has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 5, loops 4 (5 pts) (nesting depth added 3). Most of this is not in the body itself: 8 of the 21 points are its own statements and the rest belongs to one function literal inside it that branches (line 90). 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":"d2renderers/d2isometric/d2isometricimg/framing.go"},"region":{"startLine":75}}}],"partialFingerprints":{"codehealthFindingId/v1":"83342e3f1e63265b43a1664527ef83f390fb02f3f64955ef83ceeca6b3fa0fbf"}},{"ruleId":"D2","level":"warning","message":{"text":"meshBuilder.nativeFaceLayer (cognitive 21): meshBuilder.nativeFaceLayer has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 4, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/native_shapes.go"},"region":{"startLine":191}}}],"partialFingerprints":{"codehealthFindingId/v1":"d51e10c34623605d8bf35ca0ac7ccf13b7508539733e99a9852a61d2d00615c3"}},{"ruleId":"D2","level":"warning","message":{"text":"meshBuilder.solidInkFit (cognitive 21): meshBuilder.solidInkFit has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 5 (9 pts) (nesting depth added 10). Of this number, 19 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/native_solids.go"},"region":{"startLine":115}}}],"partialFingerprints":{"codehealthFindingId/v1":"d29733d992bf8341055af3461af61491a7d84b39bac7d2a450ca8d911be1ac05"}},{"ruleId":"D2","level":"warning","message":{"text":"d2latex.ValidateInput (cognitive 21): d2latex.ValidateInput has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (17 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2latex/limits.go"},"region":{"startLine":21}}}],"partialFingerprints":{"codehealthFindingId/v1":"01c228adb4e8264b0fe501924d7c2f02af9304909a04f21cf052aca77bf36486"}},{"ruleId":"D2","level":"warning","message":{"text":"retainedVectorValidator.gradientCommon (cognitive 21): retainedVectorValidator.gradientCommon has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/vector_validation.go"},"region":{"startLine":716}}}],"partialFingerprints":{"codehealthFindingId/v1":"9614f795943a924abedad902c528edf94300574e22f2c5578ff906ad7549825e"}},{"ruleId":"D2","level":"warning","message":{"text":"builder.buildAppendix (cognitive 21): builder.buildAppendix has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 2 (3 pts), 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":"d2renderers/d2scenebuild/appendix.go"},"region":{"startLine":360}}}],"partialFingerprints":{"codehealthFindingId/v1":"2c5fe20aa457ec6bba6ff9749bd1dd514ae34c3c24ecd001493169e9282160d3"}},{"ruleId":"D2","level":"warning","message":{"text":"builder.resolveImageAsset (cognitive 21): builder.resolveImageAsset has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 1, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/assets.go"},"region":{"startLine":103}}}],"partialFingerprints":{"codehealthFindingId/v1":"adada42c7f8cf550149c41d6d8a2f88c7a41a7b4272d15938b0a1c78a29a803f"}},{"ruleId":"D2","level":"warning","message":{"text":"builder.ensureMissingGlyphFont (cognitive 21): builder.ensureMissingGlyphFont has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/font_fallback.go"},"region":{"startLine":741}}}],"partialFingerprints":{"codehealthFindingId/v1":"b52c0801d1653ffd614e9ec2b42d11b0a4b5076ad368b6f51fec76adb1a25f1c"}},{"ruleId":"D2","level":"warning","message":{"text":"builder.buildClassContents (cognitive 21): builder.buildClassContents has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (16 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/special_shapes.go"},"region":{"startLine":69}}}],"partialFingerprints":{"codehealthFindingId/v1":"6f70b30d5fec815c12b498a5c8f615a496283c174cbfa5becdce87a7799d4666"}},{"ruleId":"D2","level":"warning","message":{"text":"d2sketch.ConnectionWithAttributes (cognitive 21): d2sketch.ConnectionWithAttributes has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 3, loops 2 (3 pts) (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":348}}}],"partialFingerprints":{"codehealthFindingId/v1":"8463693b3b8d6eb911515d245a0afe3e216370a7eaf17eea9f3593eb9d1f1a65"}},{"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":3322}}}],"partialFingerprints":{"codehealthFindingId/v1":"c8b1b2221450ef0126b89a411a21f4c852a22f98c10662e1746c66ed8a10e0ce"}},{"ruleId":"D2","level":"warning","message":{"text":"svgImporter.validateDegenerateStrokeCaps (cognitive 21): svgImporter.validateDegenerateStrokeCaps has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 8, match/switch 1 (2 pts), loops 1 (nesting depth added 6). Of this number, 19 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svgimport/compile.go"},"region":{"startLine":193}}}],"partialFingerprints":{"codehealthFindingId/v1":"52f10ba9786aad927ec47541a775bedc30787fccdbcd6dcd06d313e3356cf25b"}},{"ruleId":"D2","level":"warning","message":{"text":"svgImporter.simpleClassSelector (cognitive 21): svgImporter.simpleClassSelector has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 4, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svgimport/stylesheet.go"},"region":{"startLine":153}}}],"partialFingerprints":{"codehealthFindingId/v1":"e78374361178e3466b756c2ae004d4e3cc1e703042f40f430b5f76a927997cb5"}},{"ruleId":"D2","level":"warning","message":{"text":"fontface.splitInputsByAssignedFace (cognitive 21): fontface.splitInputsByAssignedFace has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 3, loops 2 (3 pts) (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/internal/fontface/shaping.go"},"region":{"startLine":554}}}],"partialFingerprints":{"codehealthFindingId/v1":"b3798b5507c15d693554e7742332cca22853fab7bf05803d7943e9f19130f1b9"}},{"ruleId":"D2","level":"warning","message":{"text":"rasterimage.parseEXIFOrientation (cognitive 21): rasterimage.parseEXIFOrientation has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 4, loops 1, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/rasterimage/jpeg_orientation.go"},"region":{"startLine":69}}}],"partialFingerprints":{"codehealthFindingId/v1":"46d3b7464046759b2c5b9288315e3347ef468383ebce313948bb66cdab08a016"}},{"ruleId":"D2","level":"warning","message":{"text":"utf8FontFile.generateCharSymbolDictionary (cognitive 21): utf8FontFile.generateCharSymbolDictionary has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 6 (7 pts) (nesting depth added 10). 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":572}}}],"partialFingerprints":{"codehealthFindingId/v1":"aeb319ab572d468702e328f2a1fdbe2b403f05de3ff7bfc57770d26ddc8e0a2f"}},{"ruleId":"D2","level":"warning","message":{"text":"imageasset.decodeContentEncodings (cognitive 21): imageasset.decodeContentEncodings has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (18 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/imageasset/resolve.go"},"region":{"startLine":857}}}],"partialFingerprints":{"codehealthFindingId/v1":"febbca0bb442692bc16cc0de022993b02d2efcfd92fbe14306c469b2188a5bcb"}},{"ruleId":"D2","level":"warning","message":{"text":"textmeasure.collectMarkdownTableRows (cognitive 21): textmeasure.collectMarkdownTableRows has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 4, loops 3 (4 pts) (nesting depth added 7). None of this is in the body itself: all 21 points belong to 2 function literals inside it that branch (lines 1753, 1740). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals\u0027 work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/textmeasure/markdown_svg.go"},"region":{"startLine":1738}}}],"partialFingerprints":{"codehealthFindingId/v1":"31c973a54aec6f1a84a903ce7aec6f751d783dfe925b8f2ed4fad59d3832cec7"}},{"ruleId":"D2","level":"warning","message":{"text":"markdownPainter.paintTable (cognitive 21): markdownPainter.paintTable has cognitive complexity 21 (threshold 15). Drivers by points: loops 9 (12 pts), if/else 4 (9 pts) (nesting depth added 8). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/textmeasure/markdown_svg.go"},"region":{"startLine":1469}}}],"partialFingerprints":{"codehealthFindingId/v1":"afcb76df44d9899278658a6395db4fd7d83f495de676c33b81184fb1b96e4d20"}},{"ruleId":"D2","level":"warning","message":{"text":"main.verifyChecksums (cognitive 20): main.verifyChecksums has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 4, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"ci/release/releasetool/main.go"},"region":{"startLine":512}}}],"partialFingerprints":{"codehealthFindingId/v1":"17867179b3ade862d2089be1644622c44385c1223961b61cb0af4b05e9cadfa1"}},{"ruleId":"D2","level":"warning","message":{"text":"d2cli.renderGIFBoardFrames (cognitive 20): d2cli.renderGIFBoardFrames has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 1, loops 1 (nesting depth added 7). Of this number, 16 points are the body\u0027s own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into 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/raster.go"},"region":{"startLine":402}}}],"partialFingerprints":{"codehealthFindingId/v1":"4033fb9076829af65675e12123fefc076124b07e98b5559391de352b5d6f7972"}},{"ruleId":"D2","level":"warning","message":{"text":"boardOutputTransaction.rollback (cognitive 20): boardOutputTransaction.rollback has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 3, loops 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2cli/board_output_publish.go"},"region":{"startLine":918}}}],"partialFingerprints":{"codehealthFindingId/v1":"5ca277c56e63ee74d0c1cd77c1b10db0cf66773c2f404cf9703840b8ff6c707a"}},{"ruleId":"D2","level":"warning","message":{"text":"watcher.compileLoop (cognitive 20): watcher.compileLoop has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (17 pts), match/switch 1 (2 pts), 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":"d2cli/watch.go"},"region":{"startLine":433}}}],"partialFingerprints":{"codehealthFindingId/v1":"048ba0044afb1b4a5c5bbfbfc6c5df779b260ab0ca1f55aa5e9ff948b63ce27f"}},{"ruleId":"D2","level":"warning","message":{"text":"d2compiler.hasBoard (cognitive 20): d2compiler.hasBoard has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (6 pts), 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":1781}}}],"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 9 (11 pts), loops 4 (8 pts), 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":"compiler.compileKey (cognitive 20): compiler.compileKey has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 4, loops 2 (4 pts) (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":"d2ir/compile.go"},"region":{"startLine":1161}}}],"partialFingerprints":{"codehealthFindingId/v1":"ce0431e6d554cf9032077bbdae90c9e9b837f45ecc7d8e62b3c422104dbf0482"}},{"ruleId":"D2","level":"warning","message":{"text":"d2near.place (cognitive 20): d2near.place has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (18 pts), 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":"d2talalayout.coordinateLocalSeeds (cognitive 20): d2talalayout.coordinateLocalSeeds has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 4 (5 pts), boolean chains 2 (nesting depth added 5). Of this number, 18 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/layout.go"},"region":{"startLine":169}}}],"partialFingerprints":{"codehealthFindingId/v1":"7b24e700692ee80df08414dc474f6a9a7b0305cf111d942e2c5da9006c87d2df"}},{"ruleId":"D2","level":"warning","message":{"text":"labeling.clusterBoundaryNodePlacement (cognitive 20): labeling.clusterBoundaryNodePlacement has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (16 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/labeling/guard.go"},"region":{"startLine":295}}}],"partialFingerprints":{"codehealthFindingId/v1":"208b20acf8a9bfa525152ec9cb8256fa9f9105ec0f32cf07b0a177ce2011e5af"}},{"ruleId":"D2","level":"warning","message":{"text":"layoutgraph.segmentIntersectsBox (cognitive 20): layoutgraph.segmentIntersectsBox has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 11, if/else 9. Of this number, 16 points are the body\u0027s own statements and 4 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/node.go"},"region":{"startLine":1408}}}],"partialFingerprints":{"codehealthFindingId/v1":"7a41465c3a77d603848fcc78b8679cd1f8049c652518aac1c3b388d49e53dd4c"}},{"ruleId":"D2","level":"warning","message":{"text":"graphCloneState.copyContainers (cognitive 20): graphCloneState.copyContainers has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 2 (3 pts), 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/d2talalayout/internal/layoutgraph/clone.go"},"region":{"startLine":305}}}],"partialFingerprints":{"codehealthFindingId/v1":"1438aa389b5c5d0de275a9327178992062029b1c34df65c816b39998ad11d8f0"}},{"ruleId":"D2","level":"warning","message":{"text":"Edge.stylesMatchOneWay (cognitive 20): Edge.stylesMatchOneWay has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 5 (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/d2talalayout/internal/layoutgraph/edge.go"},"region":{"startLine":51}}}],"partialFingerprints":{"codehealthFindingId/v1":"6ea1779258ff2aa1d34e59ceb9272bc7b08d4aa1bd653155cba97941a6fc9aca"}},{"ruleId":"D2","level":"warning","message":{"text":"placement.gapNormalization (cognitive 20): placement.gapNormalization has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 1 (nesting depth added 8). Of this number, 19 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/gapreduction.go"},"region":{"startLine":30}}}],"partialFingerprints":{"codehealthFindingId/v1":"18cb3a0ffe1a5bf6eb85b16c655f98799e7675118eaf29643e7ebc55a55ea644"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.channelPointProposal (cognitive 20): routing.channelPointProposal has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 3 (6 pts), 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":"d2layouts/d2talalayout/internal/routing/nudge_channels.go"},"region":{"startLine":558}}}],"partialFingerprints":{"codehealthFindingId/v1":"027fdc5191535f5dd8e5611708f557b4bfabe54692b64bb2c93e31d2ee6e90f2"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.balancePortInteriorsGuarded (cognitive 20): routing.balancePortInteriorsGuarded has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 2, 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":"d2layouts/d2talalayout/internal/routing/port_interior_balance.go"},"region":{"startLine":18}}}],"partialFingerprints":{"codehealthFindingId/v1":"e33395b765a4ac22a1a4c0eb357e18c8ad6d8f9e04e269a4ffb35a649a480690"}},{"ruleId":"D2","level":"warning","message":{"text":"OVG.addHierarchyLevelNodes (cognitive 20): OVG.addHierarchyLevelNodes has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 4 (5 pts) (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/d2talalayout/internal/routing/ovg_hierarchy.go"},"region":{"startLine":152}}}],"partialFingerprints":{"codehealthFindingId/v1":"c6fa7053ac5d728a13d7998b6c890dd1310b237c4f35dae4d91246515ff05ee3"}},{"ruleId":"D2","level":"warning","message":{"text":"d2isometricimg.classicInkPaths (cognitive 20): d2isometricimg.classicInkPaths has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 6 (7 pts) (nesting depth added 8). Of this number, 13 points are the body\u0027s own statements and 7 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/native_edges.go"},"region":{"startLine":375}}}],"partialFingerprints":{"codehealthFindingId/v1":"fdf1e1838a1f158f5958ad09181135d876c7233d487d0faacf4421acbfc8def7"}},{"ruleId":"D2","level":"warning","message":{"text":"d2isometricimg.nativeEmbeddedAssetsOnly (cognitive 20): d2isometricimg.nativeEmbeddedAssetsOnly has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 4 (6 pts), boolean chains 1 (nesting depth added 8). Of this number, 18 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/surface_fonts.go"},"region":{"startLine":19}}}],"partialFingerprints":{"codehealthFindingId/v1":"785be27f2c35da44c9e0eea40c99343b79bb7223174f9daf5c9e41d54d02b9d9"}},{"ruleId":"D2","level":"warning","message":{"text":"d2isometricimg.nativeSurfaceSVG (cognitive 20): d2isometricimg.nativeSurfaceSVG has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/vector_surface_svg.go"},"region":{"startLine":36}}}],"partialFingerprints":{"codehealthFindingId/v1":"22562afb3a4afb349c04a26e45ea9be8d37bce5304d4759aaac88bba6f663b9a"}},{"ruleId":"D2","level":"warning","message":{"text":"Raster.Frame (cognitive 20): Raster.Frame has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 2 (3 pts), 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":"d2renderers/d2isometric/d2isometricimg/raster.go"},"region":{"startLine":260}}}],"partialFingerprints":{"codehealthFindingId/v1":"17a27612cf1476ccd553130db844f98cd0283be632f4bb8fbada571b26ac4606"}},{"ruleId":"D2","level":"warning","message":{"text":"d2raster.setBandReferenceBounds (cognitive 20): d2raster.setBandReferenceBounds has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/bands.go"},"region":{"startLine":180}}}],"partialFingerprints":{"codehealthFindingId/v1":"ae6853ce7d66300cc72d212781dc06f1c2899789a385b45f9124e484f0ea36ce"}},{"ruleId":"D2","level":"warning","message":{"text":"d2raster.planRenderResourcesRegion (cognitive 20): d2raster.planRenderResourcesRegion has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (19 pts), 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":"d2renderers/d2raster/effects.go"},"region":{"startLine":260}}}],"partialFingerprints":{"codehealthFindingId/v1":"5e00d6b5f18988eb35749b8a43a5f79e00c9da86a4ced490ae88b05883ee50b8"}},{"ruleId":"D2","level":"warning","message":{"text":"d2raster.effectRenderBounds (cognitive 20): d2raster.effectRenderBounds has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (16 pts), 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/d2raster/stroke_regions.go"},"region":{"startLine":15}}}],"partialFingerprints":{"codehealthFindingId/v1":"91f348b4df6801112b7d043705b8c40a2f89b43b16ecf7ca73b4a1bf3885e225"}},{"ruleId":"D2","level":"warning","message":{"text":"retainedVectorValidator.animations (cognitive 20): retainedVectorValidator.animations has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 2, match/switch 1 (2 pts), 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":"d2renderers/d2raster/vector_validation.go"},"region":{"startLine":231}}}],"partialFingerprints":{"codehealthFindingId/v1":"91685562ee4fff82a602bc007aede0fc74e50b406b9fd19c2b83054fc247b4d2"}},{"ruleId":"D2","level":"warning","message":{"text":"retainedVectorValidator.paint (cognitive 20): retainedVectorValidator.paint has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (19 pts), match/switch 1 (nesting depth added 10). The drivers above price the dispatch low by construction \u2014 a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full \u2014 so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/vector_validation.go"},"region":{"startLine":580}}}],"partialFingerprints":{"codehealthFindingId/v1":"6836e66764ada45825c1c58b833e99e64792ab2933cfad95953b3b20ca469a43"}},{"ruleId":"D2","level":"warning","message":{"text":"builder.buildSQLTableContents (cognitive 20): builder.buildSQLTableContents has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (17 pts), loops 2, boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/special_shapes.go"},"region":{"startLine":184}}}],"partialFingerprints":{"codehealthFindingId/v1":"32691d4d2b7c2f7c28a794c960459805feab62db85721df0503ba24fd8449a4f"}},{"ruleId":"D2","level":"warning","message":{"text":"svgImporter.viewport (cognitive 20): svgImporter.viewport has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 4, match/switch 1 (2 pts) (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":"d2renderers/d2svgimport/viewport.go"},"region":{"startLine":18}}}],"partialFingerprints":{"codehealthFindingId/v1":"b91cbd01249d03406e14b64be56f376a9119007dad5b197816729c190d478e2b"}},{"ruleId":"D2","level":"warning","message":{"text":"d2target.validateRenderBoard (cognitive 20): d2target.validateRenderBoard has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 4 (6 pts) (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":"d2target/render_validation.go"},"region":{"startLine":84}}}],"partialFingerprints":{"codehealthFindingId/v1":"a38153d76e46fe2fe0882a32ed53f8c294d8cc2e7c56f11270d1d02d1ea35cb2"}},{"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":"rasterimage.Config (cognitive 20): rasterimage.Config has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 1, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/rasterimage/firstframe.go"},"region":{"startLine":28}}}],"partialFingerprints":{"codehealthFindingId/v1":"cd6cac530acbaf8207899f88ac9488a14a63dcd998e9e49dd4224267c9f433f7"}},{"ruleId":"D2","level":"warning","message":{"text":"textmeasure.ReplaceSubstitutionsMarkdownBounded (cognitive 20): textmeasure.ReplaceSubstitutionsMarkdownBounded has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14 (17 pts), loops 2, boolean chains 1 (nesting depth added 3). Of this number, 12 points are the body\u0027s own statements and 8 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/textmeasure/substitutions.go"},"region":{"startLine":24}}}],"partialFingerprints":{"codehealthFindingId/v1":"f45920b46b2dfa18f58f118968408e327c2454697a2e874bdcb6093e57930517"}},{"ruleId":"D2","level":"warning","message":{"text":"fewOpaqueBucket.split (cognitive 20): fewOpaqueBucket.split has cognitive complexity 20 (threshold 15). Drivers by points: loops 6 (9 pts), if/else 5 (6 pts), boolean chains 4, match/switch 1 (nesting depth added 4). Of this number, 19 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, 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":"lib/xgif/xgif.go"},"region":{"startLine":246}}}],"partialFingerprints":{"codehealthFindingId/v1":"157cf78791f8f237f7e2b12f3481418820b2876ab4d970004aab8698dcb5d6b5"}},{"ruleId":"D2","level":"warning","message":{"text":"main.runCase (cognitive 19): main.runCase has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (17 pts), loops 1 (2 pts) (nesting depth added 5). Of this number, 18 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"ci/tala-performance/main.go"},"region":{"startLine":95}}}],"partialFingerprints":{"codehealthFindingId/v1":"d48d2808c7c0991e9e98add357a59a7775f41343c8d63d2e676bd2d2fcb71cad"}},{"ruleId":"D2","level":"warning","message":{"text":"d2cli.planBoardOutput (cognitive 19): d2cli.planBoardOutput has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 4 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2cli/board_output.go"},"region":{"startLine":160}}}],"partialFingerprints":{"codehealthFindingId/v1":"a8a4284498649f52a07a3040b23b72158e2780e946c55cce8cfb757c943b900d"}},{"ruleId":"D2","level":"warning","message":{"text":"d2cli.installBoardOutputFile (cognitive 19): d2cli.installBoardOutputFile has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (19 pts) (nesting depth added 6). Of this number, 18 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2cli/board_output_publish.go"},"region":{"startLine":642}}}],"partialFingerprints":{"codehealthFindingId/v1":"62b9a2c77ea33afe4078572efd75e1ac2dd0e59858f542f888482ba09f2bc1fd"}},{"ruleId":"D2","level":"warning","message":{"text":"d2cli.renderGIF (cognitive 19): d2cli.renderGIF has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14 (19 pts) (nesting depth added 5). Most of this is not in the body itself: 7 of the 19 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 484, 470). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals\u0027 work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2cli/raster.go"},"region":{"startLine":457}}}],"partialFingerprints":{"codehealthFindingId/v1":"033245556dbc577029c9979525e40461c782a0a5020e9d9e5a046b02a55f6821"}},{"ruleId":"D2","level":"warning","message":{"text":"boardOutputWorkspace.discard (cognitive 19): boardOutputWorkspace.discard has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 3, 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":"d2cli/board_output.go"},"region":{"startLine":348}}}],"partialFingerprints":{"codehealthFindingId/v1":"4a79e2043716c3f00c52f5b4480fbea6311c7544d250917725e217eaffb671db"}},{"ruleId":"D2","level":"warning","message":{"text":"printer.blockString (cognitive 19): printer.blockString has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (16 pts), 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 9 (12 pts), 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":1995}}}],"partialFingerprints":{"codehealthFindingId/v1":"16c8a0ebf1aad325cbd117a28f6b5c72d1d88c0ab54954acb0455f35a97b4ab0"}},{"ruleId":"D2","level":"warning","message":{"text":"d2talalayout.buildRoutePatch (cognitive 19): d2talalayout.buildRoutePatch has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 3 (nesting depth added 7). Of this number, 12 points are the body\u0027s own statements and 7 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/patch.go"},"region":{"startLine":241}}}],"partialFingerprints":{"codehealthFindingId/v1":"06381b7f85cd1b3c0af6aefacfec4744a4940361c725651d1e483025fcdd1ae0"}},{"ruleId":"D2","level":"warning","message":{"text":"grouping.clusterIncidentEdges (cognitive 19): grouping.clusterIncidentEdges has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 5 (7 pts) (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/d2talalayout/internal/grouping/cluster_discovery.go"},"region":{"startLine":377}}}],"partialFingerprints":{"codehealthFindingId/v1":"9f797724dbabb3b6f916eed0814b601ebf74de894c048730996181ef6b863ae1"}},{"ruleId":"D2","level":"warning","message":{"text":"joinPositionJournal.moveWithChildren (cognitive 19): joinPositionJournal.moveWithChildren has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/grouping/join.go"},"region":{"startLine":46}}}],"partialFingerprints":{"codehealthFindingId/v1":"2e548b96ad9dae6d32bbb10f2a3febfdbfbbe4296607b9cee06b908e680abd19"}},{"ruleId":"D2","level":"warning","message":{"text":"hierarchy.isValid (cognitive 19): hierarchy.isValid has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 4 (5 pts), boolean chains 4 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/hierarchy/discovery.go"},"region":{"startLine":249}}}],"partialFingerprints":{"codehealthFindingId/v1":"931b2fb9b0e05f742d6923d64552432ccb35867eecc5a570682be616b640aad8"}},{"ruleId":"D2","level":"warning","message":{"text":"hierarchy.makeSimpleDAG (cognitive 19): hierarchy.makeSimpleDAG has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (16 pts), 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":"d2layouts/d2talalayout/internal/hierarchy/discovery.go"},"region":{"startLine":502}}}],"partialFingerprints":{"codehealthFindingId/v1":"2483a1565da4014f72e22d19816e555d6a720b3ee6c74c7b496be26277aac05e"}},{"ruleId":"D2","level":"warning","message":{"text":"hierarchy.minimumDistanceToNextLevel (cognitive 19): hierarchy.minimumDistanceToNextLevel has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 2 (3 pts) (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":"d2layouts/d2talalayout/internal/hierarchy/placement.go"},"region":{"startLine":456}}}],"partialFingerprints":{"codehealthFindingId/v1":"5a7f8b92e8ab378b02e3a01e1375f2ad16c4cd20afa1f430ad8261b995cc0f0a"}},{"ruleId":"D2","level":"warning","message":{"text":"hierarchy.newRankSimplex (cognitive 19): hierarchy.newRankSimplex has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/hierarchy/rank_simplex.go"},"region":{"startLine":58}}}],"partialFingerprints":{"codehealthFindingId/v1":"569493bd16b519d753315a9b1a124f15e0c3b9c2fe15596bec7108f7abd4ba0a"}},{"ruleId":"D2","level":"warning","message":{"text":"rankSimplex.computeHeadComponent (cognitive 19): rankSimplex.computeHeadComponent has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 2 (3 pts), 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":"d2layouts/d2talalayout/internal/hierarchy/rank_simplex.go"},"region":{"startLine":456}}}],"partialFingerprints":{"codehealthFindingId/v1":"67526994a78763d49fd471355833dfa36125e5d6b2c4f2031fc3a93c99f97e99"}},{"ruleId":"D2","level":"warning","message":{"text":"layoutgraph.validateNodeParentRelation (cognitive 19): layoutgraph.validateNodeParentRelation has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/topology_preflight.go"},"region":{"startLine":61}}}],"partialFingerprints":{"codehealthFindingId/v1":"cc92a9c7089e5fb81286d10c01e5e850e869c3984bcb77239d5bd58d029dc4aa"}},{"ruleId":"D2","level":"warning","message":{"text":"Graph.syncNested (cognitive 19): Graph.syncNested has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (9 pts) (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":"d2layouts/d2talalayout/internal/layoutgraph/graph.go"},"region":{"startLine":918}}}],"partialFingerprints":{"codehealthFindingId/v1":"ba6afb16073534eab5dd77107fc76fffa67123645a4c761c9442646dbdfc3f95"}},{"ruleId":"D2","level":"warning","message":{"text":"Node.dfsWalk (cognitive 19): Node.dfsWalk has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (6 pts) (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/d2talalayout/internal/layoutgraph/node.go"},"region":{"startLine":2294}}}],"partialFingerprints":{"codehealthFindingId/v1":"3feba6a26e5a19994b18539441cbf1b5295bf4389a6f40f561047e5073c45c12"}},{"ruleId":"D2","level":"warning","message":{"text":"placement.hasFixedDescendant (cognitive 19): placement.hasFixedDescendant has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (6 pts) (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/d2talalayout/internal/placement/direct.go"},"region":{"startLine":140}}}],"partialFingerprints":{"codehealthFindingId/v1":"28fd23c4615c448b976241258eb75d50687e6085d8cee97c7d302dae29e39df8"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.preferLaunchingVertically (cognitive 19): routing.preferLaunchingVertically has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 2, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/slingshot.go"},"region":{"startLine":340}}}],"partialFingerprints":{"codehealthFindingId/v1":"de44e8f7de92a87c4b31b5d40dd6c2e535e979bb00bef51eff9db4ed55587940"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.makeStraightLineGuarded (cognitive 19): routing.makeStraightLineGuarded has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (3 pts) (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/d2talalayout/internal/routing/swap_ports.go"},"region":{"startLine":357}}}],"partialFingerprints":{"codehealthFindingId/v1":"3568137f96a67172ea1ec929e64d41c920117c201d6a1cf0fd63d76a1cb58a4d"}},{"ruleId":"D2","level":"warning","message":{"text":"ovgEdgeRouter.findLaunchings (cognitive 19): ovgEdgeRouter.findLaunchings has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 1, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (ovgEdgeRouter.findLandings) has the same decision points, in the same order, at the same nesting depths \u2014 so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/slingshot.go"},"region":{"startLine":80}}}],"partialFingerprints":{"codehealthFindingId/v1":"444ae8b976caa56718840c73523b59cdcce112a7c327ad792378d6b17447d311"}},{"ruleId":"D2","level":"warning","message":{"text":"ovgEdgeRouter.findLandings (cognitive 19): ovgEdgeRouter.findLandings has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 1, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (ovgEdgeRouter.findLaunchings) has the same decision points, in the same order, at the same nesting depths \u2014 so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/slingshot.go"},"region":{"startLine":128}}}],"partialFingerprints":{"codehealthFindingId/v1":"aa4d122af8a6dad71eb5d788f6ef2488593fb9dbc84044a811034d560a7b786a"}},{"ruleId":"D2","level":"warning","message":{"text":"d2Patch.apply (cognitive 19): d2Patch.apply has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (16 pts), 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":"d2layouts/d2talalayout/patch.go"},"region":{"startLine":119}}}],"partialFingerprints":{"codehealthFindingId/v1":"86d45c964c42e122c95c6efacc07d55d980b55c9cf17643153926d2bf8552930"}},{"ruleId":"D2","level":"warning","message":{"text":"d2oracle.Rename (cognitive 19): d2oracle.Rename has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (18 pts), 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":1699}}}],"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 7 (16 pts), 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 8 (14 pts), boolean chains 3, loops 1 (2 pts) (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":888}}}],"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 10 (17 pts), 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":945}}}],"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 7 (16 pts), match/switch 1 (2 pts), 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":1428}}}],"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 11 (16 pts), loops 1 (3 pts) (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. This shape REPEATS in the file: one other method here (asciiroute.adjustRouteEndPoint) has the same decision points, in the same order, at the same nesting depths \u2014 so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared."},"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 11 (16 pts), loops 1 (3 pts) (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. This shape REPEATS in the file: one other method here (asciiroute.adjustRouteStartPoint) has the same decision points, in the same order, at the same nesting depths \u2014 so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared."},"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 2 (3 pts), match/switch 1 (3 pts) (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 8 (11 pts), boolean chains 5, loops 2 (3 pts) (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 6 (8 pts), loops 2 (3 pts) (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":"d2isometricimg.nativeConnectionCaptionSurface (cognitive 19): d2isometricimg.nativeConnectionCaptionSurface has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 5, match/switch 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/route_caption_style.go"},"region":{"startLine":57}}}],"partialFingerprints":{"codehealthFindingId/v1":"d23722a7942e3902a0fe87776003abc14db6cda15396c03c4f75f7a0f7fe23d7"}},{"ruleId":"D2","level":"warning","message":{"text":"d2isometricimg.nativeEdgeRoutes (cognitive 19): d2isometricimg.nativeEdgeRoutes has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 4 (5 pts), 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":"d2renderers/d2isometric/d2isometricimg/sequence_routes.go"},"region":{"startLine":33}}}],"partialFingerprints":{"codehealthFindingId/v1":"18acf14f99fc026094a4ee461cc6aa00a943bd72a1c1020ac33e9f558568e8db"}},{"ruleId":"D2","level":"warning","message":{"text":"svgVisibleFragmentSet.query (cognitive 19): svgVisibleFragmentSet.query has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (6 pts) (nesting depth added 9). Of this number, 13 points are the body\u0027s own statements and 6 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into 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/d2isometric/d2isometricimg/svg_fragments.go"},"region":{"startLine":103}}}],"partialFingerprints":{"codehealthFindingId/v1":"885d3881965e75e0b8fec4b442add0410e33509682f94bcb66c6802d184c48ce"}},{"ruleId":"D2","level":"warning","message":{"text":"d2raster.renderEffectNode (cognitive 19): d2raster.renderEffectNode has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/effects.go"},"region":{"startLine":675}}}],"partialFingerprints":{"codehealthFindingId/v1":"955a7f9e48cd896d3f11d0d9b48c5960bb0bfbcf939f9d8c4097be82fd441608"}},{"ruleId":"D2","level":"warning","message":{"text":"d2raster.spreadParameter (cognitive 19): d2raster.spreadParameter has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (16 pts), 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":"d2renderers/d2raster/gradient.go"},"region":{"startLine":439}}}],"partialFingerprints":{"codehealthFindingId/v1":"51cc7e2b8fad56d8927ac8b030e26b9070adea03e530cbe287ae89d106de360d"}},{"ruleId":"D2","level":"warning","message":{"text":"d2raster.drawAxisLinearGradientCoverage (cognitive 19): d2raster.drawAxisLinearGradientCoverage has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 1, loops 1, match/switch 1 (nesting depth added 7). 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 807). 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":"d2renderers/d2raster/gradient.go"},"region":{"startLine":789}}}],"partialFingerprints":{"codehealthFindingId/v1":"d7381bd304fc48058de4d71561daaa7454d7a7a68c9460bceab233428814ef51"}},{"ruleId":"D2","level":"warning","message":{"text":"d2raster.validateRasterAsset (cognitive 19): d2raster.validateRasterAsset has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/image.go"},"region":{"startLine":64}}}],"partialFingerprints":{"codehealthFindingId/v1":"f89225c19b4bd678e8b68f8dd91b41b8f51d0c7e32f6b21b847f2fa46d73815c"}},{"ruleId":"D2","level":"warning","message":{"text":"d2raster.drawNativeSizeAlpha (cognitive 19): d2raster.drawNativeSizeAlpha has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 3 (6 pts) (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/d2raster/image.go"},"region":{"startLine":713}}}],"partialFingerprints":{"codehealthFindingId/v1":"de080e52e73cd2ebf3dd845d88bdd4b1f54ba94170063accf4359264e8c92417"}},{"ruleId":"D2","level":"warning","message":{"text":"d2raster.drawNativeSizeGeneric (cognitive 19): d2raster.drawNativeSizeGeneric has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 2 (3 pts) (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":"d2renderers/d2raster/image.go"},"region":{"startLine":993}}}],"partialFingerprints":{"codehealthFindingId/v1":"46fc910da350491d1b2350d0135ad28201d861b9a2e4ef5a4d1280392dfcb0a4"}},{"ruleId":"D2","level":"warning","message":{"text":"preflight.preparePatternPaint (cognitive 19): preflight.preparePatternPaint has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 4 (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":"d2renderers/d2raster/pattern.go"},"region":{"startLine":50}}}],"partialFingerprints":{"codehealthFindingId/v1":"f0f4388ec3c9d55466e6849abc4329d15f5699b71933c23d4585e1d76bab9a25"}},{"ruleId":"D2","level":"warning","message":{"text":"retainedVectorValidator.pattern (cognitive 19): retainedVectorValidator.pattern has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 5 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/vector_validation.go"},"region":{"startLine":633}}}],"partialFingerprints":{"codehealthFindingId/v1":"7584760410e81e414aed5f90d569978762d28f8a7fbecd90107cb82dd144b19d"}},{"ruleId":"D2","level":"warning","message":{"text":"d2scenebuild.markdownFontAdvance (cognitive 19): d2scenebuild.markdownFontAdvance has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (17 pts), 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":"d2renderers/d2scenebuild/markdown.go"},"region":{"startLine":388}}}],"partialFingerprints":{"codehealthFindingId/v1":"9468c10bc6db185796071511e8cff268807d134dfce469a29c651914fa3d8e61"}},{"ruleId":"D2","level":"warning","message":{"text":"codeFontMetrics.advance (cognitive 19): codeFontMetrics.advance has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (17 pts), 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":"d2renderers/d2scenebuild/code_shape.go"},"region":{"startLine":360}}}],"partialFingerprints":{"codehealthFindingId/v1":"78d19b6e89c4464c706583e7a185973c7e50308933dcab695aba17f6fe626bb5"}},{"ruleId":"D2","level":"warning","message":{"text":"d2svgimport.validateEnableBackground (cognitive 19): d2svgimport.validateEnableBackground has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (14 pts), 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/d2svgimport/boilerplate.go"},"region":{"startLine":313}}}],"partialFingerprints":{"codehealthFindingId/v1":"2475a1be8356e27b42d58dee6009b2ffe430df07b312f16361247d7666599baa"}},{"ruleId":"D2","level":"warning","message":{"text":"d2svgimport.splitEnableBackgroundFields (cognitive 19): d2svgimport.splitEnableBackgroundFields has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svgimport/boilerplate.go"},"region":{"startLine":353}}}],"partialFingerprints":{"codehealthFindingId/v1":"17570cc4ba15ca3783c3333eba08d2ec2f02da30df7249b6f5d5e1c03cb0e63b"}},{"ruleId":"D2","level":"warning","message":{"text":"svgImporter.validateRootBoilerplate (cognitive 19): svgImporter.validateRootBoilerplate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svgimport/boilerplate.go"},"region":{"startLine":284}}}],"partialFingerprints":{"codehealthFindingId/v1":"0439cd977e8bc2fd8a13ea0a206edda80fda648ebc843dce885f6ddf75cc3ef0"}},{"ruleId":"D2","level":"warning","message":{"text":"svgImporter.validateStylesheetRules (cognitive 19): svgImporter.validateStylesheetRules has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (3 pts), 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":"d2renderers/d2svgimport/gradient.go"},"region":{"startLine":295}}}],"partialFingerprints":{"codehealthFindingId/v1":"365a915e68a2c6e3aa5b335ec75670d6f7ea24be46f76b7e62886288268857d1"}},{"ruleId":"D2","level":"warning","message":{"text":"ParsedFace.GlyphRenderBounds (cognitive 19): ParsedFace.GlyphRenderBounds has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/internal/fontface/face.go"},"region":{"startLine":552}}}],"partialFingerprints":{"codehealthFindingId/v1":"f1c6b68c3eae098c52864664be6701743c5d6de46c4e7bcaf6beb934704edccc"}},{"ruleId":"D2","level":"warning","message":{"text":"testutil.InspectGIF (cognitive 19): testutil.InspectGIF has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 3, match/switch 1 (2 pts), 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":"internal/testutil/gif.go"},"region":{"startLine":88}}}],"partialFingerprints":{"codehealthFindingId/v1":"5eadd5247bb0160002a69a9e04efa2e6d86525b7b96e12127f95bbae885b51f7"}},{"ruleId":"D2","level":"warning","message":{"text":"testutil.undoPNGPredictor (cognitive 19): testutil.undoPNGPredictor has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (3 pts), match/switch 1 (3 pts) (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":"internal/testutil/pdf.go"},"region":{"startLine":453}}}],"partialFingerprints":{"codehealthFindingId/v1":"f6b95ed501e6f651d13fdfa0aed1e6943c513a59d0749cba37f2f4dec65cb097"}},{"ruleId":"D2","level":"warning","message":{"text":"Presentation.writeTo (cognitive 19): Presentation.writeTo has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (16 pts), 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":"lib/pptx/pptx.go"},"region":{"startLine":203}}}],"partialFingerprints":{"codehealthFindingId/v1":"170d2b0be899353f1caa2de6ac9ed4f6186a09186caeb6e3ae97da8458cd3f99"}},{"ruleId":"D2","level":"warning","message":{"text":"textmeasure.isColorEmojiGrapheme (cognitive 19): textmeasure.isColorEmojiGrapheme has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 4, loops 2 (3 pts) (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/textmeasure/textmeasure.go"},"region":{"startLine":402}}}],"partialFingerprints":{"codehealthFindingId/v1":"c5f3a6f0a92da5999ea01db8cc08282a02fce109c2ed755255fc05acdba85007"}},{"ruleId":"D2","level":"warning","message":{"text":"Ruler.scaleUnicode (cognitive 19): Ruler.scaleUnicode has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 3 (9 pts) (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":277}}}],"partialFingerprints":{"codehealthFindingId/v1":"38a19007426f23344d8e864fc721b9a2f1bb495754e83257ce9cb2994ef499bf"}},{"ruleId":"D2","level":"warning","message":{"text":"xgif.sortPaletteNodes (cognitive 19): xgif.sortPaletteNodes has cognitive complexity 19 (threshold 15). Drivers by points: loops 6 (12 pts), if/else 3 (6 pts), boolean chains 1 (nesting depth added 9). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/xgif/xgif.go"},"region":{"startLine":681}}}],"partialFingerprints":{"codehealthFindingId/v1":"9fc12b7adffe3a2b9487a3116e3f377029f7d6952096f021ed4d494d798fb1fa"}},{"ruleId":"D2","level":"warning","message":{"text":"xgif.encodePalettedImages (cognitive 19): xgif.encodePalettedImages has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (18 pts), 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":"lib/xgif/xgif.go"},"region":{"startLine":1296}}}],"partialFingerprints":{"codehealthFindingId/v1":"f6703b89a9d152855a30a1ac62a7c99b99c8d52aa64d6d25f1735c4be971d2a2"}},{"ruleId":"D2","level":"warning","message":{"text":"d2cli.pdfLinkShapes (cognitive 18): d2cli.pdfLinkShapes has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (16 pts), 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":"d2cli/paged.go"},"region":{"startLine":587}}}],"partialFingerprints":{"codehealthFindingId/v1":"a355d27d76519f30471f2b06c816b9ec634c37baf6d70c93910661bd7cfa7aeb"}},{"ruleId":"D2","level":"warning","message":{"text":"boardOutputTransaction.staleFileChanges (cognitive 18): boardOutputTransaction.staleFileChanges has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2cli/board_output_publish.go"},"region":{"startLine":474}}}],"partialFingerprints":{"codehealthFindingId/v1":"e134a01b78cd5e0041bf081b226b46def1c5d35fc133a691a7f568bdf816898d"}},{"ruleId":"D2","level":"warning","message":{"text":"pagedRenderer.render (cognitive 18): pagedRenderer.render has cognitive complexity 18 (threshold 15). Drivers by points: if/else 17 (18 pts) (nesting depth added 1). Of this number, 12 points are the body\u0027s own statements and 6 belong to one function literal inside it that branches. To reduce it, split the body: this score is breadth rather than depth \u2014 many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2cli/paged.go"},"region":{"startLine":124}}}],"partialFingerprints":{"codehealthFindingId/v1":"a1094dc4c96b907d2676a4ecdb1365f30a291c0fef1415c140c13796b8e20eb0"}},{"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 4 (10 pts), if/else 4 (6 pts), 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":"d2ir.matchPattern (cognitive 18): d2ir.matchPattern has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (17 pts), 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":"d2ir/pattern.go"},"region":{"startLine":198}}}],"partialFingerprints":{"codehealthFindingId/v1":"17d9860cb3c7b1376b19c262259c90d38624fdee6bd6bdbb9f45963b02113c45"}},{"ruleId":"D2","level":"warning","message":{"text":"Map.deleteEdgesForFieldReferences (cognitive 18): Map.deleteEdgesForFieldReferences has cognitive complexity 18 (threshold 15). Drivers by points: loops 4 (10 pts), if/else 2 (8 pts) (nesting depth added 12). 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":"d2ir/d2ir.go"},"region":{"startLine":504}}}],"partialFingerprints":{"codehealthFindingId/v1":"cdf5fa34a3f421e4db66a0ec5036d5ab48de504d411ffef1310ddffd94c09336"}},{"ruleId":"D2","level":"warning","message":{"text":"astCloner.cloneMap (cognitive 18): astCloner.cloneMap has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 pts), match/switch 1 (2 pts), 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":"d2ir/import_cache.go"},"region":{"startLine":46}}}],"partialFingerprints":{"codehealthFindingId/v1":"c73c1c67fd8373d914812a648e12ff575b3aceed5da94fb33a648e4d597e001d"}},{"ruleId":"D2","level":"warning","message":{"text":"descendantShifter.shift (cognitive 18): descendantShifter.shift has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 3 (5 pts), boolean chains 4 (nesting depth added 5). Of this number, 15 points are the body\u0027s own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2elklayout/descendant_shifter.go"},"region":{"startLine":53}}}],"partialFingerprints":{"codehealthFindingId/v1":"5ab15db3153460882227e6ccf4d575e55fba3da18e34327cab48f5c8f5417338"}},{"ruleId":"D2","level":"warning","message":{"text":"d2elklayout.deconflictSelfLoopLabels (cognitive 18): d2elklayout.deconflictSelfLoopLabels has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2elklayout/layout.go"},"region":{"startLine":697}}}],"partialFingerprints":{"codehealthFindingId/v1":"094e713eb6de25cd9fa0eb65b13582b6c9783f6804a448fc312da8ab58065b6d"}},{"ruleId":"D2","level":"warning","message":{"text":"engine.CompoundCandidate (cognitive 18): engine.CompoundCandidate has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11, boolean chains 6, 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":"d2layouts/d2talalayout/internal/engine/compound_candidate.go"},"region":{"startLine":16}}}],"partialFingerprints":{"codehealthFindingId/v1":"3cc5a3592ee8641955393769a1b8d2675010eac2b7be205fb300558be85f6178"}},{"ruleId":"D2","level":"warning","message":{"text":"grouping.hasNodeID (cognitive 18): grouping.hasNodeID has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 8, if/else 4 (7 pts), loops 3 (nesting depth added 3). Of this number, 15 points are the body\u0027s own statements and 3 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/grouping/sequences.go"},"region":{"startLine":464}}}],"partialFingerprints":{"codehealthFindingId/v1":"6ef5c6c1ae4b7adc7c8372659a1d3605bd0becb2b845e610619f242e81003d06"}},{"ruleId":"D2","level":"warning","message":{"text":"hierarchy.placeNodesInHierarchy (cognitive 18): hierarchy.placeNodesInHierarchy has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 2 (3 pts), match/switch 1 (nesting depth added 5). Of this number, 17 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/hierarchy/placement.go"},"region":{"startLine":192}}}],"partialFingerprints":{"codehealthFindingId/v1":"2f6d9be15bd364278df2cee5d1746c41c7360f293ac0e76c05f989421b677c44"}},{"ruleId":"D2","level":"warning","message":{"text":"packing.binPackPositionContainerChildren (cognitive 18): packing.binPackPositionContainerChildren has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), 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":"d2layouts/d2talalayout/internal/packing/guard.go"},"region":{"startLine":274}}}],"partialFingerprints":{"codehealthFindingId/v1":"96b5e32a73c71acaf2486befe0cfd1281ce3c2f33e735ba4ab9274888306f857"}},{"ruleId":"D2","level":"warning","message":{"text":"placement.NormalizeGaps (cognitive 18): placement.NormalizeGaps has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 4). Of this number, 15 points are the body\u0027s own statements and 3 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/stages.go"},"region":{"startLine":175}}}],"partialFingerprints":{"codehealthFindingId/v1":"3ca425479a2e4022116ce5e9cb139653d296cd230769cb52c292e9dbf0666685"}},{"ruleId":"D2","level":"warning","message":{"text":"ovgEdgeRouter.centerSymmetricalPorts (cognitive 18): ovgEdgeRouter.centerSymmetricalPorts has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (16 pts), 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":"d2layouts/d2talalayout/internal/routing/ovg_edge_router.go"},"region":{"startLine":428}}}],"partialFingerprints":{"codehealthFindingId/v1":"26f90398f2e051ab0e9d64ed9d2ba9b8af081fd98630fab17179260ab2f0c0c7"}},{"ruleId":"D2","level":"warning","message":{"text":"ovgEdgeSet.addGuarded (cognitive 18): ovgEdgeSet.addGuarded has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (18 pts) (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/d2talalayout/internal/routing/ovg_edge_set.go"},"region":{"startLine":94}}}],"partialFingerprints":{"codehealthFindingId/v1":"8a3b6cc1b0a99da16d7a4a9c51f5633b322728eecbab03da06e3ddf8cc32e7be"}},{"ruleId":"D2","level":"warning","message":{"text":"d2oracle.bumpChildrenUnderscores (cognitive 18): d2oracle.bumpChildrenUnderscores has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 2 (3 pts) (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":1107}}}],"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 8 (15 pts), 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":1663}}}],"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 6 (10 pts), 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":"d2isometricimg.normalize (cognitive 18): d2isometricimg.normalize has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (11 pts), 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":"d2renderers/d2isometric/d2isometricimg/render.go"},"region":{"startLine":56}}}],"partialFingerprints":{"codehealthFindingId/v1":"a8ccf364fc389b3e3c1e4654131bd4329b0c6517b87151826765380c2eee849e"}},{"ruleId":"D2","level":"warning","message":{"text":"d2isometricimg.nativeQueueContact (cognitive 18): d2isometricimg.nativeQueueContact has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 5, loops 1 (nesting depth added 1). Of this number, 15 points are the body\u0027s own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body: 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/d2isometric/d2isometricimg/solid_contacts.go"},"region":{"startLine":218}}}],"partialFingerprints":{"codehealthFindingId/v1":"50b9e5e1cc5bdf109fdce6d575f8fb5cba83eb36e9f29f816cd64bf04b2bf193"}},{"ruleId":"D2","level":"warning","message":{"text":"meshBuilder.node (cognitive 18): meshBuilder.node has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10, loops 2 (5 pts), boolean chains 3 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth \u2014 many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/geometry.go"},"region":{"startLine":630}}}],"partialFingerprints":{"codehealthFindingId/v1":"1a21a44fc148ea33960815b4dbd3478f375b77c543933f479df08e26424a2846"}},{"ruleId":"D2","level":"warning","message":{"text":"d2raster.rasterizeEvenOddMask (cognitive 18): d2raster.rasterizeEvenOddMask has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 2 (3 pts) (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":"d2renderers/d2raster/effects.go"},"region":{"startLine":934}}}],"partialFingerprints":{"codehealthFindingId/v1":"5e95555cbf93440dc29eec230e1bf54d73eaeac7b5140ddcf99bc07539383753"}},{"ruleId":"D2","level":"warning","message":{"text":"d2raster.prepareLinearGradient (cognitive 18): d2raster.prepareLinearGradient has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 4 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/gradient.go"},"region":{"startLine":121}}}],"partialFingerprints":{"codehealthFindingId/v1":"c7cadcd73cc0ae211a528285b4c428b8aebaa40d2ef21ee8ebc9a7c7eeb30a1f"}},{"ruleId":"D2","level":"warning","message":{"text":"preparedGradient.radialParameter (cognitive 18): preparedGradient.radialParameter has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 2 (3 pts) (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/d2raster/gradient.go"},"region":{"startLine":383}}}],"partialFingerprints":{"codehealthFindingId/v1":"9d5710e7b8098be20cd2cd2732851fd1fb6e3a28c3fb8b6b9085bc91029ae257"}},{"ruleId":"D2","level":"warning","message":{"text":"retainedVectorValidator.image (cognitive 18): retainedVectorValidator.image has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/vector_validation.go"},"region":{"startLine":479}}}],"partialFingerprints":{"codehealthFindingId/v1":"5877015ba3d000e3a954ae1f5d9f530a602f23d720a45a9eed78c44a41f9df43"}},{"ruleId":"D2","level":"warning","message":{"text":"d2scenebuild.admitSceneWork (cognitive 18): d2scenebuild.admitSceneWork has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (3 pts), 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/d2scenebuild/build.go"},"region":{"startLine":245}}}],"partialFingerprints":{"codehealthFindingId/v1":"b20b029f1813f42e9cd8d9c522a73fe71f76beff0c690e8a3db4c41b5eca1a83"}},{"ruleId":"D2","level":"warning","message":{"text":"builder.buildOrdinaryShapeOutline (cognitive 18): builder.buildOrdinaryShapeOutline has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 1 (2 pts), 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":"d2renderers/d2scenebuild/shape_effects.go"},"region":{"startLine":278}}}],"partialFingerprints":{"codehealthFindingId/v1":"92167dedd4ea0b22df047a253a8297abe1a096400b008f4fff79798547a4e653"}},{"ruleId":"D2","level":"warning","message":{"text":"builder.buildSketchDoubleBorderShape (cognitive 18): builder.buildSketchDoubleBorderShape has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 3 (nesting depth added 5). Of this number, 17 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/sketch_shapes.go"},"region":{"startLine":498}}}],"partialFingerprints":{"codehealthFindingId/v1":"084de0bceef7dc27890363ec8af24a3ca711fb73a256caf041aa1475f6385a2c"}},{"ruleId":"D2","level":"warning","message":{"text":"appendix.Append (cognitive 18): appendix.Append has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (15 pts), 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":"d2svg.pruneThemeRules (cognitive 18): d2svg.pruneThemeRules has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (3 pts), 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/d2svg/theme.go"},"region":{"startLine":78}}}],"partialFingerprints":{"codehealthFindingId/v1":"680c98de9f9ea33676d9b746ba21d18ab85373538e23e71085b7196e7f1fd7d7"}},{"ruleId":"D2","level":"warning","message":{"text":"d2svgimport.parseDashArray (cognitive 18): d2svgimport.parseDashArray has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), 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":"d2renderers/d2svgimport/style.go"},"region":{"startLine":699}}}],"partialFingerprints":{"codehealthFindingId/v1":"4a2e6e8f007282c06037dd6ca6cf7cac0124e7a00da0cf69518924b3cc81f025"}},{"ruleId":"D2","level":"warning","message":{"text":"svgImporter.clipCommands (cognitive 18): svgImporter.clipCommands has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 3, loops 1 (2 pts), match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction \u2014 a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full \u2014 so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svgimport/clip.go"},"region":{"startLine":214}}}],"partialFingerprints":{"codehealthFindingId/v1":"b0e6960f7ea5f1f7d4b2c7e8100c3d81c79f3ae3fd4cb5cd8df710b19fa38143"}},{"ruleId":"D2","level":"warning","message":{"text":"d2target.calculateTooltipBounds (cognitive 18): d2target.calculateTooltipBounds has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (16 pts), 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":"d2target/d2target.go"},"region":{"startLine":620}}}],"partialFingerprints":{"codehealthFindingId/v1":"e6615c5af5a0769df7bb8c42a25d8c23732ccbf778400343009df1a8d03439ac"}},{"ruleId":"D2","level":"warning","message":{"text":"testutil.ExtractPPTXImages (cognitive 18): testutil.ExtractPPTXImages has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (16 pts), 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":"internal/testutil/pptx.go"},"region":{"startLine":104}}}],"partialFingerprints":{"codehealthFindingId/v1":"f33b2f0c1e72c781ce8953b73a2b93bb8fc4b06baaf0a3b3f1f4d6a732b1bdb1"}},{"ruleId":"D2","level":"warning","message":{"text":"svg.parseSupportedExternalDoctype (cognitive 18): svg.parseSupportedExternalDoctype has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 8 (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":"lib/svg/doctype.go"},"region":{"startLine":67}}}],"partialFingerprints":{"codehealthFindingId/v1":"f2a5082da3102549e704618353372b9d3358e7ff7cae16711cf34d9eafdd3cfa"}},{"ruleId":"D2","level":"warning","message":{"text":"markdownPainter.collectInlineTokens (cognitive 18): markdownPainter.collectInlineTokens has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 6, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/textmeasure/markdown_svg.go"},"region":{"startLine":1312}}}],"partialFingerprints":{"codehealthFindingId/v1":"fe5c8d9433c72a237bdc9b36d3aae2e1e3453deae5d7155d465380de8b68f6ca"}},{"ruleId":"D2","level":"warning","message":{"text":"xgif.quantizeRasterImageWithWorkspace (cognitive 18): xgif.quantizeRasterImageWithWorkspace has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/xgif/xgif.go"},"region":{"startLine":170}}}],"partialFingerprints":{"codehealthFindingId/v1":"dfc22f4b5d483411ee47604d2345340eace452de48cd4e003e25406a355b4083"}},{"ruleId":"D2","level":"warning","message":{"text":"d2cli.collectGIFBoards (cognitive 17): d2cli.collectGIFBoards has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (14 pts), loops 2 (3 pts) (nesting depth added 4). Most of this is not in the body itself: 3 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 916). 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":"d2cli/raster.go"},"region":{"startLine":905}}}],"partialFingerprints":{"codehealthFindingId/v1":"dde009410a38b60c525cba3b0525200805ff7e04e5a1367d044d7c0ada399ee1"}},{"ruleId":"D2","level":"warning","message":{"text":"boardOutputWorkspace.preflightMerge (cognitive 17): boardOutputWorkspace.preflightMerge has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 4 (nesting depth added 2). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to one function literal inside it that branches (line 435). 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":"d2cli/board_output.go"},"region":{"startLine":433}}}],"partialFingerprints":{"codehealthFindingId/v1":"f21a387e4bd103efa747cdd30714f9f38e620ca4af53c8e7402247f4c67f12eb"}},{"ruleId":"D2","level":"warning","message":{"text":"boardOutputTransaction.apply (cognitive 17): boardOutputTransaction.apply has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 4, boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2cli/board_output_publish.go"},"region":{"startLine":426}}}],"partialFingerprints":{"codehealthFindingId/v1":"7f70228976c78c230caf895410639ce24a105f66b323aa7e22760b198c42dbbc"}},{"ruleId":"D2","level":"warning","message":{"text":"d2compiler._findFieldAST (cognitive 17): d2compiler._findFieldAST has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (15 pts), 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":379}}}],"partialFingerprints":{"codehealthFindingId/v1":"3d307f7277baa256ecdff17da7ce1c08cbeb781bea750f7ef9694ff32f3eecf0"}},{"ruleId":"D2","level":"warning","message":{"text":"compiler.compileBoardsField (cognitive 17): compiler.compileBoardsField has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), match/switch 1 (2 pts), 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":"d2compiler/compile.go"},"region":{"startLine":319}}}],"partialFingerprints":{"codehealthFindingId/v1":"25d5ba93b9e041566a7df0f7e449a39789a3263bbc0d750237b5f7719c1cc06c"}},{"ruleId":"D2","level":"warning","message":{"text":"compiler.compileLabel (cognitive 17): compiler.compileLabel has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), match/switch 3 (7 pts) (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":761}}}],"partialFingerprints":{"codehealthFindingId/v1":"f0712e94c2c42d65b288ab527c9ba3011f8aebc248012c54b0b9f0b0e1a1817d"}},{"ruleId":"D2","level":"warning","message":{"text":"compiler.compileSQLTable (cognitive 17): compiler.compileSQLTable has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 3 (4 pts) (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":1457}}}],"partialFingerprints":{"codehealthFindingId/v1":"12643665af55db6c742ceedf5e9c55a5ba641919870d03eea3070dc821f584f0"}},{"ruleId":"D2","level":"warning","message":{"text":"d2graph.DeserializeGraph (cognitive 17): d2graph.DeserializeGraph has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 4 (6 pts) (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 9 (10 pts), 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":659}}}],"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 8 (14 pts), loops 1 (2 pts), 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":1671}}}],"partialFingerprints":{"codehealthFindingId/v1":"04dbcc86d6975c5bc08d24f9741754acb1ce74a0fe4d9331eabea66a7b038ae3"}},{"ruleId":"D2","level":"warning","message":{"text":"d2ir.Compile (cognitive 17): d2ir.Compile has cognitive complexity 17 (threshold 15). Drivers by points: if/else 17. 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":"d2ir/compile.go"},"region":{"startLine":109}}}],"partialFingerprints":{"codehealthFindingId/v1":"6a953c4e8792137a6b9032c190c687c1c00317b0bc96414d92935108fabf219f"}},{"ruleId":"D2","level":"warning","message":{"text":"Map.removeSuspendedFields (cognitive 17): Map.removeSuspendedFields has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), 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":2375}}}],"partialFingerprints":{"codehealthFindingId/v1":"bf6cd691030d90488bdf1c6cc1b0b827e1ea3532b3195794bb4adce8d4e7e0e5"}},{"ruleId":"D2","level":"warning","message":{"text":"Map.ensureFieldMode (cognitive 17): Map.ensureFieldMode has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 4, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ir/d2ir.go"},"region":{"startLine":1179}}}],"partialFingerprints":{"codehealthFindingId/v1":"fe201a8e46155a8ab9cc7cfafa27590b74766e85b4db8c23e282b83c26dc0d58"}},{"ruleId":"D2","level":"warning","message":{"text":"RefContext.Equal (cognitive 17): RefContext.Equal has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), 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":974}}}],"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 4 (11 pts), loops 4 (6 pts) (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":481}}}],"partialFingerprints":{"codehealthFindingId/v1":"84d2a88b1766d9b27e4069e5cc5306a73bb374fe888dacbf4c945224e0122287"}},{"ruleId":"D2","level":"warning","message":{"text":"d2talalayout.buildEdgePatch (cognitive 17): d2talalayout.buildEdgePatch has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/patch.go"},"region":{"startLine":372}}}],"partialFingerprints":{"codehealthFindingId/v1":"516f8a7e855ce6be893d40f09e608f932b2cdda63aaac57ca63afc92a18af2a2"}},{"ruleId":"D2","level":"warning","message":{"text":"placement.tryMove (cognitive 17): placement.tryMove has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 1 (nesting depth added 8). Of this number, 15 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/alignment.go"},"region":{"startLine":234}}}],"partialFingerprints":{"codehealthFindingId/v1":"7f1b66ff854287eb1a9b7b577c74414af9ea4b14ad268787e5ca160ea9b9c0a7"}},{"ruleId":"D2","level":"warning","message":{"text":"placement.canOptimizeNodeGuarded (cognitive 17): placement.canOptimizeNodeGuarded has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 1 (2 pts), 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":"d2layouts/d2talalayout/internal/placement/sizeless_optimizer.go"},"region":{"startLine":598}}}],"partialFingerprints":{"codehealthFindingId/v1":"3815d05721e84b56bb2350552dff223f32969b0b163b0a47657b958013682705"}},{"ruleId":"D2","level":"warning","message":{"text":"placementcost.placementEdgeLengthState (cognitive 17): placementcost.placementEdgeLengthState has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 3 (4 pts) (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/d2talalayout/internal/placementcost/graph.go"},"region":{"startLine":19}}}],"partialFingerprints":{"codehealthFindingId/v1":"ed914acd324ff3ac722ea28e237db674857e1d4a69a083d47ccb5305f3c11ec8"}},{"ruleId":"D2","level":"warning","message":{"text":"placementcost.ColumnCrossingCost (cognitive 17): placementcost.ColumnCrossingCost has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 2, 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":"d2layouts/d2talalayout/internal/placementcost/symmetry.go"},"region":{"startLine":575}}}],"partialFingerprints":{"codehealthFindingId/v1":"8a4d765a3772ae97e4bcddaf44dfac0c74b2c41defb9864649a33300dcc4b969"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.solveChannelGap (cognitive 17): routing.solveChannelGap has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), 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":"d2layouts/d2talalayout/internal/routing/nudge_channels.go"},"region":{"startLine":386}}}],"partialFingerprints":{"codehealthFindingId/v1":"47b1d2ba83ae2a89c9fba00057fec46b0f1c233d5f4caf201c640134d6de320a"}},{"ruleId":"D2","level":"warning","message":{"text":"trees.swapDimensions (cognitive 17): trees.swapDimensions has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (3 pts), 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":"d2layouts/d2talalayout/internal/trees/geometry.go"},"region":{"startLine":720}}}],"partialFingerprints":{"codehealthFindingId/v1":"03e8c875999629806f1fe6a5dbd4f16e6d8659b1dc3ee7616f97774a0f79e431"}},{"ruleId":"D2","level":"warning","message":{"text":"parser.parseMapKey (cognitive 17): parser.parseMapKey has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (15 pts), 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":711}}}],"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 7 (13 pts), 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 6 (8 pts), boolean chains 6, loops 2 (3 pts) (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 5 (7 pts), loops 4 (6 pts), 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":"d2isometricimg.hierarchyHeaderStrip (cognitive 17): d2isometricimg.hierarchyHeaderStrip has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 2, loops 2 (nesting depth added 3). Of this number, 14 points are the body\u0027s own statements and 3 belong to 2 function literals inside it that branch. To reduce it, split the body: 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/d2isometric/d2isometricimg/hierarchy_headers.go"},"region":{"startLine":197}}}],"partialFingerprints":{"codehealthFindingId/v1":"ac051afb3709d30f5c92485996c4b0a5aa0ba6e7602bbe3b0ffea532529285f5"}},{"ruleId":"D2","level":"warning","message":{"text":"d2isometricimg.captionHullOverlap (cognitive 17): d2isometricimg.captionHullOverlap has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 9). Of this number, 16 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/projection_clearance.go"},"region":{"startLine":143}}}],"partialFingerprints":{"codehealthFindingId/v1":"b48f50e1bf46c645cb9ae73930b1d4ca4cc3abcb8a616d982d4115f55cf7498a"}},{"ruleId":"D2","level":"warning","message":{"text":"d2isometricimg.writeSVGPaintCover (cognitive 17): d2isometricimg.writeSVGPaintCover has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 4 (6 pts), 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":"d2renderers/d2isometric/d2isometricimg/svg_seams.go"},"region":{"startLine":57}}}],"partialFingerprints":{"codehealthFindingId/v1":"95017c307438c368456ec02db2a88449879bec17168cc10747cbe77714bae984"}},{"ruleId":"D2","level":"warning","message":{"text":"meshBuilder.printStyle (cognitive 17): meshBuilder.printStyle has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/geometry.go"},"region":{"startLine":302}}}],"partialFingerprints":{"codehealthFindingId/v1":"2cc083ceac4861a3961f5afdd2571973c6c1384a65d624c4a0326ac4c00af37f"}},{"ruleId":"D2","level":"warning","message":{"text":"routeCaptionPlacer.AvoidMesh (cognitive 17): routeCaptionPlacer.AvoidMesh has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (4 pts), 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":"d2renderers/d2isometric/d2isometricimg/projection_clearance.go"},"region":{"startLine":24}}}],"partialFingerprints":{"codehealthFindingId/v1":"a3112beeb75ec15d2984a9c819247717fd68167a0b3707ea20ac280653f5bc69"}},{"ruleId":"D2","level":"warning","message":{"text":"d2isometric.hierarchyRoute (cognitive 17): d2isometric.hierarchyRoute has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 4). Of this number, 12 points are the body\u0027s own statements and 5 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into 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/d2isometric/hierarchy.go"},"region":{"startLine":139}}}],"partialFingerprints":{"codehealthFindingId/v1":"f16e13b5e44468d183b62949ec5f61c8676d8a7e5b28daa9bbf28390d0f90cec"}},{"ruleId":"D2","level":"warning","message":{"text":"d2raster.drawStroke (cognitive 17): d2raster.drawStroke has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2 (3 pts) (nesting depth added 8). Of this number, 11 points are the body\u0027s own statements and 6 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into 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/d2raster/geometry.go"},"region":{"startLine":445}}}],"partialFingerprints":{"codehealthFindingId/v1":"f62fee5bc5418415041f74d1ab5fc14964ea788728d02f69c67bd71f68d60166"}},{"ruleId":"D2","level":"warning","message":{"text":"d2raster.drawLinearGradientCoverage (cognitive 17): d2raster.drawLinearGradientCoverage has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 1, loops 1 (nesting depth added 7). None of this is in the body itself: all 17 points belong to one function literal inside it that branches (line 851). 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":"d2renderers/d2raster/gradient.go"},"region":{"startLine":850}}}],"partialFingerprints":{"codehealthFindingId/v1":"164f7ad43442e9678ad16e92d6cb6b54601a9728d4e374098f0c3dfd3c96aeb1"}},{"ruleId":"D2","level":"warning","message":{"text":"patternCollector.node (cognitive 17): patternCollector.node has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 3, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/pattern.go"},"region":{"startLine":346}}}],"partialFingerprints":{"codehealthFindingId/v1":"690e2308aea7ab8e26077e10c79a580d478301e3bac10be16b5f00a3cab87f47"}},{"ruleId":"D2","level":"warning","message":{"text":"d2scenebuild.connectionPath (cognitive 17): d2scenebuild.connectionPath has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (3 pts), 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/d2scenebuild/connection.go"},"region":{"startLine":349}}}],"partialFingerprints":{"codehealthFindingId/v1":"33ab76960b3800c9559a6845b6bcf4fcca5ff5f0acf5fbb333e6beaf8822c38e"}},{"ruleId":"D2","level":"warning","message":{"text":"builder.preflight (cognitive 17): builder.preflight has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 2, loops 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/build.go"},"region":{"startLine":282}}}],"partialFingerprints":{"codehealthFindingId/v1":"ab8329ef3c4bb3d30824bf859fa91ad3e9301c16b731fbd50a2b33658fc371e0"}},{"ruleId":"D2","level":"warning","message":{"text":"d2svgimport.ImportNodeWithOptions (cognitive 17): d2svgimport.ImportNodeWithOptions has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15 (16 pts), boolean chains 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth \u2014 many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svgimport/import.go"},"region":{"startLine":117}}}],"partialFingerprints":{"codehealthFindingId/v1":"b7b504a72195c98c5a31a9f4cc89bfbd9d98b1aaba6f3816bcc674a911f6eb12"}},{"ruleId":"D2","level":"warning","message":{"text":"svgImporter.validateMetadataCardinality (cognitive 17): svgImporter.validateMetadataCardinality has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (8 pts), match/switch 2 (4 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 7). The drivers above price the dispatch low by construction \u2014 a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full \u2014 so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svgimport/boilerplate.go"},"region":{"startLine":143}}}],"partialFingerprints":{"codehealthFindingId/v1":"25334bad4dc8c45265c41386975412e57f8b8b91113ed65769bb5c6dad060d18"}},{"ruleId":"D2","level":"warning","message":{"text":"svgImporter.validateStyleTree (cognitive 17): svgImporter.validateStyleTree has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (3 pts), 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":"d2renderers/d2svgimport/compile.go"},"region":{"startLine":159}}}],"partialFingerprints":{"codehealthFindingId/v1":"01738284b54484c5d5f8bf74a38be17e8edd0395ecc90615a49a2c6fb9a1e8c7"}},{"ruleId":"D2","level":"warning","message":{"text":"svgImporter.validLocalPaintID (cognitive 17): svgImporter.validLocalPaintID has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 3, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svgimport/gradient.go"},"region":{"startLine":365}}}],"partialFingerprints":{"codehealthFindingId/v1":"f4d557f27565b7a3be5f44024b6c8bf511c94c6b24391b23ee2ce440df023a8c"}},{"ruleId":"D2","level":"warning","message":{"text":"svgImporter.classTokens (cognitive 17): svgImporter.classTokens has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (15 pts), 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":"d2renderers/d2svgimport/stylesheet.go"},"region":{"startLine":264}}}],"partialFingerprints":{"codehealthFindingId/v1":"42ce1953f178f2602fc4eb50eb18b22405ed7caf00f828cc2775d8655d6833e3"}},{"ruleId":"D2","level":"warning","message":{"text":"fontface.registeredBundledFaceEntry (cognitive 17): fontface.registeredBundledFaceEntry has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 5, loops 1 (2 pts) (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/internal/fontface/bundled_faces.go"},"region":{"startLine":142}}}],"partialFingerprints":{"codehealthFindingId/v1":"6bc4e4729a0f75893fa4c150f29ab61bcc23346d4e5c705318d2a0ba0e73ef64"}},{"ruleId":"D2","level":"warning","message":{"text":"BundledFaceSource.SupportsRenderableRune (cognitive 17): BundledFaceSource.SupportsRenderableRune has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth \u2014 many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/internal/fontface/face.go"},"region":{"startLine":191}}}],"partialFingerprints":{"codehealthFindingId/v1":"d82ce666ec888ec48f7b2fd0c1c5d6a17b6edd36850aa110b971eaa773451493"}},{"ruleId":"D2","level":"warning","message":{"text":"font.Sfnt2Woff (cognitive 17): font.Sfnt2Woff has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 4 (nesting depth added 6). Of this number, 16 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/font/font.go"},"region":{"startLine":82}}}],"partialFingerprints":{"codehealthFindingId/v1":"3b0036953ca9c97c09b0e9d024130dc326cc8d834e43ed2e19355b3927fbdfa9"}},{"ruleId":"D2","level":"warning","message":{"text":"Resolver.loadHTTP (cognitive 17): Resolver.loadHTTP has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/imageasset/resolve.go"},"region":{"startLine":415}}}],"partialFingerprints":{"codehealthFindingId/v1":"19e5cd1dd8c6a5b6f9dfe833e9b582e5c05da05797fc6b5ec5afef708d50458f"}},{"ruleId":"D2","level":"warning","message":{"text":"svg.ParseAttributes (cognitive 17): svg.ParseAttributes has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 2, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/svg/markup.go"},"region":{"startLine":81}}}],"partialFingerprints":{"codehealthFindingId/v1":"cdbf3945aa016c340072ec7a868130c1e49769fc550e28f5c7e552a4a1640abd"}},{"ruleId":"D2","level":"warning","message":{"text":"Ruler.scaleUnicodeLegacy (cognitive 17): Ruler.scaleUnicodeLegacy has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (6 pts) (nesting depth added 9). 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":450}}}],"partialFingerprints":{"codehealthFindingId/v1":"8d63f75512524e49d987c3a7e1742a704b3f8b10f746360662154af6f43ec4c2"}},{"ruleId":"D2","level":"warning","message":{"text":"xgif.ditherOpaqueRasterWithWorkspace (cognitive 17): xgif.ditherOpaqueRasterWithWorkspace has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (12 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth \u2014 many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/xgif/xgif.go"},"region":{"startLine":887}}}],"partialFingerprints":{"codehealthFindingId/v1":"6cca0dee9ed1616bf455931c846049932602ce72f71fd80c9bea581a7fa2021d"}},{"ruleId":"D2","level":"warning","message":{"text":"d2cli.prepareBoardOutputFile (cognitive 16): d2cli.prepareBoardOutputFile has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14 (16 pts) (nesting depth added 2). Of this number, 9 points are the body\u0027s own statements and 7 belong to one function literal inside it that branches. To reduce it, split the body: 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/board_output_publish.go"},"region":{"startLine":723}}}],"partialFingerprints":{"codehealthFindingId/v1":"a627a96eeec27c4a2587618facb24fbf81a26fee0deb879c518b88348d2f6159"}},{"ruleId":"D2","level":"warning","message":{"text":"d2cli.resolveLinks (cognitive 16): d2cli.resolveLinks has cognitive complexity 16 (threshold 15). Drivers by points: loops 6 (9 pts), if/else 4 (7 pts) (nesting depth added 6). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2cli/main.go"},"region":{"startLine":778}}}],"partialFingerprints":{"codehealthFindingId/v1":"79ee7cdbd58f9c96c740f1dc888e11d71bcc5be7b81a8b4330ab30d75691dd0f"}},{"ruleId":"D2","level":"warning","message":{"text":"printer.interpolationBoxes (cognitive 16): printer.interpolationBoxes has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (14 pts), 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.SpacingOpt (cognitive 16): Object.SpacingOpt has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), match/switch 2 (4 pts) (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":1898}}}],"partialFingerprints":{"codehealthFindingId/v1":"9e3777f3ca57fe40d817c33be93377d7befe6dc08c4395516a5389ae123d3530"}},{"ruleId":"D2","level":"warning","message":{"text":"Map.CopyBase (cognitive 16): Map.CopyBase has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), boolean chains 3, loops 3, match/switch 1 (3 pts) (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":"d2ir/d2ir.go"},"region":{"startLine":458}}}],"partialFingerprints":{"codehealthFindingId/v1":"c3b26dd34f3732c1160eec1af60b77c41033ecd395d020c79a0b53c1327dd0ba"}},{"ruleId":"D2","level":"warning","message":{"text":"EdgeID.resolve (cognitive 16): EdgeID.resolve has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), 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":736}}}],"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 10 (15 pts), 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":735}}}],"partialFingerprints":{"codehealthFindingId/v1":"52875ef9429c1edecb79addb67ecacec1090c36719b93ec1ef1f028c9e57ea25"}},{"ruleId":"D2","level":"warning","message":{"text":"d2talalayout.Layout (cognitive 16): d2talalayout.Layout has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 1 (nesting depth added 2). Of this number, 12 points are the body\u0027s own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body: 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":"d2layouts/d2talalayout/layout.go"},"region":{"startLine":241}}}],"partialFingerprints":{"codehealthFindingId/v1":"b1585825034285b7978aa00e5e714c24d978cb835e12faa3abb257541d41a3de"}},{"ruleId":"D2","level":"warning","message":{"text":"d2talalayout.sameDirectionMetadata (cognitive 16): d2talalayout.sameDirectionMetadata has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 2, boolean chains 1 (nesting depth added 5). Of this number, 9 points are the body\u0027s own statements and 7 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/result_validate.go"},"region":{"startLine":377}}}],"partialFingerprints":{"codehealthFindingId/v1":"b7e9cb57b16b4b9f10f68078f3d3ea34ac5bb8d484c0f3037a1e17597bb1342a"}},{"ruleId":"D2","level":"warning","message":{"text":"graphbounds.fixedOrigin (cognitive 16): graphbounds.fixedOrigin has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (14 pts), 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":"d2layouts/d2talalayout/internal/graphbounds/bounds.go"},"region":{"startLine":175}}}],"partialFingerprints":{"codehealthFindingId/v1":"5fa5c54dfbe417be84d10f50e7c7bb9d337baf505c13a3376f830ee630ae922b"}},{"ruleId":"D2","level":"warning","message":{"text":"graphjson.serializeTree (cognitive 16): graphjson.serializeTree has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (15 pts), 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":"d2layouts/d2talalayout/internal/graphjson/codec.go"},"region":{"startLine":704}}}],"partialFingerprints":{"codehealthFindingId/v1":"7c6e55f960c9e7b1832f1332f712727a214234d708f350bfda89968ab02d6408"}},{"ruleId":"D2","level":"warning","message":{"text":"grouping.clusterHasLeakyEdgeGuarded (cognitive 16): grouping.clusterHasLeakyEdgeGuarded has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (3 pts) (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/d2talalayout/internal/grouping/cluster_discovery.go"},"region":{"startLine":236}}}],"partialFingerprints":{"codehealthFindingId/v1":"c398e20257440315bdf78d5f34b0b123b6329dc0f9287ae1caeef37ced754957"}},{"ruleId":"D2","level":"warning","message":{"text":"hierarchy.sortAlignmentNodes (cognitive 16): hierarchy.sortAlignmentNodes has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 4 (nesting depth added 4). Of this number, 8 points are the body\u0027s own statements and 8 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/hierarchy/brandes_kopf.go"},"region":{"startLine":375}}}],"partialFingerprints":{"codehealthFindingId/v1":"c31fc9babf31c715e666e9bfbeafba42802cbbee06bbbc883730c71fabb3fdbf"}},{"ruleId":"D2","level":"warning","message":{"text":"loops.findLoopPortsForEdge (cognitive 16): loops.findLoopPortsForEdge has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), boolean chains 4, 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":"d2layouts/d2talalayout/internal/loops/loops.go"},"region":{"startLine":187}}}],"partialFingerprints":{"codehealthFindingId/v1":"dbf1671b8d98ffdb44b3627ce56ee455aac0a58dee7e07d377ab43b71448791b"}},{"ruleId":"D2","level":"warning","message":{"text":"placement.alignmentDeltas (cognitive 16): placement.alignmentDeltas has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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/d2talalayout/internal/placement/alignment.go"},"region":{"startLine":182}}}],"partialFingerprints":{"codehealthFindingId/v1":"02202edad0edb4eebe2968db6e38d305a246dd143d3d2725ca0cae265df15943"}},{"ruleId":"D2","level":"warning","message":{"text":"placement.optimizerMoveNodeAbs (cognitive 16): placement.optimizerMoveNodeAbs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 3, loops 2 (nesting depth added 3). Of this number, 15 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/optimization_guard.go"},"region":{"startLine":684}}}],"partialFingerprints":{"codehealthFindingId/v1":"0d432828cbb6f14123ac5049db760322b1c09dafa127e5ab422d38a263efede6"}},{"ruleId":"D2","level":"warning","message":{"text":"placement.Normalize (cognitive 16): placement.Normalize has cognitive complexity 16 (threshold 15). Drivers by points: loops 6 (11 pts), if/else 3 (5 pts) (nesting depth added 7). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/stages.go"},"region":{"startLine":301}}}],"partialFingerprints":{"codehealthFindingId/v1":"ca779deb7f40eb11bb2854e4dfb731c63b5463fe0533ad34e8c7bc8418a40fe6"}},{"ruleId":"D2","level":"warning","message":{"text":"placementcost.countEdgeCrossingsExcludingSharedNodes (cognitive 16): placementcost.countEdgeCrossingsExcludingSharedNodes has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (3 pts), 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":"d2layouts/d2talalayout/internal/placementcost/graph.go"},"region":{"startLine":232}}}],"partialFingerprints":{"codehealthFindingId/v1":"6de2830be070e790dc3629405b02c0f3ad4b0ea1a8af29d513983e000e616d4f"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.groupEdgesByClusterPortGuarded (cognitive 16): routing.groupEdgesByClusterPortGuarded has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (3 pts) (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/d2talalayout/internal/routing/coordinator.go"},"region":{"startLine":1899}}}],"partialFingerprints":{"codehealthFindingId/v1":"74dc7dbf55a16506e76a7c5075f968fe521f93c9cd5d970ddf73f26577e80994"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.channelInventoryIsClosed (cognitive 16): routing.channelInventoryIsClosed has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), 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":"d2layouts/d2talalayout/internal/routing/nudge_channels.go"},"region":{"startLine":119}}}],"partialFingerprints":{"codehealthFindingId/v1":"16095bb9a45ea091fa585f64ab213e5aede94fbe3ffdc8b90e8fad40f026b71b"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.swapEdgePortsGuarded (cognitive 16): routing.swapEdgePortsGuarded has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 2, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/swap_ports.go"},"region":{"startLine":33}}}],"partialFingerprints":{"codehealthFindingId/v1":"a29b42627b80965a9cbba8ec7bd39485f5b7da05edc73d90591c5652de806ccd"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.doesNotPassThroughNodesGuarded (cognitive 16): routing.doesNotPassThroughNodesGuarded has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (3 pts), boolean chains 2, jumps 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/swap_ports.go"},"region":{"startLine":159}}}],"partialFingerprints":{"codehealthFindingId/v1":"05b2a01c981893a45195e58baef309498cc49067370fe389810906f5532519dd"}},{"ruleId":"D2","level":"warning","message":{"text":"routing.alignedPortNodeForBuild (cognitive 16): routing.alignedPortNodeForBuild has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), 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":"d2layouts/d2talalayout/internal/routing/tree_routes.go"},"region":{"startLine":133}}}],"partialFingerprints":{"codehealthFindingId/v1":"f5961e390be4614b3d098f66d216339a16d1749c0f230e8d7c1927112c33c5db"}},{"ruleId":"D2","level":"warning","message":{"text":"OVG.addCornerNodes (cognitive 16): OVG.addCornerNodes has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (3 pts) (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/d2talalayout/internal/routing/ovg.go"},"region":{"startLine":977}}}],"partialFingerprints":{"codehealthFindingId/v1":"090151a173aa7547a75892b65a03bb9ab4c8b42d8a907187f48f77f2e71daf73"}},{"ruleId":"D2","level":"warning","message":{"text":"ovgEdgeRouter.routeLine (cognitive 16): ovgEdgeRouter.routeLine has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (16 pts) (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/d2talalayout/internal/routing/ovg_edge_router.go"},"region":{"startLine":303}}}],"partialFingerprints":{"codehealthFindingId/v1":"ec118909d1f9688f4e58e0a9ddbdaf968a9580d270712020073438a011dcc1fb"}},{"ruleId":"D2","level":"warning","message":{"text":"ovgBuildGuard.passesThroughAllowingPorts (cognitive 16): ovgBuildGuard.passesThroughAllowingPorts has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 5, loops 1 (2 pts), 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":"d2layouts/d2talalayout/internal/routing/ovg_resource.go"},"region":{"startLine":429}}}],"partialFingerprints":{"codehealthFindingId/v1":"b39357a69eaf0a4ef4c809e17ad9b20647628f7bfb24ae01dc44d6de0e157913"}},{"ruleId":"D2","level":"warning","message":{"text":"trees.treeFringeNodes (cognitive 16): trees.treeFringeNodes has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 2, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/trees/preprocess_helpers.go"},"region":{"startLine":107}}}],"partialFingerprints":{"codehealthFindingId/v1":"3398295b89e76dde0a4df27166a87b824d66fcded7bc8d6d8ab97be7a881f67b"}},{"ruleId":"D2","level":"warning","message":{"text":"trees.isIsolatedTreeGuarded (cognitive 16): trees.isIsolatedTreeGuarded has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (3 pts), 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":"d2layouts/d2talalayout/internal/trees/preprocess_helpers.go"},"region":{"startLine":623}}}],"partialFingerprints":{"codehealthFindingId/v1":"60780e1b3ae6d64b6b967a8345e49f07a0f74d75e8ef61b37e42abb8ab9aa0e2"}},{"ruleId":"D2","level":"warning","message":{"text":"parser.parseBlockComment (cognitive 16): parser.parseBlockComment has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (14 pts), 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":635}}}],"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 12 (16 pts) (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":"d2isometricimg.hierarchyShadowReceivers (cognitive 16): d2isometricimg.hierarchyShadowReceivers has cognitive complexity 16 (threshold 15). Drivers by points: loops 6 (10 pts), if/else 3 (6 pts) (nesting depth added 7). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/ground_receivers.go"},"region":{"startLine":71}}}],"partialFingerprints":{"codehealthFindingId/v1":"137685993a9b25832f5e07b1b28457ef5406236a508f4b4244be2fded39368fb"}},{"ruleId":"D2","level":"warning","message":{"text":"d2isometricimg.CaptureFrames (cognitive 16): d2isometricimg.CaptureFrames has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 2, 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":"d2renderers/d2isometric/d2isometricimg/render.go"},"region":{"startLine":117}}}],"partialFingerprints":{"codehealthFindingId/v1":"9e34f92650ba684c9ddbed0b4c7e4d7315b1b0b02d4d9ccab6858c53f5a62c03"}},{"ruleId":"D2","level":"warning","message":{"text":"d2isometricimg.svgSplitPolygon (cognitive 16): d2isometricimg.svgSplitPolygon has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), 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":"d2renderers/d2isometric/d2isometricimg/svg_visibility.go"},"region":{"startLine":209}}}],"partialFingerprints":{"codehealthFindingId/v1":"9a8f5d1324946b8393e4161a9af878e911f52e804878ebd02031a3f77bd6a39a"}},{"ruleId":"D2","level":"warning","message":{"text":"d2isometricimg.svgValidFragment (cognitive 16): d2isometricimg.svgValidFragment has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 5). Of this number, 15 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/svg_visibility.go"},"region":{"startLine":249}}}],"partialFingerprints":{"codehealthFindingId/v1":"ffb3cafe1e546050cd0db3ea197edbde478d5026d6779e9160eedbb4878d900f"}},{"ruleId":"D2","level":"warning","message":{"text":"meshBuilder.classicInkRibbon (cognitive 16): meshBuilder.classicInkRibbon has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 3, loops 3 (nesting depth added 4). Of this number, 14 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/native_edges.go"},"region":{"startLine":543}}}],"partialFingerprints":{"codehealthFindingId/v1":"bccda89ed5fe9d702202e63dc00f3347b3ee4ebe85c440735e126641d71d6d80"}},{"ruleId":"D2","level":"warning","message":{"text":"meshBuilder.solidPaint (cognitive 16): meshBuilder.solidPaint has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 4 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/native_solids.go"},"region":{"startLine":45}}}],"partialFingerprints":{"codehealthFindingId/v1":"d377eeaaa0db4b995e9e3de7f1e0af39dfbee2d8f3e05922c2efc6477da49ead"}},{"ruleId":"D2","level":"warning","message":{"text":"meshBuilder.addDocumentLinks (cognitive 16): meshBuilder.addDocumentLinks has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 4, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/page.go"},"region":{"startLine":246}}}],"partialFingerprints":{"codehealthFindingId/v1":"6684853d6994189c16965e24ca9a38b11681e515facdd20fe830a661a2ad22ee"}},{"ruleId":"D2","level":"warning","message":{"text":"Raster.paintGround (cognitive 16): Raster.paintGround has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (3 pts), 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":"d2renderers/d2isometric/d2isometricimg/raster.go"},"region":{"startLine":811}}}],"partialFingerprints":{"codehealthFindingId/v1":"880bea21394bb91ccfb18c7e10fd32cfee37afdca4d881e151b8c77ebd39af10"}},{"ruleId":"D2","level":"warning","message":{"text":"surfaceIconPainter.resolve (cognitive 16): surfaceIconPainter.resolve has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 2, match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/surface_icons.go"},"region":{"startLine":213}}}],"partialFingerprints":{"codehealthFindingId/v1":"9fabcab7dbc2875533e9b0fef7784768b2c9f68925f9a9b4e3d3702e3886038d"}},{"ruleId":"D2","level":"warning","message":{"text":"nativeSurfaceSVGWriter.paint (cognitive 16): nativeSurfaceSVGWriter.paint has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 pts), match/switch 2, loops 1 (nesting depth added 4). Of this number, 12 points are the body\u0027s own statements and 4 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/vector_surface_svg.go"},"region":{"startLine":280}}}],"partialFingerprints":{"codehealthFindingId/v1":"ed0927c2515e8b1dc5158d581b7793d1cef3265fcacd13bc9660db7d618b99fc"}},{"ruleId":"D2","level":"warning","message":{"text":"retainedVectorValidator.text (cognitive 16): retainedVectorValidator.text has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/vector_validation.go"},"region":{"startLine":392}}}],"partialFingerprints":{"codehealthFindingId/v1":"846cae2473e801aabd4811292721b5b8ff38d036b0b93e981e9f98d2e6532a2f"}},{"ruleId":"D2","level":"warning","message":{"text":"d2scenebuild.validateConnectionNumbers (cognitive 16): d2scenebuild.validateConnectionNumbers has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 3 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/build.go"},"region":{"startLine":1162}}}],"partialFingerprints":{"codehealthFindingId/v1":"66ae754811ee6825d8bc3d766c63c1112ae4727b2d46acd911d2acf8c6729a83"}},{"ruleId":"D2","level":"warning","message":{"text":"builder.sketchArrowhead (cognitive 16): builder.sketchArrowhead has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 2 (3 pts) (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/d2scenebuild/sketch_connection.go"},"region":{"startLine":36}}}],"partialFingerprints":{"codehealthFindingId/v1":"1b9977c223fb922b3c1d4d9d7742c3e2ed3e80944363e3eabe2cf012b277e441"}},{"ruleId":"D2","level":"warning","message":{"text":"d2sketch.Paths (cognitive 16): d2sketch.Paths has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 3 (5 pts), 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":293}}}],"partialFingerprints":{"codehealthFindingId/v1":"accc60f4183cc15714e595d7efdab2d7b8e9f80df471136d332723d166f6ccd1"}},{"ruleId":"D2","level":"warning","message":{"text":"d2svgimport.inspectEmbeddedPNG (cognitive 16): d2svgimport.inspectEmbeddedPNG has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svgimport/image.go"},"region":{"startLine":464}}}],"partialFingerprints":{"codehealthFindingId/v1":"5e882d9c846dca604aafbdabff08abad0b9af36b41d8c83befd0ebc3fc492d69"}},{"ruleId":"D2","level":"warning","message":{"text":"svgImporter.ignoredNamespacedAttribute (cognitive 16): svgImporter.ignoredNamespacedAttribute has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 3, match/switch 2 (3 pts) (nesting depth added 6). The drivers above price the dispatch low by construction \u2014 a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full \u2014 so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svgimport/boilerplate.go"},"region":{"startLine":203}}}],"partialFingerprints":{"codehealthFindingId/v1":"df614dd9a7d92e4e980cd6c3ab728df39ceca7b198319ed773ff3479853e1597"}},{"ruleId":"D2","level":"warning","message":{"text":"d2target.ToArrowhead (cognitive 16): d2target.ToArrowhead has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), 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":1133}}}],"partialFingerprints":{"codehealthFindingId/v1":"d6f74f30b58434008f1f7cda31dbd402851ed466655eeeee7fccd480ccf39302"}},{"ruleId":"D2","level":"warning","message":{"text":"d2target.validateRenderConnectionNumbers (cognitive 16): d2target.validateRenderConnectionNumbers has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 3 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2target/render_validation.go"},"region":{"startLine":308}}}],"partialFingerprints":{"codehealthFindingId/v1":"b6b7b16740f1931965dcf118990ed516c14e1a1354ec7f0dbafeacf97c759333"}},{"ruleId":"D2","level":"warning","message":{"text":"main.main (cognitive 16): main.main has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"e2etests/report/main.go"},"region":{"startLine":208}}}],"partialFingerprints":{"codehealthFindingId/v1":"789c5025931ccdd4683e4e810357a2e82b581fdd59869b0f875ad003a19ff680"}},{"ruleId":"D2","level":"warning","message":{"text":"utf8FontFile.getSymbols (cognitive 16): utf8FontFile.getSymbols has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 1 (2 pts) (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":474}}}],"partialFingerprints":{"codehealthFindingId/v1":"4276d75fbc0eca1d2b38efcaa2cca24aecb661a60b25f75c75839c2248096517"}},{"ruleId":"D2","level":"warning","message":{"text":"imageasset.New (cognitive 16): imageasset.New has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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":"lib/imageasset/imageasset.go"},"region":{"startLine":347}}}],"partialFingerprints":{"codehealthFindingId/v1":"9e55f1a845e64523af9c530fb0265bf8848cf539a73139797de1757dfa95bd4e"}},{"ruleId":"D2","level":"warning","message":{"text":"imageasset.readBounded (cognitive 16): imageasset.readBounded has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (15 pts), 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":"lib/imageasset/resolve.go"},"region":{"startLine":748}}}],"partialFingerprints":{"codehealthFindingId/v1":"b05a526f7ad2952d1558aa41ea4dd3c640e3bc8831a5cc2a5c88aad4d9b80d6d"}},{"ruleId":"D2","level":"warning","message":{"text":"imgbundler.findImageElementsForOptions (cognitive 16): imgbundler.findImageElementsForOptions has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), 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":"lib/imgbundler/imgbundler.go"},"region":{"startLine":254}}}],"partialFingerprints":{"codehealthFindingId/v1":"2de6bed3a101439bcbd21645842d7698677913422239a356767738929d24370a"}},{"ruleId":"D2","level":"warning","message":{"text":"xgif.animateImages (cognitive 16): xgif.animateImages has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 2 (nesting depth added 6). Of this number, 10 points are the body\u0027s own statements and 6 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/xgif/xgif.go"},"region":{"startLine":1246}}}],"partialFingerprints":{"codehealthFindingId/v1":"5253c0b83932bcb40ac4d08c93413796eaf6a02246c55c8cca68b40c853002b1"}},{"ruleId":"D2","level":"warning","message":{"text":"gifAssembler.appendCenteredFrame (cognitive 16): gifAssembler.appendCenteredFrame has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 4, loops 3 (nesting depth added 2). Of this number, 12 points are the body\u0027s own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body: 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":"lib/xgif/encode.go"},"region":{"startLine":350}}}],"partialFingerprints":{"codehealthFindingId/v1":"f094ac0f6a17b1c5509941f13d67d62226b5652682db33cb65a87c2636002743"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: packing.packGuarded: FunctionTooLong \u2014 packGuarded runs 629 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 529 over it, 6.29\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/packing/binpack.go"},"region":{"startLine":65}}}],"partialFingerprints":{"codehealthFindingId/v1":"64b4cd0ef51032042626237bf40602f79e7cc6f6ec10c772368aaa45f0c6acf3"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: placementcost.evaluateNodeEdgeLength: FunctionTooLong \u2014 evaluateNodeEdgeLength runs 586 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 486 over it, 5.86\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placementcost/edge_length.go"},"region":{"startLine":345}}}],"partialFingerprints":{"codehealthFindingId/v1":"02cf52951fea50af510270e69136c5f6e1fdfd7225532713a9348b9a841e23fb"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: Node: TooManyMethods \u2014 156 methods, declared across 13 files: layoutgraph/node.go (85), layoutgraph/placement_access.go (22), layoutgraph/hierarchy_access.go (10), layoutgraph/routing_access.go (10), \u002B9 more file(s). The bar is 30 methods; this is 126 over it, 5.20\u00D7 the bar. 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":"d2layouts/d2talalayout/internal/layoutgraph/node.go"},"region":{"startLine":610}}}],"partialFingerprints":{"codehealthFindingId/v1":"633d25d671328e7db0e5b294ed756e8c73e4ab69dec488cb67e3c8f439c849fc"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: layoutgraph.validateEngineGraph: FunctionTooLong \u2014 validateEngineGraph runs 507 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 407 over it, 5.07\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/topology_preflight.go"},"region":{"startLine":510}}}],"partialFingerprints":{"codehealthFindingId/v1":"28d1dc008911bd203a47170845ded39f64a90677d01b9fc74b2e289ea682dfaa"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: d2svg/d2svg.go: FileTooLong \u2014 2497 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1997 over it, 4.99\u00D7 the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file 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":"MethodTooLong: ovgEdgeRouter.search: MethodTooLong \u2014 search runs 495 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 395 over it, 4.95\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/ovg_edge_router.go"},"region":{"startLine":558}}}],"partialFingerprints":{"codehealthFindingId/v1":"bf98634fb32bc4585e7f0378c9a9e0d18b877e919ff63cc6292c65708ea9e2ae"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: d2oracle/edit.go: FileTooLong \u2014 2212 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1712 over it, 4.42\u00D7 the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file 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":"FunctionTooLong: d2svg.drawShape: FunctionTooLong \u2014 drawShape runs 418 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 318 over it, 4.18\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svg/d2svg.go"},"region":{"startLine":1688}}}],"partialFingerprints":{"codehealthFindingId/v1":"57a2518221daf49a29c47a96d4429e8b1916d8b38729d853fb79d274f2a35135"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: d2oracle._set: FunctionTooLong \u2014 _set runs 394 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 294 over it, 3.94\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2oracle/edit.go"},"region":{"startLine":327}}}],"partialFingerprints":{"codehealthFindingId/v1":"005c8510271be12075abafc320a757483069aef7645ee506bd70cf9158ad05e8"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: builder: TooManyMethods \u2014 104 methods, declared across 19 files: d2scenebuild/sketch_shapes.go (14), d2scenebuild/assets.go (10), d2scenebuild/markdown.go (9), d2scenebuild/build.go (8), \u002B15 more file(s). The bar is 30 methods; this is 74 over it, 3.47\u00D7 the bar. 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":"d2renderers/d2scenebuild/build.go"},"region":{"startLine":122}}}],"partialFingerprints":{"codehealthFindingId/v1":"b54cd228db79075b174b288f249332504efba42a141d630aa422cbdc9fa40380"}},{"ruleId":"D3","level":"warning","message":{"text":"ClassTooLong: compiler: ClassTooLong \u2014 1358 significant lines (blank, comment-only and punctuation-only lines excluded), 54 methods, 35 blocks, lines 33-2373. The bar is 400 significant lines; this is 958 over it, 3.40\u00D7 the bar. 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":33}}}],"partialFingerprints":{"codehealthFindingId/v1":"e874631efe6c8af3b461fff52c8c109db885d26a223ba97c7ad9e60523adb43a"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: Graph: TooManyMethods \u2014 94 methods, declared across 16 files: layoutgraph/graph.go (41), layoutgraph/placement_access.go (9), layoutgraph/layout.go (8), layoutgraph/hierarchy_access.go (6), \u002B12 more file(s). The bar is 30 methods; this is 64 over it, 3.13\u00D7 the bar. 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":"d2layouts/d2talalayout/internal/layoutgraph/graph.go"},"region":{"startLine":25}}}],"partialFingerprints":{"codehealthFindingId/v1":"2c66a40fcc21d1f75edd19b6656ff7916ca32d301c43d51219182f17819ea2a9"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: d2ir/compile.go: FileTooLong \u2014 1566 significant lines (blank, comment-only and punctuation-only lines excluded), about 87% of them inside a single declaration: compiler (35 blocks, 33-2373). The bar is 500 significant lines; this is 1066 over it, 3.13\u00D7 the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body \u2014 the parts that share the same inputs and are named together \u2014 into its own unit in a sibling file, and have the original call them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ir/compile.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"33919f3e8cafc21414fb3f96f86306b3ad0c36a9755976dd2dc60723896412f3"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: d2ir/d2ir.go: FileTooLong \u2014 1564 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1064 over it, 3.13\u00D7 the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file 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":"MethodTooLong: Ruler.measureMarkdownNode: MethodTooLong \u2014 measureMarkdownNode runs 311 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 211 over it, 3.11\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/textmeasure/markdown.go"},"region":{"startLine":330}}}],"partialFingerprints":{"codehealthFindingId/v1":"67f2e13b6cbdc6ee6279ab94a41b1aa8062130fb5a4cef7b35220b21214f94f3"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: graphjson.deserializeGraphContext: FunctionTooLong \u2014 deserializeGraphContext runs 308 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 208 over it, 3.08\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/graphjson/codec.go"},"region":{"startLine":1035}}}],"partialFingerprints":{"codehealthFindingId/v1":"76e118e4f682cffa85f2493fadedaa0bdd59c14399417ce4953d6373b3252ad9"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: d2oracle.move: FunctionTooLong \u2014 move runs 298 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 198 over it, 2.98\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2oracle/edit.go"},"region":{"startLine":1765}}}],"partialFingerprints":{"codehealthFindingId/v1":"7cb64b038a5854df02d6fc875a1eda9e8f58192b62bedb96fde0be54e2c24d99"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: placement.Dejitter: FunctionTooLong \u2014 Dejitter runs 297 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 197 over it, 2.97\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/dejitter.go"},"region":{"startLine":16}}}],"partialFingerprints":{"codehealthFindingId/v1":"78a9f2645545a1b914105670d8e9326ae812940cad48f242ef28d0c08ab081f5"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: d2elklayout.Layout: FunctionTooLong \u2014 Layout runs 290 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 190 over it, 2.90\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2elklayout/layout.go"},"region":{"startLine":257}}}],"partialFingerprints":{"codehealthFindingId/v1":"758cfbeda3ef1a89e772db7e4ef61e5b54c3b51be9c65236043537d0ef49086c"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: labeling.place: FunctionTooLong \u2014 place runs 286 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 186 over it, 2.86\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/labeling/placement.go"},"region":{"startLine":28}}}],"partialFingerprints":{"codehealthFindingId/v1":"779b64e3273826883711efd02b8601ddc9435dd789166ce85388141989953a6b"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: textmeasure/markdown_svg.go: FileTooLong \u2014 1429 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 929 over it, 2.86\u00D7 the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file 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/textmeasure/markdown_svg.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"79078f8e244d1bff5e7119b519ac78e3b7aa5d0f8b416ff5e1df7f69e4bf934c"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: layoutgraph/node.go: FileTooLong \u2014 1428 significant lines (blank, comment-only and punctuation-only lines excluded), about 74% of them inside a single declaration: Node (86 blocks, 29-2443). The bar is 500 significant lines; this is 928 over it, 2.86\u00D7 the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body \u2014 the parts that share the same inputs and are named together \u2014 into its own unit in a sibling file, and have the original call them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/node.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"8f69b5ba10165c3aad8ca690d997006b8e32eceac6eef97ea0261def54a196d5"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: d2svg.arrowheadMarker: FunctionTooLong \u2014 arrowheadMarker runs 284 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 184 over it, 2.84\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svg/d2svg.go"},"region":{"startLine":531}}}],"partialFingerprints":{"codehealthFindingId/v1":"67debe704aae61a1b5efe3bead170114155bfec6d0b00ea804d2478ad6f533a6"}},{"ruleId":"D3","level":"warning","message":{"text":"ClassTooLong: parser: ClassTooLong \u2014 1114 significant lines (blank, comment-only and punctuation-only lines excluded), 35 methods, 36 blocks, lines 159-1930. The bar is 400 significant lines; this is 714 over it, 2.79\u00D7 the bar. 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":159}}}],"partialFingerprints":{"codehealthFindingId/v1":"f8ec6ea0d7e4fdd86e8e8489e7eddc4655318794562c7011f5a6cd75e085ef9a"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: d2compiler/compile.go: FileTooLong \u2014 1384 significant lines (blank, comment-only and punctuation-only lines excluded), about 75% of them inside a single declaration: compiler (31 blocks, 145-1998). The bar is 500 significant lines; this is 884 over it, 2.77\u00D7 the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body \u2014 the parts that share the same inputs and are named together \u2014 into its own unit in a sibling file, and have the original call them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2compiler/compile.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"9774c1184ad55023f9c79721babb3ba0676a36010e6cf5b92e6c89c0945955bc"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: d2cli.Run: FunctionTooLong \u2014 Run runs 276 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 176 over it, 2.76\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2cli/main.go"},"region":{"startLine":62}}}],"partialFingerprints":{"codehealthFindingId/v1":"8626cbce4d1a45cbadf4d4190edb64f93f25d34eeec07b6b6d2d124deda6dbdd"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: d2svg.renderValidated: FunctionTooLong \u2014 renderValidated runs 267 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 167 over it, 2.67\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svg/d2svg.go"},"region":{"startLine":2896}}}],"partialFingerprints":{"codehealthFindingId/v1":"69f001cdc7401c268e877472554bbded227718a78315ee392efbaac153e627da"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: d2talalayout.translateGraph: FunctionTooLong \u2014 translateGraph runs 264 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 164 over it, 2.64\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/adapter.go"},"region":{"startLine":116}}}],"partialFingerprints":{"codehealthFindingId/v1":"cfa2e081fbff1ac9cc60705e6aedaf9d23cc27aac740fb5094bf8f384f170163"}},{"ruleId":"D3","level":"warning","message":{"text":"ClassTooLong: Node: ClassTooLong \u2014 1050 significant lines (blank, comment-only and punctuation-only lines excluded), 156 methods, 86 blocks, lines 29-2443. The bar is 400 significant lines; this is 650 over it, 2.63\u00D7 the bar. 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":"d2layouts/d2talalayout/internal/layoutgraph/node.go"},"region":{"startLine":610}}}],"partialFingerprints":{"codehealthFindingId/v1":"2238e5d7fe4772ade0779a0a4ebe381049d26fb04a3a40541ddde668b2335452"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: placement.reduceGapToNeighbors: FunctionTooLong \u2014 reduceGapToNeighbors runs 261 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 161 over it, 2.61\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/gapreduction.go"},"region":{"startLine":273}}}],"partialFingerprints":{"codehealthFindingId/v1":"b6f45c39ee72ba138cccf59b2f290767772b71ed75193dfc39a22e3f70a01ad2"}},{"ruleId":"D3","level":"warning","message":{"text":"ClassTooLong: compiler: ClassTooLong \u2014 1036 significant lines (blank, comment-only and punctuation-only lines excluded), 30 methods, 31 blocks, lines 145-1998. The bar is 400 significant lines; this is 636 over it, 2.59\u00D7 the bar. 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":"d2compiler/compile.go"},"region":{"startLine":420}}}],"partialFingerprints":{"codehealthFindingId/v1":"21c56f378b37be37239698578ec0efd503e7864a783407dc43d10243eac81679"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: layoutgraph.validateCombineNodeTopology: FunctionTooLong \u2014 validateCombineNodeTopology runs 258 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 158 over it, 2.58\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/topology_preflight.go"},"region":{"startLine":129}}}],"partialFingerprints":{"codehealthFindingId/v1":"91f77009c9e981e617aec844a79619e94e864ed48a1ce11b969351510c8b1d9c"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: d2parser/parse.go: FileTooLong \u2014 1287 significant lines (blank, comment-only and punctuation-only lines excluded), about 87% of them inside a single declaration: parser (36 blocks, 159-1930). The bar is 500 significant lines; this is 787 over it, 2.57\u00D7 the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body \u2014 the parts that share the same inputs and are named together \u2014 into its own unit in a sibling file, and have the original call them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2parser/parse.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"fcf17968b74d6bfa4a9e719ae23abcca04d5d04b6b01e28fdaa400419ab437f2"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: d2graph/d2graph.go: FileTooLong \u2014 1286 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 786 over it, 2.57\u00D7 the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file 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: d2raster/effects.go: FileTooLong \u2014 1277 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 777 over it, 2.55\u00D7 the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file 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/d2raster/effects.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"f2fa2ba620cc2070ca943e4240b7b11d068a541ac729d3330683e704c96f5056"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: routing/coordinator.go: FileTooLong \u2014 1269 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 769 over it, 2.54\u00D7 the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file 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/d2talalayout/internal/routing/coordinator.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"c7e6b18036c3b50d3af9fb50eba925aed83c5d9706044ec46c12d34752555d74"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: layoutgraph.collectRuntimeObjectsContext: FunctionTooLong \u2014 collectRuntimeObjectsContext runs 252 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 152 over it, 2.52\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/transaction_snapshot.go"},"region":{"startLine":362}}}],"partialFingerprints":{"codehealthFindingId/v1":"87724f96f4fd4dbc01d5f186b320bc870943d66962c0fa15ac5b262839367fa7"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: d2dagrelayout/layout.go: FileTooLong \u2014 1230 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 730 over it, 2.46\u00D7 the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file 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":"FunctionTooLong: routing.balanceRegularEdgesGuarded: FunctionTooLong \u2014 balanceRegularEdgesGuarded runs 246 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 146 over it, 2.46\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/postprocess.go"},"region":{"startLine":70}}}],"partialFingerprints":{"codehealthFindingId/v1":"4587a4223414d74c0103fb5335c33c1c33c0d795df2340dcb6915eecb786e371"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: routing.routeLineChecked: FunctionTooLong \u2014 routeLineChecked runs 239 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 139 over it, 2.39\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/coordinator.go"},"region":{"startLine":844}}}],"partialFingerprints":{"codehealthFindingId/v1":"af18604867e51668cbeccb37d01bc154f01c29539ca9aba7d878f9367a1e90cd"}},{"ruleId":"D3","level":"warning","message":{"text":"ClassTooLong: OVG: ClassTooLong \u2014 945 significant lines (blank, comment-only and punctuation-only lines excluded), 34 methods, 28 blocks, lines 18-1753. The bar is 400 significant lines; this is 545 over it, 2.36\u00D7 the bar. 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":"d2layouts/d2talalayout/internal/routing/ovg.go"},"region":{"startLine":18}}}],"partialFingerprints":{"codehealthFindingId/v1":"1e073c92547c59fc72ab8a2e5d254f05441294d9f7b9a8d40111f75fda190376"}},{"ruleId":"D3","level":"warning","message":{"text":"ClassTooLong: ovgEdgeRouter: ClassTooLong \u2014 939 significant lines (blank, comment-only and punctuation-only lines excluded), 20 methods, 13 blocks, lines 46-1832. The bar is 400 significant lines; this is 539 over it, 2.35\u00D7 the bar. 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":"d2layouts/d2talalayout/internal/routing/ovg_edge_router.go"},"region":{"startLine":46}}}],"partialFingerprints":{"codehealthFindingId/v1":"6c96aef71c9ac1086415079616478f22d3a471eee528df67e99f96287e6f2be3"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: svgImporter: TooManyMethods \u2014 69 methods, declared across 11 files: d2svgimport/gradient.go (10), d2svgimport/compile.go (8), d2svgimport/import.go (8), d2svgimport/clip.go (7), \u002B7 more file(s). The bar is 30 methods; this is 39 over it, 2.30\u00D7 the bar. 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":"d2renderers/d2svgimport/import.go"},"region":{"startLine":350}}}],"partialFingerprints":{"codehealthFindingId/v1":"41a7d5088e5ac7e6a65baabed060193deab237e712f9799e28e1866c60d87f7c"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: xgif/xgif.go: FileTooLong \u2014 1143 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 643 over it, 2.29\u00D7 the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file 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/xgif/xgif.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"baea4318d43061e1f07d54d0dd80fa77c65b595ca2dd3dc16246701b468e3072"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: routing/ovg_edge_router.go: FileTooLong \u2014 1137 significant lines (blank, comment-only and punctuation-only lines excluded), about 83% of them inside a single declaration: ovgEdgeRouter (13 blocks, 46-1832). The bar is 500 significant lines; this is 637 over it, 2.27\u00D7 the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body \u2014 the parts that share the same inputs and are named together \u2014 into its own unit in a sibling file, and have the original call them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/ovg_edge_router.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"5dd91b6dc50fc09c2c1070c17103fddce8af1cae7d53c3831141bd1b4fc3bca4"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: meshBuilder: TooManyMethods \u2014 68 methods, declared across 19 files: d2isometricimg/geometry.go (11), d2isometricimg/native_shapes.go (9), d2isometricimg/arrow_visibility.go (7), d2isometricimg/native_solids.go (7), \u002B15 more file(s). The bar is 30 methods; this is 38 over it, 2.27\u00D7 the bar. 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":"d2renderers/d2isometric/d2isometricimg/geometry.go"},"region":{"startLine":40}}}],"partialFingerprints":{"codehealthFindingId/v1":"5e41348abd784aace3b5f5f8e161b9ee2f342ae139f3879dc8f694f2bf931288"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: d2cli.compile: FunctionTooLong \u2014 compile runs 226 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 126 over it, 2.26\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2cli/main.go"},"region":{"startLine":452}}}],"partialFingerprints":{"codehealthFindingId/v1":"9f7276b6956f78dc5f783980caebcd196e962e9437f6598ee21dd29b73c8d93e"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: grouping.AddClusters: FunctionTooLong \u2014 AddClusters runs 224 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 124 over it, 2.24\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/grouping/clusters.go"},"region":{"startLine":167}}}],"partialFingerprints":{"codehealthFindingId/v1":"49dc0a2c646cc91a1b676da03d0159a7a74e90be6f03d18ee9e35eeb88f9a858"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: d2raster/raster.go: FileTooLong \u2014 1118 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 618 over it, 2.24\u00D7 the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file 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/d2raster/raster.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"678050bc45defe92286b60e146539654e41ceccfd28ac4b38aaec77510190e3e"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: packing.CombineSubgraphs: FunctionTooLong \u2014 CombineSubgraphs runs 220 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 120 over it, 2.20\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/packing/combine.go"},"region":{"startLine":92}}}],"partialFingerprints":{"codehealthFindingId/v1":"259c664e1c28ede2946a08e252ba9a026239343e706e18b507a8be6f78b2d1d9"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: d2svg.drawConnection: FunctionTooLong \u2014 drawConnection runs 216 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 116 over it, 2.16\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svg/d2svg.go"},"region":{"startLine":1079}}}],"partialFingerprints":{"codehealthFindingId/v1":"acdbbeebfa5c445819938fc3e20ce0bc6f6606625cfc9d566c248f6b7b345959"}},{"ruleId":"D3","level":"warning","message":{"text":"MethodTooLong: compiler.compileReserved: MethodTooLong \u2014 compileReserved runs 215 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 115 over it, 2.15\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2compiler/compile.go"},"region":{"startLine":863}}}],"partialFingerprints":{"codehealthFindingId/v1":"984e98b47a100b94f42767b2835f543465107b5e39775b76b0fb4b4af9b10b82"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: Edge: TooManyMethods \u2014 64 methods, declared across 7 files: layoutgraph/edge.go (36), layoutgraph/routing_access.go (9), layoutgraph/hierarchy_access.go (7), layoutgraph/placement_access.go (6), \u002B3 more file(s). The bar is 30 methods; this is 34 over it, 2.13\u00D7 the bar. 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":"d2layouts/d2talalayout/internal/layoutgraph/edge.go"},"region":{"startLine":15}}}],"partialFingerprints":{"codehealthFindingId/v1":"3a0871bc6f7cf32db5ef6386e04fc7bdce5e38f0a30dd871ca353a8e563c788a"}},{"ruleId":"D3","level":"warning","message":{"text":"ClassTooLong: Map: ClassTooLong \u2014 844 significant lines (blank, comment-only and punctuation-only lines excluded), 63 methods, 45 blocks, lines 171-2451. The bar is 400 significant lines; this is 444 over it, 2.11\u00D7 the bar. 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":171}}}],"partialFingerprints":{"codehealthFindingId/v1":"51992c67baf2767fb4d427e1eb9931acb3268daf4ea833fa7e2a43b64ac964a4"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: routing/ovg.go: FileTooLong \u2014 1054 significant lines (blank, comment-only and punctuation-only lines excluded), about 90% of them inside a single declaration: OVG (28 blocks, 18-1753). The bar is 500 significant lines; this is 554 over it, 2.11\u00D7 the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body \u2014 the parts that share the same inputs and are named together \u2014 into its own unit in a sibling file, and have the original call them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/ovg.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"854743b27904fec3f329cb4da5b454c8eeb25a0561adb5111793c1233f5a54eb"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: Map: TooManyMethods \u2014 63 methods, declared across 4 files: d2ir/d2ir.go (54), d2ir/pattern.go (6), d2ir/query.go (2), d2ir/compile.go (1). The bar is 30 methods; this is 33 over it, 2.10\u00D7 the bar. 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":171}}}],"partialFingerprints":{"codehealthFindingId/v1":"16794e4cca76f1a9bc62d14d4ca882ddaaa02474ed16d10964c8b588f14ebc44"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: d2ast/d2ast.go: FileTooLong \u2014 1048 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 548 over it, 2.10\u00D7 the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file 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":"MethodTooLong: builder.resolveFontFallbacks: MethodTooLong \u2014 resolveFontFallbacks runs 208 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 108 over it, 2.08\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/font_fallback.go"},"region":{"startLine":131}}}],"partialFingerprints":{"codehealthFindingId/v1":"f04c12b2aea42cf19d49d3493298204ce7fd84c7c2a958c1ec6a83fe4dead8e3"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: graphjson.Serialize: FunctionTooLong \u2014 Serialize runs 207 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 107 over it, 2.07\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/graphjson/codec.go"},"region":{"startLine":262}}}],"partialFingerprints":{"codehealthFindingId/v1":"74bc586799130a6bfdedd5f85d9c0730d4f4c72ee874917b0db86e3161170b2e"}},{"ruleId":"D3","level":"warning","message":{"text":"MethodTooLong: ovgEdgeRouter.findSShapedRoute: MethodTooLong \u2014 findSShapedRoute runs 207 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 107 over it, 2.07\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/slingshot.go"},"region":{"startLine":891}}}],"partialFingerprints":{"codehealthFindingId/v1":"1622c0e9814ab09877ce898dd6c618fae97dafdc11463755b64e936e4d47b917"}},{"ruleId":"D3","level":"warning","message":{"text":"ClassTooLong: markdownPainter: ClassTooLong \u2014 822 significant lines (blank, comment-only and punctuation-only lines excluded), 21 methods, 22 blocks, lines 524-2040. The bar is 400 significant lines; this is 422 over it, 2.06\u00D7 the bar. 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":"lib/textmeasure/markdown_svg.go"},"region":{"startLine":524}}}],"partialFingerprints":{"codehealthFindingId/v1":"557d727f456c4f5fb7e4fecfbe1d6cdda8f047e87cda1d7a3b275cc9178242ff"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: graphjson/codec.go: FileTooLong \u2014 1023 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 523 over it, 2.05\u00D7 the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file 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/d2talalayout/internal/graphjson/codec.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"4fbc71a9fe7ed7b6de7f2b7d0116c98f3290afefe5f2af233c01bd17bbec15a4"}},{"ruleId":"D3","level":"warning","message":{"text":"MethodTooLong: ShapingWorkspace.ShapeTextTransient: MethodTooLong \u2014 ShapeTextTransient runs 202 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 102 over it, 2.02\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/internal/fontface/shaping.go"},"region":{"startLine":111}}}],"partialFingerprints":{"codehealthFindingId/v1":"7b750ddd800b6417239b91bbc14b02d46165afbfb066267b964aacbd21858602"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: d2raster/gradient.go: FileTooLong \u2014 996 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 496 over it, 1.99\u00D7 the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file 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/d2raster/gradient.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"92b285ff24d5318add79e85874aad534fc6a4ccfdac9b422947df0e03dc13972"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: d2target/d2target.go: FileTooLong \u2014 996 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 496 over it, 1.99\u00D7 the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file 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":"MethodTooLong: textPainter.texture: MethodTooLong \u2014 texture runs 198 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 98 over it, 1.98\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/text.go"},"region":{"startLine":145}}}],"partialFingerprints":{"codehealthFindingId/v1":"5d117c69f5b449fb132b62a695fcb6adfa96fe63b1818976e2b91c2e60dab6db"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: d2raster/image.go: FileTooLong \u2014 983 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 483 over it, 1.97\u00D7 the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file 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/d2raster/image.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"e5df4c7b24e4191830dfe32bdfd54d8648e87c4e87101dbc792baf2feb68276e"}},{"ruleId":"D3","level":"warning","message":{"text":"MethodTooLong: builder.buildDocument: MethodTooLong \u2014 buildDocument runs 189 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 89 over it, 1.89\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/build.go"},"region":{"startLine":542}}}],"partialFingerprints":{"codehealthFindingId/v1":"070b557092ae01206f290f5c01cf4a49d7dcf69458c30446f38af7f7de79c840"}},{"ruleId":"D3","level":"warning","message":{"text":"MethodTooLong: preflight.text: MethodTooLong \u2014 text runs 188 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 88 over it, 1.88\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/text.go"},"region":{"startLine":183}}}],"partialFingerprints":{"codehealthFindingId/v1":"dd204877db71ee710d9082b75fef86c15b53a5e93bb6ee7abda7f028701b3bda"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: labeling.findBestEdgeLabelPosition: FunctionTooLong \u2014 findBestEdgeLabelPosition runs 187 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 87 over it, 1.87\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/labeling/placement.go"},"region":{"startLine":687}}}],"partialFingerprints":{"codehealthFindingId/v1":"ac3bb78ff2238ad57e592e841c9ae82829e3c0f3d9e0202287375f0431580d08"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: d2isometricimg.classicInkSegments: FunctionTooLong \u2014 classicInkSegments runs 185 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 85 over it, 1.85\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/native_edges.go"},"region":{"startLine":102}}}],"partialFingerprints":{"codehealthFindingId/v1":"26287a6b93cac165e926f4560a35c8fbd406ba669f97c3e0cd2330f37dd70d1a"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: d2scenebuild/build.go: FileTooLong \u2014 923 significant lines (blank, comment-only and punctuation-only lines excluded), about 64% of them inside a single declaration: builder (9 blocks, 122-1364). The bar is 500 significant lines; this is 423 over it, 1.85\u00D7 the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body \u2014 the parts that share the same inputs and are named together \u2014 into its own unit in a sibling file, and have the original call them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/build.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"0d7a931258217783167d2552e242fac4576c3147ddc19ae279e5677e880381b1"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: layoutgraph/transaction.go: FileTooLong \u2014 913 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 413 over it, 1.83\u00D7 the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file 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/d2talalayout/internal/layoutgraph/transaction.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"4d45fdd7d2030eed418913a98c2b0f93ac9e1f44a52c44515d12292352d0c6be"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: graphjson.validateSerializedGraphForDeserialization: FunctionTooLong \u2014 validateSerializedGraphForDeserialization runs 181 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 81 over it, 1.81\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/graphjson/preflight.go"},"region":{"startLine":25}}}],"partialFingerprints":{"codehealthFindingId/v1":"c41cbd1d0f63509445cfec370ff98782fface013489c6aa8b2af2e6753dac3a5"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: scanline/rasterizer.go: FileTooLong \u2014 904 significant lines (blank, comment-only and punctuation-only lines excluded), about 78% of them inside a single declaration: Rasterizer (36 blocks, 99-1384). The bar is 500 significant lines; this is 404 over it, 1.81\u00D7 the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body \u2014 the parts that share the same inputs and are named together \u2014 into its own unit in a sibling file, and have the original call them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/internal/scanline/rasterizer.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"fd0badbbf282d3a3bb8b2ab617fefaa83d556c0fa663445c1f475956ed676e28"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: d2raster/filter.go: FileTooLong \u2014 903 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 403 over it, 1.81\u00D7 the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file 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/d2raster/filter.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"32acbdbefb7c4f104bd79112f7b0201689e07ad5ddee0bfeae049e7846654d18"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: compiler: TooManyMethods \u2014 54 methods, declared across 6 files: d2ir/compile.go (34), d2ir/import.go (7), d2ir/expansion.go (5), d2ir/glob_expansion.go (5), \u002B2 more file(s). The bar is 30 methods; this is 24 over it, 1.80\u00D7 the bar. 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":33}}}],"partialFingerprints":{"codehealthFindingId/v1":"0fe9aa9a9f5b516068cfefeec5e930c264a4f84ea5b484a543e52b5e6afe4ab2"}},{"ruleId":"D3","level":"warning","message":{"text":"MethodTooLong: builder.arrowhead: MethodTooLong \u2014 arrowhead runs 179 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 79 over it, 1.79\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/connection.go"},"region":{"startLine":430}}}],"partialFingerprints":{"codehealthFindingId/v1":"d8b5e187addf49da05156f4b950b950848030b79881f3d6cb145525bb2544523"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: d2cli/main.go: FileTooLong \u2014 886 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 386 over it, 1.77\u00D7 the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file 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":"FunctionTooLong: d2svg.embedFonts: FunctionTooLong \u2014 embedFonts runs 177 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 77 over it, 1.77\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svg/d2svg.go"},"region":{"startLine":2492}}}],"partialFingerprints":{"codehealthFindingId/v1":"1a678eee253323748498f275e821da8ad706192bb556e5d093cdcbfff307b448"}},{"ruleId":"D3","level":"warning","message":{"text":"ClassTooLong: Rasterizer: ClassTooLong \u2014 707 significant lines (blank, comment-only and punctuation-only lines excluded), 35 methods, 36 blocks, lines 99-1384. The bar is 400 significant lines; this is 307 over it, 1.77\u00D7 the bar. 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":"d2renderers/d2raster/internal/scanline/rasterizer.go"},"region":{"startLine":99}}}],"partialFingerprints":{"codehealthFindingId/v1":"84a53992d28d01269edc4d55e63f3970c1bce04552dfdba42695463a72624d6a"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: d2layouts.LayoutNested: FunctionTooLong \u2014 LayoutNested runs 176 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 76 over it, 1.76\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2layouts.go"},"region":{"startLine":78}}}],"partialFingerprints":{"codehealthFindingId/v1":"d6e90abe5217061b2cbb56fa560b8123af6218bea8f6d6ed9f9c2ee88acc51f8"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: placement.optimizeClusterWithRollback: FunctionTooLong \u2014 optimizeClusterWithRollback runs 176 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 76 over it, 1.76\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/cluster_optimization.go"},"region":{"startLine":148}}}],"partialFingerprints":{"codehealthFindingId/v1":"7fc3b76ec6774648fa330e4f6f7577adb5485e27f7f6ffe26b645c4b49d99328"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: packing/binpack.go: FileTooLong \u2014 861 significant lines (blank, comment-only and punctuation-only lines excluded), about 73% of them inside a single declaration: packGuarded (65-1013). The bar is 500 significant lines; this is 361 over it, 1.72\u00D7 the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body \u2014 the parts that share the same inputs and are named together \u2014 into its own unit in a sibling file, and have the original call them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/packing/binpack.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"3899fdb2354940aefee294d89f1558f4f57bb0e19316176cb89e20ea791d7914"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: grouping.JoinDistancedClusters: FunctionTooLong \u2014 JoinDistancedClusters runs 172 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 72 over it, 1.72\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/grouping/join.go"},"region":{"startLine":142}}}],"partialFingerprints":{"codehealthFindingId/v1":"48443b7268e0ff1ecaa94b1cb49cd315e72ab0ffa8a9e731fa84af6a9450192d"}},{"ruleId":"D3","level":"warning","message":{"text":"MethodTooLong: svgImporter.computeStyle: MethodTooLong \u2014 computeStyle runs 172 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 72 over it, 1.72\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svgimport/style.go"},"region":{"startLine":266}}}],"partialFingerprints":{"codehealthFindingId/v1":"0eabeceab37dbc9e18d5c51214d82061b9ba272fdac41a42932c2e7bdde1cbe5"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: d2isometricimg.nativeResolveLaneRoutes: FunctionTooLong \u2014 nativeResolveLaneRoutes runs 171 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 71 over it, 1.71\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/route_lanes.go"},"region":{"startLine":63}}}],"partialFingerprints":{"codehealthFindingId/v1":"c230c509a6f3041856ef2f20f57efca6b0e2ca9c6f651eb9701c74c97181cc09"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: layoutgraph/topology_preflight.go: FileTooLong \u2014 851 significant lines (blank, comment-only and punctuation-only lines excluded), about 60% of them inside a single declaration: validateEngineGraph (510-1282). The bar is 500 significant lines; this is 351 over it, 1.70\u00D7 the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body \u2014 the parts that share the same inputs and are named together \u2014 into its own unit in a sibling file, and have the original call them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/topology_preflight.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"07033ea7ddf19e587bcf1e22f1c139b35ae13abdc34024c146c3c7fb7a7d640b"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: placement.equidistanceNodeGuarded: FunctionTooLong \u2014 equidistanceNodeGuarded runs 167 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 67 over it, 1.67\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/equidistance.go"},"region":{"startLine":103}}}],"partialFingerprints":{"codehealthFindingId/v1":"2a9c91de0dd76fc34757b01f0d30c8023d43a39324cbc5b8f896758104f6a866"}},{"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). The bar is 30 methods; this is 20 over it, 1.67\u00D7 the bar. 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":163}}}],"partialFingerprints":{"codehealthFindingId/v1":"0b996f3419dc473b48b9820e56c7d4609625bb056c0d857d544a876a91f0bfc0"}},{"ruleId":"D3","level":"warning","message":{"text":"ClassTooLong: Graph: ClassTooLong \u2014 655 significant lines (blank, comment-only and punctuation-only lines excluded), 94 methods, 42 blocks, lines 25-1255. The bar is 400 significant lines; this is 255 over it, 1.64\u00D7 the bar. 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":"d2layouts/d2talalayout/internal/layoutgraph/graph.go"},"region":{"startLine":25}}}],"partialFingerprints":{"codehealthFindingId/v1":"d66031d32d73095fe6b153b441ad08c6476bceccf6f5208131695d59374fa1e0"}},{"ruleId":"D3","level":"warning","message":{"text":"MethodTooLong: Map.ensureField: MethodTooLong \u2014 ensureField runs 163 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 63 over it, 1.63\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ir/d2ir.go"},"region":{"startLine":1216}}}],"partialFingerprints":{"codehealthFindingId/v1":"c540bed422abae5c91c720bac170371491bf7652fa01e6d258bc635fec35fb22"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: d2elklayout.ConvertGraph: FunctionTooLong \u2014 ConvertGraph runs 163 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 63 over it, 1.63\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2elklayout/wasm.go"},"region":{"startLine":23}}}],"partialFingerprints":{"codehealthFindingId/v1":"a0309f7e6de2077d30e333e1b923f65468656d4100eb02f5da1ad8b7ce643863"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: placementcost/edge_length.go: FileTooLong \u2014 814 significant lines (blank, comment-only and punctuation-only lines excluded), about 72% of them inside a single declaration: evaluateNodeEdgeLength (345-1333). The bar is 500 significant lines; this is 314 over it, 1.63\u00D7 the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body \u2014 the parts that share the same inputs and are named together \u2014 into its own unit in a sibling file, and have the original call them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placementcost/edge_length.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"f0aa0debe2c1f6028c5ee393fc3835c611b50f1b54b1f853b915f0fe4923608f"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: placementcost.nodeSymmetry: FunctionTooLong \u2014 nodeSymmetry runs 161 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 61 over it, 1.61\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placementcost/symmetry.go"},"region":{"startLine":94}}}],"partialFingerprints":{"codehealthFindingId/v1":"1fcd8306f5df6eaf1b9e4e3ddd99a80df07d8d0536e252e64a1aa872f43c986f"}},{"ruleId":"D3","level":"warning","message":{"text":"MethodTooLong: Rasterizer.DrawRGBA: MethodTooLong \u2014 DrawRGBA runs 160 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 60 over it, 1.60\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/internal/scanline/rasterizer.go"},"region":{"startLine":491}}}],"partialFingerprints":{"codehealthFindingId/v1":"f67f439f3b9ea3bd144a6b71d435079d6154d2411dd4d725b52c3a937e8c3803"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: labeling/placement.go: FileTooLong \u2014 799 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 299 over it, 1.60\u00D7 the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file 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/d2talalayout/internal/labeling/placement.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"91de2afeccd4e16625d1ec2b6431346fa58e3f949fad770cf3df82224ccffdab"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: d2cli/raster.go: FileTooLong \u2014 782 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 282 over it, 1.56\u00D7 the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file 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/raster.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"f8071accb0d8e2f30e8b1e698521566bdc755afdc61727875951f050926870c0"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: routing/slingshot.go: FileTooLong \u2014 775 significant lines (blank, comment-only and punctuation-only lines excluded), about 73% of them inside a single declaration: ovgEdgeRouter (8 blocks, 44-1189). The bar is 500 significant lines; this is 275 over it, 1.55\u00D7 the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body \u2014 the parts that share the same inputs and are named together \u2014 into its own unit in a sibling file, and have the original call them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/slingshot.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"adbb3f060013cde3510557df39991bff91a47feb0f080d20c28c8b362502b11e"}},{"ruleId":"D3","level":"warning","message":{"text":"MethodTooLong: compiler.ampersandFilter: MethodTooLong \u2014 ampersandFilter runs 154 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 54 over it, 1.54\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ir/compile.go"},"region":{"startLine":1364}}}],"partialFingerprints":{"codehealthFindingId/v1":"15ad8f0f60f39fc56709bbd21af4912d6da80959bd017e62284898f62c088257"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: placement.swapOptimize: FunctionTooLong \u2014 swapOptimize runs 154 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 54 over it, 1.54\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/swap.go"},"region":{"startLine":60}}}],"partialFingerprints":{"codehealthFindingId/v1":"e9f84ba55481f45a04f2a28ef6a22160e6c25c0a95b6db6fcab68a8961e1e301"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: quality.scoreExistingLabelPlacements: FunctionTooLong \u2014 scoreExistingLabelPlacements runs 154 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 54 over it, 1.54\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/quality/labels.go"},"region":{"startLine":16}}}],"partialFingerprints":{"codehealthFindingId/v1":"ad11ed81e659adfe3332fea0c9c4d5151c606541e055f1340a478cf96ff11952"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: d2elklayout/layout.go: FileTooLong \u2014 769 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 269 over it, 1.54\u00D7 the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file 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":"FunctionTooLong: placement.transpose: FunctionTooLong \u2014 transpose runs 152 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 52 over it, 1.52\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/transpose.go"},"region":{"startLine":35}}}],"partialFingerprints":{"codehealthFindingId/v1":"802d182f26a9291015590a6b32fce0befe1b31397f27eaed0d54b7bfd12d7b84"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: d2isometricimg/raster.go: FileTooLong \u2014 755 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 255 over it, 1.51\u00D7 the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file 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/d2isometric/d2isometricimg/raster.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"01e959ebd5d44f9dc9f702de138969d55e12b76a740e52c22c8f58e41b6c51e5"}},{"ruleId":"D3","level":"warning","message":{"text":"ClassTooLong: sizedOptimizer: ClassTooLong \u2014 603 significant lines (blank, comment-only and punctuation-only lines excluded), 17 methods, 13 blocks, lines 19-1200. The bar is 400 significant lines; this is 203 over it, 1.51\u00D7 the bar. 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":"d2layouts/d2talalayout/internal/placement/sized_optimizer.go"},"region":{"startLine":19}}}],"partialFingerprints":{"codehealthFindingId/v1":"eb6fa638c03f362bfff2ce92e450f3377862a67537a1a73b4c40c46556cc4a94"}},{"ruleId":"D3","level":"warning","message":{"text":"MethodTooLong: ovgEdgeRouter.findLShapedRoute: MethodTooLong \u2014 findLShapedRoute runs 150 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 50 over it, 1.50\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/slingshot.go"},"region":{"startLine":666}}}],"partialFingerprints":{"codehealthFindingId/v1":"6e44c2bac60eb2f07a32ef82ff2acf7aba29b2463bcaef362dac696d35234ea3"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: placement/sized_optimizer.go: FileTooLong \u2014 747 significant lines (blank, comment-only and punctuation-only lines excluded), about 81% of them inside a single declaration: sizedOptimizer (13 blocks, 19-1200). The bar is 500 significant lines; this is 247 over it, 1.49\u00D7 the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body \u2014 the parts that share the same inputs and are named together \u2014 into its own unit in a sibling file, and have the original call them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/sized_optimizer.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"ac6c29a97091ee3259fe6c40ae6f34d4881e54fac23ea061d25f90c45b23c4cf"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: routing.fixClusterEdgeBranchingGuarded: FunctionTooLong \u2014 fixClusterEdgeBranchingGuarded runs 149 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 49 over it, 1.49\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/postprocess.go"},"region":{"startLine":472}}}],"partialFingerprints":{"codehealthFindingId/v1":"730b7e7fddc0de8caef6c441b87a3ef4fd2d5d58939012163df4727b71132315"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: d2isometricimg.newNativeSceneWithOptions: FunctionTooLong \u2014 newNativeSceneWithOptions runs 149 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 49 over it, 1.49\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/geometry.go"},"region":{"startLine":431}}}],"partialFingerprints":{"codehealthFindingId/v1":"2d10e406cdef04299861a0d6d0d83ce2575037c9909de0dfc6905a221245211e"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: d2isometricimg.svgVisibleFacesWithLimits: FunctionTooLong \u2014 svgVisibleFacesWithLimits runs 149 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 49 over it, 1.49\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/svg_visibility.go"},"region":{"startLine":343}}}],"partialFingerprints":{"codehealthFindingId/v1":"9efebe0c63611a7a451a70bfbd90315d228e6985915633f0231433dae4f60fe9"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: layoutgraph/graph.go: FileTooLong \u2014 744 significant lines (blank, comment-only and punctuation-only lines excluded), about 88% of them inside a single declaration: Graph (42 blocks, 25-1255). The bar is 500 significant lines; this is 244 over it, 1.49\u00D7 the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body \u2014 the parts that share the same inputs and are named together \u2014 into its own unit in a sibling file, and have the original call them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/graph.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"9052da9b3e0e9f57c3489cd1d1637e910dec648ac5ae783bd44cf03815091fb6"}},{"ruleId":"D3","level":"warning","message":{"text":"ClassTooLong: builder: ClassTooLong \u2014 594 significant lines (blank, comment-only and punctuation-only lines excluded), 104 methods, 9 blocks, lines 122-1364. The bar is 400 significant lines; this is 194 over it, 1.49\u00D7 the bar. 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":"d2renderers/d2scenebuild/build.go"},"region":{"startLine":122}}}],"partialFingerprints":{"codehealthFindingId/v1":"5f6352a774288b27ca027e2c0bacdef4e0ad97c6bf231a36a195e849a456d179"}},{"ruleId":"D3","level":"warning","message":{"text":"MethodTooLong: svgImporter.instantiate: MethodTooLong \u2014 instantiate runs 147 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 47 over it, 1.47\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svgimport/compile.go"},"region":{"startLine":386}}}],"partialFingerprints":{"codehealthFindingId/v1":"50fcbecf15594c4e955ba0774b3b3eca242e538a64e9a79cd4e254c57f2e0b99"}},{"ruleId":"D3","level":"warning","message":{"text":"MethodTooLong: compiler.resolveSubstitutions: MethodTooLong \u2014 resolveSubstitutions runs 146 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 46 over it, 1.46\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ir/compile.go"},"region":{"startLine":415}}}],"partialFingerprints":{"codehealthFindingId/v1":"87aa101168a51299f4a343712ae66c2710c4b15a7c4d84ba6f2409813be668d7"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: d2elklayout.deleteBends: FunctionTooLong \u2014 deleteBends runs 146 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 46 over it, 1.46\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2elklayout/layout.go"},"region":{"startLine":770}}}],"partialFingerprints":{"codehealthFindingId/v1":"0bf960b58e1194cc6049071d5c26e0a7e4ee99ad74640ea8629a5c3287949870"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: d2fonts.init: FunctionTooLong \u2014 init runs 146 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 46 over it, 1.46\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2fonts/d2fonts_embed.go"},"region":{"startLine":46}}}],"partialFingerprints":{"codehealthFindingId/v1":"eb9c952142677c1dfe415d2205322549a42a9ea33179b6735fab9e3676843edc"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: labeling.placeNewEdges: FunctionTooLong \u2014 placeNewEdges runs 145 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 45 over it, 1.45\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/labeling/placement.go"},"region":{"startLine":462}}}],"partialFingerprints":{"codehealthFindingId/v1":"5749b02c1d4190e70fd30c5a6eac40c5aea47b4710cd37291c6aa9ccab899a6a"}},{"ruleId":"D3","level":"warning","message":{"text":"MethodTooLong: compiler._compileField: MethodTooLong \u2014 _compileField runs 144 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 44 over it, 1.44\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ir/compile.go"},"region":{"startLine":1704}}}],"partialFingerprints":{"codehealthFindingId/v1":"e567e847eceab99b9fddbb069366245bebc8c59e5ccd4f75d25fed914f42dd51"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: rasterimage/firstframe.go: FileTooLong \u2014 718 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 218 over it, 1.44\u00D7 the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/rasterimage/firstframe.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"d764155b39bee40ad754da34edd9ffaebd7f92c9f672da1d87bbe06690f2649a"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: placement/optimization_guard.go: FileTooLong \u2014 713 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 213 over it, 1.43\u00D7 the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file 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/d2talalayout/internal/placement/optimization_guard.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"541a83be5d00841654f7680639d165eef142e104d4c296b8d8ce2ba0187402ab"}},{"ruleId":"D3","level":"warning","message":{"text":"MethodTooLong: ASCIIartist.Render: MethodTooLong \u2014 Render runs 142 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 42 over it, 1.42\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2ascii/d2ascii.go"},"region":{"startLine":215}}}],"partialFingerprints":{"codehealthFindingId/v1":"8f16f7ddcd6fb421da4ae52e1f9ff0416ca02ad6517df11c351f4e8c7e25db18"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: d2isometricimg.nativeSceneSVG: FunctionTooLong \u2014 nativeSceneSVG runs 142 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 42 over it, 1.42\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/svg.go"},"region":{"startLine":237}}}],"partialFingerprints":{"codehealthFindingId/v1":"83658e7e8e22609fc7f437a368a3287fe771a27f4b455e37d217954730815805"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: d2isometric.BuildScene: FunctionTooLong \u2014 BuildScene runs 142 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 42 over it, 1.42\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/scene.go"},"region":{"startLine":129}}}],"partialFingerprints":{"codehealthFindingId/v1":"8e91449a3c937d5d984dd6fd715e7cb1f4b311b06974644e1ddf4cc2eec6938d"}},{"ruleId":"D3","level":"warning","message":{"text":"MethodTooLong: builder.shapeTextRuns: MethodTooLong \u2014 shapeTextRuns runs 140 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 40 over it, 1.40\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/font_fallback.go"},"region":{"startLine":432}}}],"partialFingerprints":{"codehealthFindingId/v1":"e2c84366e78755763af68396a5d8c7ba11f4fd3c27f04e87d2c58d8c9e757aee"}},{"ruleId":"D3","level":"warning","message":{"text":"MethodTooLong: Style.Apply: MethodTooLong \u2014 Apply runs 139 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 39 over it, 1.39\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2graph/d2graph.go"},"region":{"startLine":313}}}],"partialFingerprints":{"codehealthFindingId/v1":"d16bb6726b23a9de8bb2a37e432e6a39a8b3c04d6c884fae8ccb4bb46a0825f3"}},{"ruleId":"D3","level":"warning","message":{"text":"MethodTooLong: meshBuilder.edges: MethodTooLong \u2014 edges runs 139 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 39 over it, 1.39\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/geometry_routes.go"},"region":{"startLine":332}}}],"partialFingerprints":{"codehealthFindingId/v1":"02836a86a30870ff3282210dfff9199fe0191e664016246f562060903fe3617e"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: d2scenebuild/sketch_shapes.go: FileTooLong \u2014 684 significant lines (blank, comment-only and punctuation-only lines excluded), about 60% of them inside a single declaration: builder (14 blocks, 50-928). The bar is 500 significant lines; this is 184 over it, 1.37\u00D7 the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body \u2014 the parts that share the same inputs and are named together \u2014 into its own unit in a sibling file, and have the original call them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/sketch_shapes.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"94a8232b30fdb390ccfce275be1cce91d49b7b11e42d86292c9b214329b98c1b"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: trees/layout.go: FileTooLong \u2014 673 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 173 over it, 1.35\u00D7 the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file 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/d2talalayout/internal/trees/layout.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"ba2cf48ab650536b1a955df0a1494fdab1e7c8ee8372076db9e43ae5e2ec58f1"}},{"ruleId":"D3","level":"warning","message":{"text":"ClassTooLong: Transaction: ClassTooLong \u2014 536 significant lines (blank, comment-only and punctuation-only lines excluded), 17 methods, 17 blocks, lines 61-1442. The bar is 400 significant lines; this is 136 over it, 1.34\u00D7 the bar. 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":"d2layouts/d2talalayout/internal/layoutgraph/transaction.go"},"region":{"startLine":61}}}],"partialFingerprints":{"codehealthFindingId/v1":"1f6c55f246b8d27e275b8c8714680915214d5fc794c8fe201683876537b5b1c8"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: hierarchy.newRankProblem: FunctionTooLong \u2014 newRankProblem runs 134 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 34 over it, 1.34\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/hierarchy/rank_graph.go"},"region":{"startLine":13}}}],"partialFingerprints":{"codehealthFindingId/v1":"ee2104622af31cb56b8121d8f7539a86423a8f309c5e96af91ab4aca11395738"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: d2isometricimg.nativeResolveBridgeRoutes: FunctionTooLong \u2014 nativeResolveBridgeRoutes runs 134 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 34 over it, 1.34\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/route_bridges.go"},"region":{"startLine":60}}}],"partialFingerprints":{"codehealthFindingId/v1":"37ff119c78b385aeed563c17b68e92bd0e138350ffdfc2002b80050c86eac668"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: d2cli/board_output_publish.go: FileTooLong \u2014 668 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 168 over it, 1.34\u00D7 the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file 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/board_output_publish.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"c8330a817e9913644059d4c77084b46ea119897d368d2df9a3215f9b8f95faca"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: pipeline: TooManyMethods \u2014 40 methods. The bar is 30 methods; this is 10 over it, 1.33\u00D7 the bar. 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":"d2layouts/d2talalayout/internal/engine/pipeline.go"},"region":{"startLine":63}}}],"partialFingerprints":{"codehealthFindingId/v1":"d009799ba5526378d22b7d938cedb8839d897a3b2dc5767df8468f4b2584ea94"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: d2svgimport/import.go: FileTooLong \u2014 666 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 166 over it, 1.33\u00D7 the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file 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/d2svgimport/import.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"9e61694e02eceb9d6f38149826326ca36b62dd18d9e7980619310fc06b5b50c1"}},{"ruleId":"D3","level":"warning","message":{"text":"MethodTooLong: parser.parseUnquotedString: MethodTooLong \u2014 parseUnquotedString runs 133 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 33 over it, 1.33\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2parser/parse.go"},"region":{"startLine":1129}}}],"partialFingerprints":{"codehealthFindingId/v1":"2b3e9f2e451fe2787db4203b32ed3b640a7024fe3c9f026f962617f500e154cd"}},{"ruleId":"D3","level":"warning","message":{"text":"ClassTooLong: Object: ClassTooLong \u2014 530 significant lines (blank, comment-only and punctuation-only lines excluded), 50 methods, 30 blocks, lines 163-1968. The bar is 400 significant lines; this is 130 over it, 1.33\u00D7 the bar. 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":163}}}],"partialFingerprints":{"codehealthFindingId/v1":"a2a54f62a3afeca4ccae2c514e46b2545362d72d028ae6c1ace90008289e0c52"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: placementcost.prepareNodeEdgeLength: FunctionTooLong \u2014 prepareNodeEdgeLength runs 132 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 32 over it, 1.32\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placementcost/edge_length.go"},"region":{"startLine":142}}}],"partialFingerprints":{"codehealthFindingId/v1":"b0944bf0d4f9acc0f9c07bc198e3f4d2f4436521610d8cce83b478aea5dd6e0c"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: routing.RouteGraphWithWorkLimit: FunctionTooLong \u2014 RouteGraphWithWorkLimit runs 132 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 32 over it, 1.32\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/graph_stage.go"},"region":{"startLine":44}}}],"partialFingerprints":{"codehealthFindingId/v1":"30e9912cdc5d06d0b8d32ace6fe3126546ebbedfb791e28e85c513403636de36"}},{"ruleId":"D3","level":"warning","message":{"text":"MethodTooLong: pathParser.parseGroup: MethodTooLong \u2014 parseGroup runs 132 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 32 over it, 1.32\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svgimport/path.go"},"region":{"startLine":131}}}],"partialFingerprints":{"codehealthFindingId/v1":"cbe0abcbf37f0a5bd4a021bee58377486078b201effb8f2cc00a628893d02854"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: d2scenebuild/font_fallback.go: FileTooLong \u2014 651 significant lines (blank, comment-only and punctuation-only lines excluded), about 75% of them inside a single declaration: builder (7 blocks, 131-861). The bar is 500 significant lines; this is 151 over it, 1.30\u00D7 the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body \u2014 the parts that share the same inputs and are named together \u2014 into its own unit in a sibling file, and have the original call them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/font_fallback.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"223274371dd0326f6f15acd479e5f94f2be737b71230fe9ce6c86ecec2aa0d20"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: d2svg.singleThemeRulesets: FunctionTooLong \u2014 singleThemeRulesets runs 130 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 30 over it, 1.30\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svg/d2svg.go"},"region":{"startLine":3322}}}],"partialFingerprints":{"codehealthFindingId/v1":"01d75125af31306d1f8d1781dfd2a37eebed9dbb683e0aed34274007ccb8bdc9"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: d2raster/vector_validation.go: FileTooLong \u2014 648 significant lines (blank, comment-only and punctuation-only lines excluded), about 79% of them inside a single declaration: retainedVectorValidator (19 blocks, 19-802). The bar is 500 significant lines; this is 148 over it, 1.30\u00D7 the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body \u2014 the parts that share the same inputs and are named together \u2014 into its own unit in a sibling file, and have the original call them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/vector_validation.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"f7b57171cfd52fcfae6802b3cef6f3202f3e1ec9f96adab2596218bd41d118b7"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: d2sketch/sketch.go: FileTooLong \u2014 648 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 148 over it, 1.30\u00D7 the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file 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":"ClassTooLong: retainedVectorValidator: ClassTooLong \u2014 515 significant lines (blank, comment-only and punctuation-only lines excluded), 18 methods, 19 blocks, lines 19-802. The bar is 400 significant lines; this is 115 over it, 1.29\u00D7 the bar. 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":"d2renderers/d2raster/vector_validation.go"},"region":{"startLine":19}}}],"partialFingerprints":{"codehealthFindingId/v1":"e71eaa37cff3637615dfc2d76e59b09304b7cefa932fcf9cd369e3c1cba1e2c6"}},{"ruleId":"D3","level":"warning","message":{"text":"MethodTooLong: compiler._compileEdges: MethodTooLong \u2014 _compileEdges runs 128 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 28 over it, 1.28\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ir/compile.go"},"region":{"startLine":2088}}}],"partialFingerprints":{"codehealthFindingId/v1":"1e5183f10fb347d20cb35d3dfcc534c376017933540b2788223d5012c67ad672"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: d2oracle.MoveIDDeltas: FunctionTooLong \u2014 MoveIDDeltas runs 128 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 28 over it, 1.28\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2oracle/edit.go"},"region":{"startLine":2778}}}],"partialFingerprints":{"codehealthFindingId/v1":"bbdda821149b756a9dff64cf4258403a5ea32d5500473747415047ba462d6952"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: d2raster/geometry.go: FileTooLong \u2014 638 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 138 over it, 1.28\u00D7 the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file 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/d2raster/geometry.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"65e40e4260b848fccaeb3ac604b8b9c7b35f17e3f9c9cdc72ab969e6db0ea7b4"}},{"ruleId":"D3","level":"warning","message":{"text":"MethodTooLong: Graph.SetDimensions: MethodTooLong \u2014 SetDimensions runs 127 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 27 over it, 1.27\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2graph/d2graph.go"},"region":{"startLine":1515}}}],"partialFingerprints":{"codehealthFindingId/v1":"be3345f3455aed3cd64f209acaf1b515758e3896627b23148f8580e7294eb4e3"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: d2oracle.DeleteIDDeltas: FunctionTooLong \u2014 DeleteIDDeltas runs 127 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 27 over it, 1.27\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2oracle/edit.go"},"region":{"startLine":2972}}}],"partialFingerprints":{"codehealthFindingId/v1":"1e6fa5088343b1618f82f56e5c3b98752b8a865a23e6a87755dd91b66fc0f5f4"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: placement.shiftSubgraphs: FunctionTooLong \u2014 shiftSubgraphs runs 126 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 26 over it, 1.26\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/compaction.go"},"region":{"startLine":145}}}],"partialFingerprints":{"codehealthFindingId/v1":"5433c9f4626a1cc66d4d5b04996ed64053d6da921bacb49facffdf8415a9d604"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: imageasset/resolve.go: FileTooLong \u2014 626 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 126 over it, 1.25\u00D7 the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file 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/imageasset/resolve.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"912d3547b0c90fd0b923319af8fb6fe828c9c7462ca57463a454d59d8d045fd4"}},{"ruleId":"D3","level":"warning","message":{"text":"MethodTooLong: Transaction.buildPostStateOverlapCandidates: MethodTooLong \u2014 buildPostStateOverlapCandidates runs 125 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 25 over it, 1.25\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/transaction.go"},"region":{"startLine":824}}}],"partialFingerprints":{"codehealthFindingId/v1":"66df83b88758cb7e418c2035e928b7b99ca000b94c0644bd1e73f7dc4fb00db8"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: rasterimage.inspectPNG: FunctionTooLong \u2014 inspectPNG runs 124 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 24 over it, 1.24\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/rasterimage/firstframe.go"},"region":{"startLine":339}}}],"partialFingerprints":{"codehealthFindingId/v1":"9a4f80406b07550ba792bd90cc0011a0823c6e92959c945d2c5950818fa5dd08"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: routing.buildChannelProblem: FunctionTooLong \u2014 buildChannelProblem runs 123 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 23 over it, 1.23\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/nudge_channels.go"},"region":{"startLine":200}}}],"partialFingerprints":{"codehealthFindingId/v1":"0cf2eb43471d1ade778b9b98262a0eea8e5c528e733b0c25b9d85be5366d8644"}},{"ruleId":"D3","level":"warning","message":{"text":"MethodTooLong: OVG.halfwayPoints: MethodTooLong \u2014 halfwayPoints runs 123 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 23 over it, 1.23\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/ovg.go"},"region":{"startLine":561}}}],"partialFingerprints":{"codehealthFindingId/v1":"7c88e0999e37e2c8fe83b6220d3c959f53217a3dc5802f9b25e1763adf85dcc6"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: d2svg.RenderLegend: FunctionTooLong \u2014 RenderLegend runs 123 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 23 over it, 1.23\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svg/d2svg.go"},"region":{"startLine":259}}}],"partialFingerprints":{"codehealthFindingId/v1":"cd84fc4a0a6d91dad4ebba10fb9f297a4e35c95e493326a9d559c2d8d1f9d2f5"}},{"ruleId":"D3","level":"warning","message":{"text":"MethodTooLong: svgImporter.parse: MethodTooLong \u2014 parse runs 122 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 22 over it, 1.22\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svgimport/import.go"},"region":{"startLine":393}}}],"partialFingerprints":{"codehealthFindingId/v1":"69bca34c69f6f9b32a4eec8c78ddf08e3bc3decc4a4ebf2f82d28361912255ec"}},{"ruleId":"D3","level":"warning","message":{"text":"ClassTooLong: preflight: ClassTooLong \u2014 480 significant lines (blank, comment-only and punctuation-only lines excluded), 30 methods, 19 blocks, lines 155-1471. The bar is 400 significant lines; this is 80 over it, 1.20\u00D7 the bar. 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":"d2renderers/d2raster/raster.go"},"region":{"startLine":155}}}],"partialFingerprints":{"codehealthFindingId/v1":"8b1a4ecc5b8162d7619f8fa3822298c7ed279f732f5c73b32e12f87bd441601a"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyFields: ThemableElement: TooManyFields \u2014 36 stored fields beside 9 methods. The bar is 30 stored fields; this is 6 over it, 1.20\u00D7 the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member \u2014 each reader then names only the group it uses."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2themes/element.go"},"region":{"startLine":16}}}],"partialFingerprints":{"codehealthFindingId/v1":"828ef27536e59ddd960a8f83713a75be051dc76141dcfafd8eac18ba6acef3b3"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: releasetool/main.go: FileTooLong \u2014 600 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 100 over it, 1.20\u00D7 the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"ci/release/releasetool/main.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"a9c4163bb3bd03371b82f578e36915b62fb0f35c09cb636e2445f6cf91e0745e"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: d2fonts/fallback.go: FileTooLong \u2014 600 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 100 over it, 1.20\u00D7 the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file 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/d2fonts/fallback.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"0963d35dbea8f7c29256719608d8b63102eb7be469ae7efb95f09e8062a13229"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: d2wasm.Render: FunctionTooLong \u2014 Render runs 120 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 20 over it, 1.20\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2js/d2wasm/functions.go"},"region":{"startLine":351}}}],"partialFingerprints":{"codehealthFindingId/v1":"ede65f451fe6eb6cf714b0372babee9848cdaa406ce5b7bf32e5e9c019cf8862"}},{"ruleId":"D3","level":"warning","message":{"text":"MethodTooLong: GraphState.updateContext: MethodTooLong \u2014 updateContext runs 119 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 19 over it, 1.19\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/transaction.go"},"region":{"startLine":167}}}],"partialFingerprints":{"codehealthFindingId/v1":"be336e2c696655c7ac4178ca93ee6683aeba9f5588ee7a7c6623d3933a7bb9bc"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: proximity.assignNearsWithWorkLimit: FunctionTooLong \u2014 assignNearsWithWorkLimit runs 119 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 19 over it, 1.19\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/proximity/nears.go"},"region":{"startLine":18}}}],"partialFingerprints":{"codehealthFindingId/v1":"3aacfdf40c8abc131138d04873b9fce415d0975047fda3614723694503c3ced9"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: trees.extractTreesInContainer: FunctionTooLong \u2014 extractTreesInContainer runs 119 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 19 over it, 1.19\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/trees/layout.go"},"region":{"startLine":14}}}],"partialFingerprints":{"codehealthFindingId/v1":"cfcc8f9c159af4e9d6fbea534e171306bc73b9e5b6c3af7b4bd6b12600b0efb0"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: d2svgimport/style.go: FileTooLong \u2014 591 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 91 over it, 1.18\u00D7 the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file 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/d2svgimport/style.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"17ca635deeb851c2b3a42cb089600d143c5629ba27adb054a5d49d8b68e9d7be"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: grouping.AddSequences: FunctionTooLong \u2014 AddSequences runs 118 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 18 over it, 1.18\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/grouping/sequences.go"},"region":{"startLine":206}}}],"partialFingerprints":{"codehealthFindingId/v1":"b387870d9f5563eb4cfc9cd32904cdb098220fd9e4cf9457d1901b5d5838e0c7"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: routing.reorderDuplicatesInEdges: FunctionTooLong \u2014 reorderDuplicatesInEdges runs 118 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 18 over it, 1.18\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/coordinator.go"},"region":{"startLine":1633}}}],"partialFingerprints":{"codehealthFindingId/v1":"716b67a750a03d7efefca728ce53e7691e71991412aaef8240943b1d76ede50e"}},{"ruleId":"D3","level":"warning","message":{"text":"MethodTooLong: Nodes.clustersWithWorkGuard: MethodTooLong \u2014 clustersWithWorkGuard runs 117 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 17 over it, 1.17\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/node.go"},"region":{"startLine":300}}}],"partialFingerprints":{"codehealthFindingId/v1":"887c494e99a6fa8ec4b489f05624918c5915236cb6a580c5ae9aeaeea3574fdc"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyFields: builder: TooManyFields \u2014 35 stored fields beside 104 methods. The bar is 30 stored fields; this is 5 over it, 1.17\u00D7 the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member \u2014 each reader then names only the group it uses."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/build.go"},"region":{"startLine":122}}}],"partialFingerprints":{"codehealthFindingId/v1":"994d8d69cd5511280d89f6c70598291d9acc94ffbef9c9b6f6328d1a5a9f10e7"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: parser: TooManyMethods \u2014 35 methods. The bar is 30 methods; this is 5 over it, 1.17\u00D7 the bar. 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":159}}}],"partialFingerprints":{"codehealthFindingId/v1":"1951abcbb5792eb10c737aa096debd91e4e27646369fdbd1b7620805339d2eab"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: Rasterizer: TooManyMethods \u2014 35 methods. The bar is 30 methods; this is 5 over it, 1.17\u00D7 the bar. 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":"d2renderers/d2raster/internal/scanline/rasterizer.go"},"region":{"startLine":99}}}],"partialFingerprints":{"codehealthFindingId/v1":"e268cb5715edb6ac51949b9634a4333dbc65e18ade1c92feb849dba38cd53788"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: placement.placeNodes: FunctionTooLong \u2014 placeNodes runs 116 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 16 over it, 1.16\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/node_placement.go"},"region":{"startLine":21}}}],"partialFingerprints":{"codehealthFindingId/v1":"38da567f95e8f817e988e7b2af6eaf0308e67db08a90e10f252569dff69b6356"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: placement.placeNodesOrthogonally: FunctionTooLong \u2014 placeNodesOrthogonally runs 116 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 16 over it, 1.16\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/node_placement.go"},"region":{"startLine":246}}}],"partialFingerprints":{"codehealthFindingId/v1":"e1e613a33650265ba110e3813efffa7a232a23996496b69d68b9872dcd361761"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: d2isometricimg.hierarchyBoardHeaderPlacement: FunctionTooLong \u2014 hierarchyBoardHeaderPlacement runs 116 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 16 over it, 1.16\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/hierarchy_headers.go"},"region":{"startLine":25}}}],"partialFingerprints":{"codehealthFindingId/v1":"b3ec96471e10155d8f3e34d22c139e90bf77fa5e5dda2ab7099a82e5fe9c20ac"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: d2raster.planNodeResources: FunctionTooLong \u2014 planNodeResources runs 116 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 16 over it, 1.16\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/effects.go"},"region":{"startLine":322}}}],"partialFingerprints":{"codehealthFindingId/v1":"469603467b707804e50293276e141768af7dfe09c715aa0f0a3aa26a32ee401a"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: hierarchy.PlaceCompound: FunctionTooLong \u2014 PlaceCompound runs 115 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 15 over it, 1.15\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/hierarchy/compound.go"},"region":{"startLine":39}}}],"partialFingerprints":{"codehealthFindingId/v1":"41ba56ff8602272d2506228c81433c8ba38ea3a51ea20de7e5e7e776fc7d94fc"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: layoutgraph/transaction_snapshot.go: FileTooLong \u2014 571 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 71 over it, 1.14\u00D7 the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file 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/d2talalayout/internal/layoutgraph/transaction_snapshot.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"162e236b6da8508ddf00824d85ffecbb90d31ecc6e9f4dd021b47c771bed5fa9"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: main.writeArchive: FunctionTooLong \u2014 writeArchive runs 114 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 14 over it, 1.14\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"ci/release/releasetool/main.go"},"region":{"startLine":158}}}],"partialFingerprints":{"codehealthFindingId/v1":"ddf767702eff3c79963dc26341a44a71ff0b800ef07e35395c23f91710b7c7fc"}},{"ruleId":"D3","level":"warning","message":{"text":"MethodTooLong: Edge.TraceToShape: MethodTooLong \u2014 TraceToShape runs 114 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 14 over it, 1.14\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2graph/layout.go"},"region":{"startLine":414}}}],"partialFingerprints":{"codehealthFindingId/v1":"2a610f32d6c43cd7bfa9660a316f92ede9dc45e9444cbcacff128dd0f8324853"}},{"ruleId":"D3","level":"warning","message":{"text":"MethodTooLong: SystemFallbackResolver.ResolveFallbacks: MethodTooLong \u2014 ResolveFallbacks runs 114 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 14 over it, 1.14\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2fonts/fallback.go"},"region":{"startLine":121}}}],"partialFingerprints":{"codehealthFindingId/v1":"b10233c138b5bdcdb40dc4c4c87a5d230c656888b988ff3560d59ab878c29124"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: Nodes: TooManyMethods \u2014 34 methods, declared across 6 files: layoutgraph/node.go (18), layoutgraph/hierarchy_access.go (5), layoutgraph/graph.go (4), layoutgraph/placement_access.go (4), \u002B2 more file(s). The bar is 30 methods; this is 4 over it, 1.13\u00D7 the bar. 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":"d2layouts/d2talalayout/internal/layoutgraph/node.go"},"region":{"startLine":201}}}],"partialFingerprints":{"codehealthFindingId/v1":"7d0ca7a3e4b446d956c2790aeefbc7788f0fae19eb65886056dc5551a16a9196"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: OVG: TooManyMethods \u2014 34 methods, declared across 3 files: routing/ovg.go (27), routing/ovg_hierarchy.go (6), routing/ovg_resource.go (1). The bar is 30 methods; this is 4 over it, 1.13\u00D7 the bar. 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":"d2layouts/d2talalayout/internal/routing/ovg.go"},"region":{"startLine":18}}}],"partialFingerprints":{"codehealthFindingId/v1":"c6cf68c1cfb3ebb66fc0ddf4f879e6a4ff8fbba868365ab0a40c124145955105"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: graphjson.newEdgeSerializationIDs: FunctionTooLong \u2014 newEdgeSerializationIDs runs 113 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 13 over it, 1.13\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/graphjson/codec.go"},"region":{"startLine":50}}}],"partialFingerprints":{"codehealthFindingId/v1":"687edc4d38da527e4d729271fadb722286afa5c35d7041906f355c15dd52ee0a"}},{"ruleId":"D3","level":"warning","message":{"text":"MethodTooLong: Transaction.Commit: MethodTooLong \u2014 Commit runs 113 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 13 over it, 1.13\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/transaction.go"},"region":{"startLine":1166}}}],"partialFingerprints":{"codehealthFindingId/v1":"ff9e1945704c3939a4cc5148482d795c934ac075d5f117dd379c354b76155bdf"}},{"ruleId":"D3","level":"warning","message":{"text":"MethodTooLong: ThemableElement.Render: MethodTooLong \u2014 Render runs 112 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 12 over it, 1.12\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2themes/element.go"},"region":{"startLine":138}}}],"partialFingerprints":{"codehealthFindingId/v1":"257a83b0ff14ff516b10b0ac6d5087abab9e6787d738db3620bc3e283716fe63"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: hierarchy.findCycleEdges: FunctionTooLong \u2014 findCycleEdges runs 111 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 11 over it, 1.11\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/hierarchy/discovery.go"},"region":{"startLine":579}}}],"partialFingerprints":{"codehealthFindingId/v1":"f7390756b19e2db3ed042a25a400f3b528bc50a0c971c77ab3743bbe88eac8d5"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: trees.placeAtOrientationGuarded: FunctionTooLong \u2014 placeAtOrientationGuarded runs 111 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 11 over it, 1.11\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/trees/layout.go"},"region":{"startLine":399}}}],"partialFingerprints":{"codehealthFindingId/v1":"e0f4792a2ecbd478ed45b04999f867146c780b7a395522c2567f2c854115fbdd"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: d2raster.prepareWithSessionBands: FunctionTooLong \u2014 prepareWithSessionBands runs 111 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 11 over it, 1.11\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/raster.go"},"region":{"startLine":615}}}],"partialFingerprints":{"codehealthFindingId/v1":"a8c7f131d5e47f1869159f2cb872312add23273929efed9219aedde8b5990827"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyFields: Shape: TooManyFields \u2014 33 stored fields beside 5 methods. The bar is 30 stored fields; this is 3 over it, 1.10\u00D7 the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member \u2014 each reader then names only the group it uses."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2target/d2target.go"},"region":{"startLine":769}}}],"partialFingerprints":{"codehealthFindingId/v1":"07d2e655948164341fad31bf8a74b0b47937b03a6ae904a8bcd3290ee77143bf"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: packing.binPackCanUseRoutedContainerBox: FunctionTooLong \u2014 binPackCanUseRoutedContainerBox runs 110 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 10 over it, 1.10\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/packing/routed_container.go"},"region":{"startLine":45}}}],"partialFingerprints":{"codehealthFindingId/v1":"1b86f9bff6658364e455cf56d1d5c4c6be2eca3a02e821ed809d6682d2bf59ac"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: d2isometricimg.svgOrderPaintUnitsWithLimits: FunctionTooLong \u2014 svgOrderPaintUnitsWithLimits runs 110 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 10 over it, 1.10\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/svg_order.go"},"region":{"startLine":29}}}],"partialFingerprints":{"codehealthFindingId/v1":"24dbc85685ef488e7f68ec1fcca7c1f8ca32165e1521fe33b942402caba48bfb"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: routing.reorderDuplicatesInEdgesGuarded: FunctionTooLong \u2014 reorderDuplicatesInEdgesGuarded runs 109 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 9 over it, 1.09\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/standalone_route_guard.go"},"region":{"startLine":323}}}],"partialFingerprints":{"codehealthFindingId/v1":"4f82676cb58fc7c026fe3fcad9c84f7d800be43a96277b7eb790330665592463"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: routing.tunnelRangesBetweenChecked: FunctionTooLong \u2014 tunnelRangesBetweenChecked runs 109 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 9 over it, 1.09\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/tunnel.go"},"region":{"startLine":93}}}],"partialFingerprints":{"codehealthFindingId/v1":"da18d12d47202031e7c6b49e85da2a42fda3993bdf3e20802e5c586b6d479f11"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: d2raster.makeStrokeRuns: FunctionTooLong \u2014 makeStrokeRuns runs 109 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 9 over it, 1.09\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/geometry.go"},"region":{"startLine":529}}}],"partialFingerprints":{"codehealthFindingId/v1":"3c0443d5cbea6fc2792d3324eeab4c84039a92e2074f26a4c4822056bd2106d5"}},{"ruleId":"D3","level":"warning","message":{"text":"ClassTooLong: graphCloneState: ClassTooLong \u2014 434 significant lines (blank, comment-only and punctuation-only lines excluded), 14 methods, 15 blocks, lines 65-686. The bar is 400 significant lines; this is 34 over it, 1.09\u00D7 the bar. 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":"d2layouts/d2talalayout/internal/layoutgraph/clone.go"},"region":{"startLine":65}}}],"partialFingerprints":{"codehealthFindingId/v1":"3e5befdb6f713d3c309d86f833a6a2c130bb4c11129e858b1fe580b66dd71482"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: placement.optimizerAdjacents: FunctionTooLong \u2014 optimizerAdjacents runs 108 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 8 over it, 1.08\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/optimization_guard.go"},"region":{"startLine":176}}}],"partialFingerprints":{"codehealthFindingId/v1":"14f5cd6c3ddc5a8ac47f769d2105497313ed7dc8a6a9dd6e7868bbd024363c3d"}},{"ruleId":"D3","level":"warning","message":{"text":"MethodTooLong: preflight.node: MethodTooLong \u2014 node runs 108 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 8 over it, 1.08\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/raster.go"},"region":{"startLine":977}}}],"partialFingerprints":{"codehealthFindingId/v1":"5f4c844c97154fc6626481c49a8024a2a9dc10441c7822f44ee1c9af670acfc4"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: textmeasure/markdown.go: FileTooLong \u2014 538 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 38 over it, 1.08\u00D7 the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file 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/textmeasure/markdown.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"e51210e378f028a14e2b4c96a3c4e45065104afb1efcad799ac89b56695530d1"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: layoutgraph/clone.go: FileTooLong \u2014 536 significant lines (blank, comment-only and punctuation-only lines excluded), about 81% of them inside a single declaration: graphCloneState (15 blocks, 65-686). The bar is 500 significant lines; this is 36 over it, 1.07\u00D7 the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body \u2014 the parts that share the same inputs and are named together \u2014 into its own unit in a sibling file, and have the original call them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/clone.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"ea522b78a4d934745bc1b4cadf44cbb93f136e4573c819b27447d2b096953d29"}},{"ruleId":"D3","level":"warning","message":{"text":"MethodTooLong: sizedOptimizer.bestSwapCandidateGuarded: MethodTooLong \u2014 bestSwapCandidateGuarded runs 107 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 7 over it, 1.07\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/sized_optimizer.go"},"region":{"startLine":1027}}}],"partialFingerprints":{"codehealthFindingId/v1":"8acd9493ed9d3d872f9c84377ea6ee4ca38bb76fcb9a8658ce1ae6f502d64b16"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: d2isometricimg/geometry.go: FileTooLong \u2014 530 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 30 over it, 1.06\u00D7 the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file 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/d2isometric/d2isometricimg/geometry.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"680f734ef81ad263776f5f036874b1912dceafb2dc80ce91d65941e2cbfda1cc"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: d2wasm.Compile: FunctionTooLong \u2014 Compile runs 106 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 6 over it, 1.06\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2js/d2wasm/functions.go"},"region":{"startLine":196}}}],"partialFingerprints":{"codehealthFindingId/v1":"bace92fb56bfbcf94caf346326b65b585a93125df0898ef2689867a558a20a2f"}},{"ruleId":"D3","level":"warning","message":{"text":"MethodTooLong: gridDiagram.layoutDynamic: MethodTooLong \u2014 layoutDynamic runs 106 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 6 over it, 1.06\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2grid/layout.go"},"region":{"startLine":337}}}],"partialFingerprints":{"codehealthFindingId/v1":"ce55aee825ef518272891aa9b5e7df490c2b12743af34de90a857c049fae5930"}},{"ruleId":"D3","level":"warning","message":{"text":"MethodTooLong: sizedOptimizer.optimizeGuarded: MethodTooLong \u2014 optimizeGuarded runs 106 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 6 over it, 1.06\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/sized_optimizer.go"},"region":{"startLine":279}}}],"partialFingerprints":{"codehealthFindingId/v1":"d48d4124b06385e585e8bd89f7ff56d627008235d8b6a97d7508319629b38ea8"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: d2oracle.Delete: FunctionTooLong \u2014 Delete runs 106 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 6 over it, 1.06\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2oracle/edit.go"},"region":{"startLine":937}}}],"partialFingerprints":{"codehealthFindingId/v1":"25778f47bda87dbe0633f37644a0643b7de248ee4d7d25f7d88f399d10ce7b15"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: routing/ovg_resource.go: FileTooLong \u2014 528 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 28 over it, 1.06\u00D7 the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file 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/d2talalayout/internal/routing/ovg_resource.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"aca52dee077c9e680274077539f03b86e6afa5b0370a4d53a575a301ab38ac02"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: d2raster/text.go: FileTooLong \u2014 525 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 25 over it, 1.05\u00D7 the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file 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/d2raster/text.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"9404f8b7c0ef4738274676d9e209802916917a89cc443b98ca886aa3b78f0049"}},{"ruleId":"D3","level":"warning","message":{"text":"MethodTooLong: compiler.compileMap: MethodTooLong \u2014 compileMap runs 105 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 5 over it, 1.05\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ir/compile.go"},"region":{"startLine":971}}}],"partialFingerprints":{"codehealthFindingId/v1":"3a9ee436f8b7087ed7932dd37ae65f8493b764d295e916e4d09e8e67ddaf6a7b"}},{"ruleId":"D3","level":"warning","message":{"text":"MethodTooLong: builder.buildLegend: MethodTooLong \u2014 buildLegend runs 105 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 5 over it, 1.05\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/legend.go"},"region":{"startLine":351}}}],"partialFingerprints":{"codehealthFindingId/v1":"c5484bca22a598cf4896abbbb4fd9c8033b7c5608c4fdb3c52418ed7e3035f94"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: d2svg.render3DHexagon: FunctionTooLong \u2014 render3DHexagon runs 105 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 5 over it, 1.05\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svg/d2svg.go"},"region":{"startLine":1552}}}],"partialFingerprints":{"codehealthFindingId/v1":"b2cbd86021a3fc14a87699e145b59dd157e6198111916df54ca39b4d40ee296b"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: d2layouts/d2layouts.go: FileTooLong \u2014 521 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 21 over it, 1.04\u00D7 the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file 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/d2layouts.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"de5be97e1a8dd8213fc43e14dec7981e22609bd0594ee59967b16cf7d80224a2"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: d2isometricimg/native_shapes.go: FileTooLong \u2014 521 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 21 over it, 1.04\u00D7 the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file 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/d2isometric/d2isometricimg/native_shapes.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"4f974ab9875d46bdb026d130ef067937a5841c20edcf168b4047bf4400bfbc3f"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: font/subsetFont.go: FileTooLong \u2014 520 significant lines (blank, comment-only and punctuation-only lines excluded), about 79% of them inside a single declaration: utf8FontFile (25 blocks, 35-663). The bar is 500 significant lines; this is 20 over it, 1.04\u00D7 the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body \u2014 the parts that share the same inputs and are named together \u2014 into its own unit in a sibling file, and have the original call them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/font/subsetFont.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"09c1737dcba91f4a30cd64854a0af763ffbbf6482e894548f8c50eaa36408235"}},{"ruleId":"D3","level":"warning","message":{"text":"MethodTooLong: Graph.splitSubgraphsWithOwnership: MethodTooLong \u2014 splitSubgraphsWithOwnership runs 104 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 4 over it, 1.04\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/graph.go"},"region":{"startLine":674}}}],"partialFingerprints":{"codehealthFindingId/v1":"f7cc4db138725e49e908e3bee259d3b730b6e4431b90193c710503877c96076a"}},{"ruleId":"D3","level":"warning","message":{"text":"MethodTooLong: preflight.positionGlyphs: MethodTooLong \u2014 positionGlyphs runs 104 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 4 over it, 1.04\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/text.go"},"region":{"startLine":456}}}],"partialFingerprints":{"codehealthFindingId/v1":"3c07fc91a0a6f532ec1d34899599b414bd27807ee7d5e89556fd8b984ef48fcf"}},{"ruleId":"D3","level":"warning","message":{"text":"MethodTooLong: builder.buildShape: MethodTooLong \u2014 buildShape runs 104 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 4 over it, 1.04\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/build.go"},"region":{"startLine":828}}}],"partialFingerprints":{"codehealthFindingId/v1":"8df491f23619cede832924fe8a947a69b9914c5fc4faf9e9ae92948927157b91"}},{"ruleId":"D3","level":"warning","message":{"text":"MethodTooLong: Position.GetPointOnBox: MethodTooLong \u2014 GetPointOnBox runs 104 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 4 over it, 1.04\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/label/label.go"},"region":{"startLine":418}}}],"partialFingerprints":{"codehealthFindingId/v1":"18fce4074497553a0dcb3eeb6dd8bd49f11493a7f87f54fa75a64a7fd309c8a9"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: d2sketch.Table: FunctionTooLong \u2014 Table runs 103 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 3 over it, 1.03\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2sketch/sketch.go"},"region":{"startLine":437}}}],"partialFingerprints":{"codehealthFindingId/v1":"ddddae73dc40ab3ef5c7721169e10a73139838556f7322c0faff36425207baef"}},{"ruleId":"D3","level":"warning","message":{"text":"ClassTooLong: utf8FontFile: ClassTooLong \u2014 411 significant lines (blank, comment-only and punctuation-only lines excluded), 24 methods, 25 blocks, lines 35-663. The bar is 400 significant lines; this is 11 over it, 1.03\u00D7 the bar. 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":"lib/font/subsetFont.go"},"region":{"startLine":35}}}],"partialFingerprints":{"codehealthFindingId/v1":"b763daca47d470b9954c38480c38fce993f4794321d7133a6e5ff371b6dfe53b"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: d2cli/paged.go: FileTooLong \u2014 513 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 13 over it, 1.03\u00D7 the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file 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/paged.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"162971cb705fb1125762f50a4ca018edc49cd7c7edbc8c01e2c0870bd3fe48a9"}},{"ruleId":"D3","level":"warning","message":{"text":"MethodTooLong: svgImporter.compileGeometry: MethodTooLong \u2014 compileGeometry runs 102 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 2 over it, 1.02\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svgimport/geometry.go"},"region":{"startLine":33}}}],"partialFingerprints":{"codehealthFindingId/v1":"ca37c8bdca8fbe67e4ced61c07cad96ee691d3b6aac8342bb76254df3c1ba40a"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: d2cli/watch.go: FileTooLong \u2014 509 significant lines (blank, comment-only and punctuation-only lines excluded), about 70% of them inside a single declaration: watcher (21 blocks, 64-718). The bar is 500 significant lines; this is 9 over it, 1.02\u00D7 the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body \u2014 the parts that share the same inputs and are named together \u2014 into its own unit in a sibling file, and have the original call them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2cli/watch.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"d42f5780a267a17ad316d4f2a84b3d81cbadc70913a8581eafafa0f61e91ab46"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: d2grid/layout.go: FileTooLong \u2014 508 significant lines (blank, comment-only and punctuation-only lines excluded), about 64% of them inside a single declaration: gridDiagram (6 blocks, 233-940). The bar is 500 significant lines; this is 8 over it, 1.02\u00D7 the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body \u2014 the parts that share the same inputs and are named together \u2014 into its own unit in a sibling file, and have the original call them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2grid/layout.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"5a956e5aef25723d37c2b05cdecd0049ec5b481445a8c0bacd31b0a7a3185f63"}},{"ruleId":"D3","level":"warning","message":{"text":"MethodTooLong: Node.deltaToGuarded: MethodTooLong \u2014 deltaToGuarded runs 101 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1 over it, 1.01\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/node.go"},"region":{"startLine":788}}}],"partialFingerprints":{"codehealthFindingId/v1":"eaa26f8b918b581078e17fbd55e5bb1662c1cf6b606f2e2141af180ea29aa7d7"}},{"ruleId":"D3","level":"warning","message":{"text":"MethodTooLong: builder.measureLegend: MethodTooLong \u2014 measureLegend runs 101 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1 over it, 1.01\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/legend.go"},"region":{"startLine":147}}}],"partialFingerprints":{"codehealthFindingId/v1":"9f1e0afc45aa6457c3fdcff45c5486803b99b5664cfd57a9762493c0139af7cc"}},{"ruleId":"D3","level":"warning","message":{"text":"FunctionTooLong: d2svg.collectFontCorporaAndClasses: FunctionTooLong \u2014 collectFontCorporaAndClasses runs 101 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1 over it, 1.01\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svg/font_corpus.go"},"region":{"startLine":79}}}],"partialFingerprints":{"codehealthFindingId/v1":"db2732360f66a629cd6303c2ab1f60c8706e0cad22b23d944ba36700d9204dc8"}},{"ruleId":"D3","level":"warning","message":{"text":"MethodTooLong: markdownPainter.wrapInlineTokens: MethodTooLong \u2014 wrapInlineTokens runs 101 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1 over it, 1.01\u00D7 the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body \u2014 the runs of statements that work on the same values and would earn the same name \u2014 into its own named unit, and have this one call them in order."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/textmeasure/markdown_svg.go"},"region":{"startLine":983}}}],"partialFingerprints":{"codehealthFindingId/v1":"b4c0b6bdbebe722bda449e94969aa3cb7dc8afa2aa37a1b6c5691d8d5f4de3ab"}},{"ruleId":"D4","level":"warning","message":{"text":"Near-duplicate member pair (322 shared lines): d2layouts/d2talalayout/internal/layoutgraph/topology_preflight.go:129-504 | d2layouts/d2talalayout/internal/layoutgraph/topology_preflight.go:510-1282 \u2014 These two members are variants of one another: 322 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members\u0027 grain \u2014 factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/topology_preflight.go"},"region":{"startLine":129}}}],"partialFingerprints":{"codehealthFindingId/v1":"39f69cb4ffa94ec84febd18f8e7b39d8aae658cc5e3267628830e55246f424a4"}},{"ruleId":"D4","level":"warning","message":{"text":"Near-duplicate member pair (172 shared lines): d2layouts/d2talalayout/internal/labeling/placement.go:28-454 | d2layouts/d2talalayout/internal/labeling/placement.go:462-685 \u2014 These two members are variants of one another: 172 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members\u0027 grain \u2014 factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/labeling/placement.go"},"region":{"startLine":28}}}],"partialFingerprints":{"codehealthFindingId/v1":"82d32b45af30a479fe23e0440c32ebc3528289ae249fa7b488d6ef24dac7554e"}},{"ruleId":"D4","level":"warning","message":{"text":"Near-duplicate member pair (98 shared lines): d2layouts/d2talalayout/internal/routing/slingshot.go:676-889 | d2layouts/d2talalayout/internal/routing/slingshot.go:900-1189 \u2014 These two members are variants of one another: 98 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members\u0027 grain \u2014 factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/slingshot.go"},"region":{"startLine":676}}}],"partialFingerprints":{"codehealthFindingId/v1":"c384583f952e5cccc593bede71ef853f060722ea1da90445f6cc985aa6c31c06"}},{"ruleId":"D4","level":"warning","message":{"text":"Near-duplicate member pair (70 shared lines): d2oracle/edit.go:2778-2970 | d2oracle/edit.go:2972-3161 \u2014 These two members are variants of one another: 70 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members\u0027 grain \u2014 factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2oracle/edit.go"},"region":{"startLine":2778}}}],"partialFingerprints":{"codehealthFindingId/v1":"a3db454e2d8cbf15979ef4c420e871cb83dff2a49f1b6d3c866294f780c78179"}},{"ruleId":"D4","level":"warning","message":{"text":"Near-duplicate member pair (67 shared lines): d2renderers/d2svg/d2svg.go:1445-1550 | d2renderers/d2svg/d2svg.go:1552-1686 \u2014 These two members are variants of one another: 67 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members\u0027 grain \u2014 factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svg/d2svg.go"},"region":{"startLine":1445}}}],"partialFingerprints":{"codehealthFindingId/v1":"6d4bf6ac861bc816e78ef71b80b55f789b31ccf857a2020aefea5e5d3464ca28"}},{"ruleId":"D4","level":"warning","message":{"text":"Near-duplicate member pair (62 shared lines): d2oracle/edit.go:124-284 | d2oracle/edit.go:2500-2642 \u2014 These two members are variants of one another: 62 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members\u0027 grain \u2014 factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2oracle/edit.go"},"region":{"startLine":124}}}],"partialFingerprints":{"codehealthFindingId/v1":"b3f2fe3ced0c0bcff3f37ce5777345cbc3ab3545033ddc105eed541457f485ae"}},{"ruleId":"D4","level":"warning","message":{"text":"Near-duplicate member pair (41 shared lines): d2renderers/d2svg/class.go:92-163 | d2renderers/d2svg/table.go:115-186 \u2014 These two members are variants of one another: 41 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members\u0027 grain \u2014 factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svg/class.go"},"region":{"startLine":92}}}],"partialFingerprints":{"codehealthFindingId/v1":"82c5e2cf4d05d9419761a14a3ad4c1dc5fc76783ce0556ac9fbbab0d73836794"}},{"ruleId":"D4","level":"warning","message":{"text":"Near-duplicate member pair (33 shared lines): d2ir/d2ir.go:1593-1683 | d2ir/d2ir.go:1717-1844 \u2014 These two members are variants of one another: 33 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members\u0027 grain \u2014 factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ir/d2ir.go"},"region":{"startLine":1593}}}],"partialFingerprints":{"codehealthFindingId/v1":"748538e07620b450e90b48ebb9d0a72f491ca6c7c22e313a6536fcf991b0df90"}},{"ruleId":"D4","level":"warning","message":{"text":"Near-duplicate member pair (32 shared lines): d2renderers/d2raster/internal/scanline/rasterizer.go:491-709 | d2renderers/d2raster/internal/scanline/rasterizer.go:724-799 \u2014 These two members are variants of one another: 32 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members\u0027 grain \u2014 factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/internal/scanline/rasterizer.go"},"region":{"startLine":491}}}],"partialFingerprints":{"codehealthFindingId/v1":"ffd618b2ebf792ca7865c257dbf688f961fdc2b71c4551d6f6d51d4708c29279"}},{"ruleId":"D4","level":"warning","message":{"text":"Near-duplicate member pair (30 shared lines): d2renderers/d2raster/filter.go:560-651 | d2renderers/d2raster/filter.go:653-761 \u2014 These two members are variants of one another: 30 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members\u0027 grain \u2014 factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/filter.go"},"region":{"startLine":560}}}],"partialFingerprints":{"codehealthFindingId/v1":"5e6ba664a3c7e4bb3149061fe95e1b61a7b3d5b8008e5a9f7c02d0ed2e2335c5"}},{"ruleId":"D4","level":"warning","message":{"text":"Near-duplicate member pair (27 shared lines): d2layouts/d2talalayout/internal/graphbounds/bounds.go:49-134 | d2layouts/d2talalayout/internal/labeling/guard.go:325-402 \u2014 These two members are variants of one another: 27 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members\u0027 grain \u2014 factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/graphbounds/bounds.go"},"region":{"startLine":49}}}],"partialFingerprints":{"codehealthFindingId/v1":"2b12a84b60552a65ae36797090c228a1663ad7e21aae51e0f9bbb08b01d65dde"}},{"ruleId":"D4","level":"warning","message":{"text":"Near-duplicate member pair (23 shared lines): d2renderers/d2raster/filter.go:653-761 | d2renderers/d2raster/filter.go:838-916 \u2014 These two members are variants of one another: 23 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members\u0027 grain \u2014 factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/filter.go"},"region":{"startLine":653}}}],"partialFingerprints":{"codehealthFindingId/v1":"4f78694170875a536fa8c7c711507e47e0f0fccf3ef447529fa2885802a10349"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (17 corresponding lines): d2renderers/d2raster/gradient.go:581-618 | d2renderers/d2raster/gradient.go:620-644 \u2014 These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/gradient.go"},"region":{"startLine":581}}}],"partialFingerprints":{"codehealthFindingId/v1":"297287749596ee33016dc78f768d4e893563c54946a9c09242eba66d31737912"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (45 corresponding lines): d2parser/parse.go:527-576 | d2parser/parse.go:1663-1726 \u2014 These two members are one piece of code written twice and then edited apart: 45 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2parser/parse.go"},"region":{"startLine":527}}}],"partialFingerprints":{"codehealthFindingId/v1":"1c3f4035212cceb90b8a47dedbe8fb42b9e067a25e0724b0cc24d8f64d1ff4ab"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (22 corresponding lines): d2layouts/d2talalayout/internal/nodeshape/shape_callout.go:99-120 | d2layouts/d2talalayout/internal/nodeshape/shape_package.go:113-134 \u2014 These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/nodeshape/shape_callout.go"},"region":{"startLine":99}}}],"partialFingerprints":{"codehealthFindingId/v1":"18f317d4655eb9cea34c43fb755e59e26b0ef675c11ca976bd5ba516ccbdd19f"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (22 corresponding lines): d2layouts/d2talalayout/internal/nodeshape/shape_callout.go:99-120 | d2layouts/d2talalayout/internal/nodeshape/shape_square.go:80-101 \u2014 These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/nodeshape/shape_callout.go"},"region":{"startLine":99}}}],"partialFingerprints":{"codehealthFindingId/v1":"fea210c15ba737a6b01f77b6d2544feea265d2c0127835f0c1b480504eb1ccf6"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (19 corresponding lines): d2layouts/d2talalayout/internal/nodeshape/shape_c4person.go:79-100 | d2layouts/d2talalayout/internal/nodeshape/shape_package.go:113-134 \u2014 These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/nodeshape/shape_c4person.go"},"region":{"startLine":79}}}],"partialFingerprints":{"codehealthFindingId/v1":"023bf6b667004801f513b1b9b2e101e5cbc288e8076253c6f8bb836d06c35e21"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (19 corresponding lines): d2layouts/d2talalayout/internal/nodeshape/shape_c4person.go:79-100 | d2layouts/d2talalayout/internal/nodeshape/shape_square.go:80-101 \u2014 These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/nodeshape/shape_c4person.go"},"region":{"startLine":79}}}],"partialFingerprints":{"codehealthFindingId/v1":"6d185374987e2cfeba783e6c6deac91b067427c12310e6db8d3f8c4e727978cb"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (15 corresponding lines): d2layouts/d2talalayout/internal/placement/compaction.go:113-131 | d2layouts/d2talalayout/internal/placement/compaction.go:145-327 \u2014 These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/compaction.go"},"region":{"startLine":113}}}],"partialFingerprints":{"codehealthFindingId/v1":"dbf890083f42e2be48aa2d08577fad9b791daf4eb742efd92a30da799eded32d"}},{"ruleId":"D4","level":"warning","message":{"text":"Members sharing a duplicated core (18 members, 50\u002B identical tokens): d2layouts/d2talalayout/internal/nodeshape/shape_c4person.go:13-50 | d2layouts/d2talalayout/internal/nodeshape/shape_callout.go:13-50 | d2layouts/d2talalayout/internal/nodeshape/shape_circle.go:11-48 | d2layouts/d2talalayout/internal/nodeshape/shape_cloud.go:13-50 | d2layouts/d2talalayout/internal/nodeshape/shape_cylinder.go:12-48 | d2layouts/d2talalayout/internal/nodeshape/shape_diamond.go:13-50 | d2layouts/d2talalayout/internal/nodeshape/shape_document.go:12-49 | d2layouts/d2talalayout/internal/nodeshape/shape_hexagon.go:12-49 | d2layouts/d2talalayout/internal/nodeshape/shape_image.go:11-38 | d2layouts/d2talalayout/internal/nodeshape/shape_oval.go:12-49 | d2layouts/d2talalayout/internal/nodeshape/shape_package.go:15-52 | d2layouts/d2talalayout/internal/nodeshape/shape_page.go:11-48 | d2layouts/d2talalayout/internal/nodeshape/shape_parallelogram.go:12-49 | d2layouts/d2talalayout/internal/nodeshape/shape_person.go:13-50 | d2layouts/d2talalayout/internal/nodeshape/shape_queue.go:12-49 | d2layouts/d2talalayout/internal/nodeshape/shape_square.go:13-49 | d2layouts/d2talalayout/internal/nodeshape/shape_step.go:13-50 | d2layouts/d2talalayout/internal/nodeshape/shape_stored_data.go:12-49 \u2014 These 18 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below \u2014 it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 18 times. The repair is at the members\u0027 grain \u2014 factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 18 times."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/nodeshape/shape_c4person.go"},"region":{"startLine":13}}}],"partialFingerprints":{"codehealthFindingId/v1":"160de628c25b8bc0362f69ecd727d95a6a354fd9b75f386ca9d10f46e3fa324e"}},{"ruleId":"D4","level":"warning","message":{"text":"Members sharing a duplicated core (12 members, 50\u002B identical tokens): d2renderers/d2raster/image.go:585-604 | d2renderers/d2raster/image.go:606-625 | d2renderers/d2raster/image.go:627-657 | d2renderers/d2raster/image.go:659-684 | d2renderers/d2raster/image.go:686-711 | d2renderers/d2raster/image.go:713-745 | d2renderers/d2raster/image.go:747-779 | d2renderers/d2raster/image.go:781-814 | d2renderers/d2raster/image.go:816-842 | d2renderers/d2raster/image.go:844-870 | d2renderers/d2raster/image.go:876-904 | d2renderers/d2raster/image.go:906-938 \u2014 These 12 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below \u2014 it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 12 times. The repair is at the members\u0027 grain \u2014 factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 12 times."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/image.go"},"region":{"startLine":585}}}],"partialFingerprints":{"codehealthFindingId/v1":"cde3e5bd531ac3edb7b2d6b9299db530b271e090a8d60089f5430d7b29f4d550"}},{"ruleId":"D4","level":"warning","message":{"text":"Members sharing a duplicated core (7 members, 50\u002B identical tokens): d2layouts/d2talalayout/internal/trees/geometry.go:251-283 | d2layouts/d2talalayout/internal/trees/geometry.go:285-387 | d2layouts/d2talalayout/internal/trees/geometry.go:679-706 | d2layouts/d2talalayout/internal/trees/geometry.go:720-751 | d2layouts/d2talalayout/internal/trees/geometry.go:774-806 | d2layouts/d2talalayout/internal/trees/geometry.go:808-836 | d2layouts/d2talalayout/internal/trees/preprocess_helpers.go:578-621 \u2014 These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below \u2014 it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members\u0027 grain \u2014 factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/trees/geometry.go"},"region":{"startLine":251}}}],"partialFingerprints":{"codehealthFindingId/v1":"532c25c565f128036d6616d6410382033dcd09a79959374dbb71fc7af43de53e"}},{"ruleId":"D4","level":"warning","message":{"text":"Members sharing a duplicated core (6 members, 50\u002B identical tokens): d2renderers/d2raster/effects.go:1391-1455 | d2renderers/d2raster/effects.go:1461-1514 | d2renderers/d2raster/effects.go:1516-1626 | d2renderers/d2raster/effects.go:1689-1748 | d2renderers/d2raster/effects.go:1760-1887 | lib/xgif/xgif.go:1341-1447 \u2014 These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below \u2014 it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members\u0027 grain \u2014 factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/effects.go"},"region":{"startLine":1391}}}],"partialFingerprints":{"codehealthFindingId/v1":"84ad59998e3d90729b8f356714b8dfad1176095fa07658bbd0f5cec9c7b27330"}},{"ruleId":"D4","level":"warning","message":{"text":"Members sharing a duplicated core (5 members, 50\u002B identical tokens): d2renderers/d2svgimport/boilerplate.go:63-141 | d2renderers/d2svgimport/clip.go:91-111 | d2renderers/d2svgimport/compile.go:54-94 | d2renderers/d2svgimport/gradient.go:243-278 | d2renderers/d2svgimport/stylesheet.go:16-40 \u2014 These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below \u2014 it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members\u0027 grain \u2014 factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svgimport/boilerplate.go"},"region":{"startLine":63}}}],"partialFingerprints":{"codehealthFindingId/v1":"adc2bd4e41a3402b5b97129d12fe7455037aa3c382b51be727049b41ca88686c"}},{"ruleId":"D4","level":"warning","message":{"text":"Members sharing a duplicated core (4 members, 50\u002B identical tokens): d2layouts/d2talalayout/internal/hierarchy/discovery.go:38-97 | d2layouts/d2talalayout/internal/hierarchy/placement.go:105-139 | d2layouts/d2talalayout/internal/hierarchy/placement.go:192-256 | d2layouts/d2talalayout/internal/trees/layout.go:646-693 \u2014 These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below \u2014 it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members\u0027 grain \u2014 factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/hierarchy/discovery.go"},"region":{"startLine":38}}}],"partialFingerprints":{"codehealthFindingId/v1":"1ccb53d1f143d1ecda34b5e4eacfe1eba9a1def1326e32e0f26cb2bd0475187a"}},{"ruleId":"D4","level":"warning","message":{"text":"Members sharing a duplicated core (4 members, 50\u002B identical tokens): d2layouts/d2talalayout/internal/labeling/guard.go:486-555 | d2layouts/d2talalayout/internal/labeling/guard.go:557-620 | d2layouts/d2talalayout/internal/quality/labels.go:512-569 | d2layouts/d2talalayout/internal/routing/route_stage_guard.go:554-605 \u2014 These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below \u2014 it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members\u0027 grain \u2014 factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/labeling/guard.go"},"region":{"startLine":486}}}],"partialFingerprints":{"codehealthFindingId/v1":"0fb638971126595178380f6e4f112feb833aa9c7f28ece68e6424a1fec5ea8bf"}},{"ruleId":"D4","level":"warning","message":{"text":"Members sharing a duplicated core (4 members, 50\u002B identical tokens): d2layouts/d2talalayout/internal/proximity/nears.go:203-225 | d2layouts/d2talalayout/internal/routing/ovg_resource.go:460-482 | d2layouts/d2talalayout/internal/routing/route_search_guard.go:265-287 | d2layouts/d2talalayout/internal/routing/tunnel.go:69-91 \u2014 These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below \u2014 it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members\u0027 grain \u2014 factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/proximity/nears.go"},"region":{"startLine":203}}}],"partialFingerprints":{"codehealthFindingId/v1":"f4beaa4eaf71a53da011dc8ebdbfa0c3b2c1e8e511c03a0b8eeeb4232c148070"}},{"ruleId":"D4","level":"warning","message":{"text":"Members sharing a duplicated core (4 members, 50\u002B identical tokens): d2renderers/d2ascii/asciishapes/helpers.go:21-41 | d2renderers/d2ascii/asciishapes/package.go:5-34 | d2renderers/d2ascii/asciishapes/page.go:7-47 | d2renderers/d2ascii/asciishapes/rectangle.go:11-58 \u2014 These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below \u2014 it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members\u0027 grain \u2014 factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2ascii/asciishapes/helpers.go"},"region":{"startLine":21}}}],"partialFingerprints":{"codehealthFindingId/v1":"59659866eb9ff43510e46502d2279c5ce77acd017a83aa1cef8cf9c06bedfdae"}},{"ruleId":"D4","level":"warning","message":{"text":"Members sharing a duplicated core (4 members, 50\u002B identical tokens): d2renderers/d2raster/gradient.go:789-848 | d2renderers/d2raster/gradient.go:850-892 | d2renderers/d2raster/gradient.go:1123-1182 | d2renderers/d2raster/gradient.go:1184-1226 \u2014 These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below \u2014 it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members\u0027 grain \u2014 factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/gradient.go"},"region":{"startLine":789}}}],"partialFingerprints":{"codehealthFindingId/v1":"db66ec35769c4d64d7aa5c9c9dd2fb8f610bb4e40d5bfd54c89ee6538f729ac1"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (93 corresponding lines): d2layouts/d2talalayout/internal/labeling/placement.go:1024-1160 | d2layouts/d2talalayout/internal/quality/labels.go:418-510 \u2014 These two members are one piece of code written twice and then edited apart: 93 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/labeling/placement.go"},"region":{"startLine":1024}}}],"partialFingerprints":{"codehealthFindingId/v1":"046f6c442d31e82f0d381551dc03a7b83bec8d9ed3bf4c258c2bce806229b99d"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (81 corresponding lines): d2ast/d2ast.go:813-893 | d2ast/d2ast.go:895-994 \u2014 These two members are one piece of code written twice and then edited apart: 81 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ast/d2ast.go"},"region":{"startLine":813}}}],"partialFingerprints":{"codehealthFindingId/v1":"8b7b4a80fcbac5dce533fbcf801e33c8d2ec7776d4f95712dffc7ede1b65fdff"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (21 corresponding lines): d2renderers/d2svg/d2svg.go:2246-2266 | d2renderers/d2svg/table.go:16-42 \u2014 These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svg/d2svg.go"},"region":{"startLine":2246}}}],"partialFingerprints":{"codehealthFindingId/v1":"8c8aa84b00ad59e084784248e5bacf5c02cd24663be3345223f006d007056882"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (66 corresponding lines): d2renderers/d2sketch/sketch.go:107-172 | d2renderers/d2sketch/sketch.go:220-290 \u2014 These two members are one piece of code written twice and then edited apart: 66 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2sketch/sketch.go"},"region":{"startLine":107}}}],"partialFingerprints":{"codehealthFindingId/v1":"51655316b46e66278e03ad6eb9b8715e3983c44d8a1e5d1b4dd30dffc1eaafcf"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (72 corresponding lines): d2layouts/d2talalayout/internal/packing/combine_snapshot.go:25-96 | d2layouts/d2talalayout/internal/placement/types.go:47-118 \u2014 These two members are one piece of code written twice and then edited apart: 72 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/packing/combine_snapshot.go"},"region":{"startLine":25}}}],"partialFingerprints":{"codehealthFindingId/v1":"c2f51a98ee3373e9bb52aa6874e07db9ede27572ea113d57dbc94624540f77fa"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (62 corresponding lines): d2renderers/d2isometric/d2isometricimg/solid_contacts.go:151-213 | d2renderers/d2isometric/d2isometricimg/solid_contacts.go:218-279 \u2014 These two members are one piece of code written twice and then edited apart: 62 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/solid_contacts.go"},"region":{"startLine":151}}}],"partialFingerprints":{"codehealthFindingId/v1":"0d0e552e546b0345ad57d920e62bbb7a2eda58511cef7370b4109cb8f75e4473"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (65 corresponding lines): d2renderers/d2raster/gradient.go:723-787 | d2renderers/d2raster/gradient.go:1022-1090 \u2014 These two members are one piece of code written twice and then edited apart: 65 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/gradient.go"},"region":{"startLine":723}}}],"partialFingerprints":{"codehealthFindingId/v1":"75812f4285b5b43ca9eae8baee6e951c8e8cf1265b7b0c0fde8971d4a2b36d49"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (67 corresponding lines): d2renderers/d2ascii/asciiroute/routing.go:180-246 | d2renderers/d2ascii/asciiroute/routing.go:248-322 \u2014 These two members are one piece of code written twice and then edited apart: 67 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2ascii/asciiroute/routing.go"},"region":{"startLine":180}}}],"partialFingerprints":{"codehealthFindingId/v1":"fd684d8d27fb568606bc52120151b67442e84bc9c9126faeea4f71aa05ab11bb"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (59 corresponding lines): d2renderers/d2svgimport/path.go:324-395 | d2renderers/d2svgimport/transform.go:142-200 \u2014 These two members are one piece of code written twice and then edited apart: 59 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svgimport/path.go"},"region":{"startLine":324}}}],"partialFingerprints":{"codehealthFindingId/v1":"06f8462adf54b31402f37530e7894470b4c9a972e6ca9581b98ffbd7d7396c6c"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (64 corresponding lines): lib/xgif/xgif.go:722-794 | lib/xgif/xgif.go:796-859 \u2014 These two members are one piece of code written twice and then edited apart: 64 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/xgif/xgif.go"},"region":{"startLine":722}}}],"partialFingerprints":{"codehealthFindingId/v1":"f9ded747cdad9f631597185e7ec606740d3836d92e73f7e9c1d75ed273b9361b"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (69 corresponding lines): d2cli/paged.go:428-496 | d2cli/paged.go:509-578 \u2014 These two members are one piece of code written twice and then edited apart: 69 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2cli/paged.go"},"region":{"startLine":428}}}],"partialFingerprints":{"codehealthFindingId/v1":"909e746bec46b0b2faa3e307cebcf1f9816d0e55629d575900fa18b26332c6f9"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (68 corresponding lines): d2renderers/d2raster/effects.go:1023-1090 | d2renderers/d2raster/effects.go:1237-1311 \u2014 These two members are one piece of code written twice and then edited apart: 68 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/effects.go"},"region":{"startLine":1023}}}],"partialFingerprints":{"codehealthFindingId/v1":"015cea0700f14850615c98a9ca5fe939436de1de0754721bd55460d1e3b6095b"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (63 corresponding lines): d2layouts/d2dagrelayout/layout.go:664-726 | d2layouts/d2dagrelayout/layout.go:728-791 \u2014 These two members are one piece of code written twice and then edited apart: 63 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2dagrelayout/layout.go"},"region":{"startLine":664}}}],"partialFingerprints":{"codehealthFindingId/v1":"e029e387ebaefd6e59b38d5871db62015dac5bb1a775fdd0fad7e71bf8efa5ed"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (52 corresponding lines): d2layouts/d2talalayout/internal/placement/sizeless_optimizer.go:280-333 | d2layouts/d2talalayout/internal/placement/sizeless_optimizer.go:350-401 \u2014 These two members are one piece of code written twice and then edited apart: 52 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/sizeless_optimizer.go"},"region":{"startLine":280}}}],"partialFingerprints":{"codehealthFindingId/v1":"45925330a4cf02bb6afd4fedd366b5f3ee617471e83c3a53ea3d8f631fd6574f"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (45 corresponding lines): d2layouts/d2talalayout/internal/routing/shortcut_routes.go:419-463 | d2layouts/d2talalayout/internal/routing/shortcut_routes.go:469-516 \u2014 These two members are one piece of code written twice and then edited apart: 45 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/shortcut_routes.go"},"region":{"startLine":419}}}],"partialFingerprints":{"codehealthFindingId/v1":"87f1a4ff930fd954f450eb91c21390e2c261d8c74db5385feb2d3086d43e3896"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (28 corresponding lines): d2renderers/d2raster/geometry.go:500-527 | d2renderers/d2raster/gradient.go:1352-1379 \u2014 These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/geometry.go"},"region":{"startLine":500}}}],"partialFingerprints":{"codehealthFindingId/v1":"ea1642679b6fac450264809034d9fd35ff8f61e122ee4706113b87e7eebd2fb6"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (30 corresponding lines): d2renderers/d2raster/filter.go:1131-1161 | d2renderers/d2raster/filter.go:1163-1192 \u2014 These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/filter.go"},"region":{"startLine":1131}}}],"partialFingerprints":{"codehealthFindingId/v1":"f60ba64fe119ffd39890bf465028c9aaeeb6cebcc71ce89aa4f93327d4317713"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (56 corresponding lines): d2layouts/d2talalayout/internal/layoutgraph/clone.go:347-404 | d2layouts/d2talalayout/internal/layoutgraph/clone.go:406-461 \u2014 These two members are one piece of code written twice and then edited apart: 56 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/clone.go"},"region":{"startLine":347}}}],"partialFingerprints":{"codehealthFindingId/v1":"27262d8080da72b537ae05dad1a2cd419ca05528c731787a6fa67b540e1201f6"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (33 corresponding lines): d2layouts/d2dagrelayout/layout.go:577-609 | d2layouts/d2elklayout/layout.go:1153-1185 \u2014 These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2dagrelayout/layout.go"},"region":{"startLine":577}}}],"partialFingerprints":{"codehealthFindingId/v1":"9f897643e583625b108313d58ba14b0371cf81a9db0dfb1f051dd413fefb51b5"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (53 corresponding lines): d2renderers/d2raster/gradient.go:934-986 | d2renderers/d2raster/gradient.go:1268-1320 \u2014 These two members are one piece of code written twice and then edited apart: 53 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/gradient.go"},"region":{"startLine":934}}}],"partialFingerprints":{"codehealthFindingId/v1":"200e3a9f111c7b8b0507579f2d2a45bb6c57829021ca7b0933326306bd2d0eeb"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (38 corresponding lines): d2layouts/d2talalayout/internal/layoutgraph/node.go:1408-1467 | d2layouts/d2talalayout/internal/routing/geometry.go:9-46 \u2014 These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/node.go"},"region":{"startLine":1408}}}],"partialFingerprints":{"codehealthFindingId/v1":"a069a5ead64dcc58cf8620add1fced3896a587870944b53a6caf4ec2daf02fdd"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (48 corresponding lines): d2layouts/d2talalayout/internal/layoutgraph/tree_access.go:48-95 | d2layouts/d2talalayout/internal/trees/preprocess_helpers.go:651-698 \u2014 These two members are one piece of code written twice and then edited apart: 48 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/tree_access.go"},"region":{"startLine":48}}}],"partialFingerprints":{"codehealthFindingId/v1":"2335e40e9582be25002554f60eaa197ae0fcb07d6ebdd6767240ff454d6ade6f"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (64 corresponding lines): d2renderers/d2svgimport/image.go:492-561 | internal/rasterimage/firstframe.go:232-295 \u2014 These two members are one piece of code written twice and then edited apart: 64 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svgimport/image.go"},"region":{"startLine":492}}}],"partialFingerprints":{"codehealthFindingId/v1":"f90ea5f996b3278667afcf3dad9812e7a226925335b41a22d56bfa17dd1e24b8"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (43 corresponding lines): d2renderers/d2raster/raster.go:1186-1229 | d2renderers/d2raster/vector_validation.go:283-325 \u2014 These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/raster.go"},"region":{"startLine":1186}}}],"partialFingerprints":{"codehealthFindingId/v1":"9d57b25a60b94db9a60bd80330e336c91047c3028c7cf66bc98215d0c6e58bb0"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (44 corresponding lines): d2ir/import_cache.go:46-89 | d2ir/import_cache.go:91-146 \u2014 These two members are one piece of code written twice and then edited apart: 44 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ir/import_cache.go"},"region":{"startLine":46}}}],"partialFingerprints":{"codehealthFindingId/v1":"259152bed74cce5793a0c98938ce7b36dec07148453333cdc06434c7cf6b462f"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copies of one member (3 members, 63\u002B corresponding lines): d2layouts/d2talalayout/internal/nodeshape/shape_cylinder.go:50-112 | d2layouts/d2talalayout/internal/nodeshape/shape_queue.go:51-113 | d2layouts/d2talalayout/internal/nodeshape/shape_stored_data.go:51-118 \u2014 These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 63 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/nodeshape/shape_cylinder.go"},"region":{"startLine":50}}}],"partialFingerprints":{"codehealthFindingId/v1":"deed7991ba9251e2402208925f472a929420cc3193c64d8f5bafeb728b7e9a8a"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (40 corresponding lines): d2layouts/d2talalayout/internal/routing/balance_route_guard.go:91-131 | lib/geo/segment.go:81-120 \u2014 These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/balance_route_guard.go"},"region":{"startLine":91}}}],"partialFingerprints":{"codehealthFindingId/v1":"f7017b25b23b56eb812dea5cdcf80e23c0348d197188c1055fa50a6ad3eb653d"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (50 corresponding lines): d2cli/paged.go:344-405 | d2cli/raster.go:905-954 \u2014 These two members are one piece of code written twice and then edited apart: 50 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2cli/paged.go"},"region":{"startLine":344}}}],"partialFingerprints":{"codehealthFindingId/v1":"4d2be9d3fca0aa944cb8b2a8b909f625e486a944705b9f158d3fe409dcc756f9"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (24 corresponding lines): d2renderers/d2ascii/asciishapes/hexagon.go:7-31 | d2renderers/d2ascii/asciishapes/queue.go:3-26 \u2014 These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2ascii/asciishapes/hexagon.go"},"region":{"startLine":7}}}],"partialFingerprints":{"codehealthFindingId/v1":"c35eef376f0e467c4043b9b319c18c081333af8a0247d2a358234afebc660872"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (25 corresponding lines): d2layouts/d2talalayout/internal/packing/guard.go:221-245 | d2layouts/d2talalayout/internal/packing/guard.go:274-311 \u2014 These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/packing/guard.go"},"region":{"startLine":221}}}],"partialFingerprints":{"codehealthFindingId/v1":"646250532a53066847cd4511bc25f2403bc5a44a3478a438fba771841a6d989f"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (51 corresponding lines): d2graph/layout.go:167-217 | d2graph/layout.go:221-271 \u2014 These two members are one piece of code written twice and then edited apart: 51 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2graph/layout.go"},"region":{"startLine":167}}}],"partialFingerprints":{"codehealthFindingId/v1":"8e598aea6d91f3be9ee6757f18f1643b97e12cd0225f9987bfefd44d3dcd7a63"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (18 corresponding lines): d2renderers/d2isometric/d2isometricimg/route_style.go:29-46 | d2renderers/d2isometric/d2isometricimg/route_style.go:51-78 \u2014 These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/route_style.go"},"region":{"startLine":29}}}],"partialFingerprints":{"codehealthFindingId/v1":"5ec358d1d14013a8a0fbe397436c4508e1ae66f3bde06a6d943e330fdb7b1f68"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (30 corresponding lines): d2renderers/d2raster/gradient.go:250-284 | d2renderers/d2raster/pattern.go:166-195 \u2014 These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/gradient.go"},"region":{"startLine":250}}}],"partialFingerprints":{"codehealthFindingId/v1":"85f6b19c212a755e3abbc6ddbfddb6531851a699dca31047339244a9a6a3da6b"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (38 corresponding lines): d2renderers/d2scenebuild/code_shape.go:360-397 | d2renderers/d2scenebuild/markdown.go:388-425 \u2014 These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/code_shape.go"},"region":{"startLine":360}}}],"partialFingerprints":{"codehealthFindingId/v1":"074a34a10e5308ca80d648c9f2f77b8dc5f022806d352ed75cd9e4510c1c80fa"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (39 corresponding lines): d2renderers/d2raster/gradient.go:894-932 | d2renderers/d2raster/gradient.go:1228-1266 \u2014 These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/gradient.go"},"region":{"startLine":894}}}],"partialFingerprints":{"codehealthFindingId/v1":"a3905ae1ad6dbf8a7a1eaf481d297c9bdc33f08ac8b32cd43d63184b513c63f8"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (37 corresponding lines): lib/textmeasure/textmeasure.go:277-313 | lib/textmeasure/textmeasure.go:450-496 \u2014 These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/textmeasure/textmeasure.go"},"region":{"startLine":277}}}],"partialFingerprints":{"codehealthFindingId/v1":"d0e54ea8b4b6f86b2e2bfe27841127cd5075b7d26801d76df26f33367c8b8e5d"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (31 corresponding lines): d2renderers/internal/fontface/face.go:191-231 | d2renderers/internal/fontface/face.go:450-480 \u2014 These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/internal/fontface/face.go"},"region":{"startLine":191}}}],"partialFingerprints":{"codehealthFindingId/v1":"214026a606a64ecb1d971f21d32f3a6fc23831176da2c6f8ec63217857521fe4"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (34 corresponding lines): d2layouts/d2talalayout/internal/layoutgraph/node.go:1555-1588 | d2layouts/d2talalayout/internal/layoutgraph/node.go:1590-1627 \u2014 These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/node.go"},"region":{"startLine":1555}}}],"partialFingerprints":{"codehealthFindingId/v1":"8cff09771dd9c3b150d50878f5d0cbbc7234a19ed2b935be058fc9d013ab78c8"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (47 corresponding lines): d2layouts/d2talalayout/internal/routing/slingshot.go:80-126 | d2layouts/d2talalayout/internal/routing/slingshot.go:128-174 \u2014 These two members are one piece of code written twice and then edited apart: 47 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/slingshot.go"},"region":{"startLine":80}}}],"partialFingerprints":{"codehealthFindingId/v1":"f7c3bf85f985a64e114abd2b9ff8d0dcc8a652a26944b8e11bd28969b8a96623"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (19 corresponding lines): d2layouts/d2talalayout/internal/routing/ovg_resource.go:364-389 | d2layouts/d2talalayout/internal/routing/ovg_resource.go:391-409 \u2014 These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/ovg_resource.go"},"region":{"startLine":364}}}],"partialFingerprints":{"codehealthFindingId/v1":"3f86837b98ae81c447f73cdf6bfa9482f83b8dd6b8d053c69e0d702a8d0d150e"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (9 corresponding lines): d2renderers/d2isometric/d2isometricimg/native_shapes.go:429-437 | d2renderers/d2isometric/d2isometricimg/native_structured.go:220-238 \u2014 These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/native_shapes.go"},"region":{"startLine":429}}}],"partialFingerprints":{"codehealthFindingId/v1":"c63699214a2de89000154ade0d8383d257d8a9819b8d460d36c8cd47e0e61d8b"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (14 corresponding lines): lib/shape/shape_queue.go:45-58 | lib/shape/shape_stored_data.go:36-52 \u2014 These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/shape/shape_queue.go"},"region":{"startLine":45}}}],"partialFingerprints":{"codehealthFindingId/v1":"4a5f3e52a1316f50c09fea02b6d8ed64a82f8dd72695508a78e34e1ca7b051a9"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (40 corresponding lines): d2layouts/d2talalayout/internal/layoutgraph/graph.go:877-916 | d2layouts/d2talalayout/internal/routing/ovg_resource.go:539-579 \u2014 These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/graph.go"},"region":{"startLine":877}}}],"partialFingerprints":{"codehealthFindingId/v1":"9e80d68313669a10b6aed8df560b64aa39bdb0067e8b928b40c5712b30132b82"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (22 corresponding lines): d2renderers/d2raster/raster.go:1231-1252 | d2renderers/d2raster/raster.go:1254-1275 \u2014 These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/raster.go"},"region":{"startLine":1231}}}],"partialFingerprints":{"codehealthFindingId/v1":"e105b225c5ad223b3b1564cf4ac8f01c73caf17eba052a6c95bdbee8c5121c86"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (33 corresponding lines): d2renderers/d2svg/class.go:15-47 | d2renderers/d2svg/table.go:48-80 \u2014 These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svg/class.go"},"region":{"startLine":15}}}],"partialFingerprints":{"codehealthFindingId/v1":"0a61ca982ad483d3b65a156cf6835de2482621969d7d43dfd09c2ca687f0c4c6"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (36 corresponding lines): d2layouts/d2talalayout/internal/layoutgraph/node.go:1309-1344 | d2layouts/d2talalayout/internal/layoutgraph/node.go:1359-1401 \u2014 These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/node.go"},"region":{"startLine":1309}}}],"partialFingerprints":{"codehealthFindingId/v1":"3ba82093fb2555cfce4d838648bb11d7863fb654cc6f80dfa7efe8ce4fc4872a"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (16 corresponding lines): d2renderers/d2scenebuild/assets.go:509-524 | d2renderers/d2scenebuild/assets.go:528-545 \u2014 These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/assets.go"},"region":{"startLine":509}}}],"partialFingerprints":{"codehealthFindingId/v1":"864cb71a401008f8124ae45cae774d62779a0f3cf8eeae1fe5af9522babfca42"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (18 corresponding lines): d2renderers/d2raster/vector_validation.go:327-344 | d2renderers/d2raster/vector_validation.go:365-390 \u2014 These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/vector_validation.go"},"region":{"startLine":327}}}],"partialFingerprints":{"codehealthFindingId/v1":"ee13eba2b6f0e38d9b234c35f0db10f5365d7832deaac6fbd238f566d195a4d3"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (33 corresponding lines): d2js/d2wasm/functions.go:545-577 | d2renderers/d2svg/d2svg.go:3582-3618 \u2014 These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2js/d2wasm/functions.go"},"region":{"startLine":545}}}],"partialFingerprints":{"codehealthFindingId/v1":"56cd69a0e3c44446f735d26eef1a0df10a5644ba9d2e785bb2501e06e43a51ab"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (21 corresponding lines): d2renderers/d2raster/image.go:197-217 | d2renderers/d2svgimport/image.go:340-360 \u2014 These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/image.go"},"region":{"startLine":197}}}],"partialFingerprints":{"codehealthFindingId/v1":"03cf7200817aeb69431fb4b3c09ed7e29287f3fea9e1e3ca4e3415c52dfa2787"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (29 corresponding lines): d2layouts/d2talalayout/internal/trees/geometry.go:30-62 | d2layouts/d2talalayout/internal/trees/preprocess_helpers.go:431-459 \u2014 These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/trees/geometry.go"},"region":{"startLine":30}}}],"partialFingerprints":{"codehealthFindingId/v1":"bcce4dd319ec0f9b1523183ea5ca02cfeb87260012e2c91c87e6a6be68332614"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (25 corresponding lines): d2renderers/d2scenebuild/build.go:1230-1254 | d2target/render_validation.go:379-403 \u2014 These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/build.go"},"region":{"startLine":1230}}}],"partialFingerprints":{"codehealthFindingId/v1":"451ea4b9028399c4edb1041a69d175b4ae44c2ebf210cee9e98f48e2774deaf6"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (25 corresponding lines): d2renderers/d2scenebuild/labels.go:133-157 | d2renderers/d2scenebuild/markdown.go:73-99 \u2014 These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/labels.go"},"region":{"startLine":133}}}],"partialFingerprints":{"codehealthFindingId/v1":"b82f6ee59e25c4a003b45c9002b3fcf7ee33adad2d175a2a0ba1b186d90abf48"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (25 corresponding lines): d2renderers/d2scenebuild/metadata.go:105-129 | d2renderers/d2scenebuild/metadata.go:131-155 \u2014 These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/metadata.go"},"region":{"startLine":105}}}],"partialFingerprints":{"codehealthFindingId/v1":"696eed4b0b8740d5de52dc7eee569ad6c660aa068741a04b31d861d797200044"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (21 corresponding lines): d2layouts/d2talalayout/internal/graphbounds/bounds.go:137-157 | d2layouts/d2talalayout/internal/layoutgraph/node.go:544-565 \u2014 These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/graphbounds/bounds.go"},"region":{"startLine":137}}}],"partialFingerprints":{"codehealthFindingId/v1":"ea2049d0b7dec1f20adbcc11e7e17577999a62f6a24ffbda30ac5c6dbd96d16d"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (22 corresponding lines): d2layouts/d2talalayout/internal/nodeshape/shape_package.go:113-134 | d2layouts/d2talalayout/internal/nodeshape/shape_square.go:80-101 \u2014 These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/nodeshape/shape_package.go"},"region":{"startLine":113}}}],"partialFingerprints":{"codehealthFindingId/v1":"60a990534588deb882e442350bbf61a53963f74799f29754794fc7f9587d8559"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (30 corresponding lines): d2ir/merge.go:25-54 | d2ir/merge.go:64-105 \u2014 These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ir/merge.go"},"region":{"startLine":25}}}],"partialFingerprints":{"codehealthFindingId/v1":"7785f63c815443161fc54aa7ac7a12560b793f85232770565c06e6b0cefe64e6"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (14 corresponding lines): lib/shape/shape_cylinder.go:49-62 | lib/shape/shape_page.go:42-59 \u2014 These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/shape/shape_cylinder.go"},"region":{"startLine":49}}}],"partialFingerprints":{"codehealthFindingId/v1":"9c868aaea2e9ee83db658037206cca6dcac72d2b694382bd880eb49df1fcc454"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (34 corresponding lines): d2layouts/d2talalayout/internal/routing/coordinator.go:1550-1587 | d2layouts/d2talalayout/internal/routing/standalone_route_guard.go:66-99 \u2014 These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/coordinator.go"},"region":{"startLine":1550}}}],"partialFingerprints":{"codehealthFindingId/v1":"c65ad0505d541ca6e15faa39b2e607a2cc4aaffde822239f98496c61078f6f5b"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (17 corresponding lines): d2renderers/d2ascii/asciiroute/drawing.go:146-164 | d2renderers/d2ascii/asciiroute/drawing.go:166-182 \u2014 These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2ascii/asciiroute/drawing.go"},"region":{"startLine":146}}}],"partialFingerprints":{"codehealthFindingId/v1":"029296ec9889227d100c280e1f7d40977e5db2be537a0c532ee1da6c82c29a31"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copies of one member (3 members, 32\u002B corresponding lines): d2renderers/d2sketch/sketch.go:673-710 | d2renderers/d2svg/class.go:49-90 | d2renderers/d2svg/table.go:82-113 \u2014 These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 32 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2sketch/sketch.go"},"region":{"startLine":673}}}],"partialFingerprints":{"codehealthFindingId/v1":"82e6315792bcf377c6faa4939f3eb15c073f140ae2b8eab909d3a16b2bbfbde5"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (21 corresponding lines): d2renderers/d2scenebuild/assets.go:301-323 | d2renderers/d2svgimport/image.go:268-288 \u2014 These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/assets.go"},"region":{"startLine":301}}}],"partialFingerprints":{"codehealthFindingId/v1":"0cb22499d6de0c15fc2ad6f1fb5869d7fdc42778bd562a94c162bb8d097f951c"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (31 corresponding lines): d2renderers/d2ascii/asciiroute/labels.go:136-166 | d2renderers/d2ascii/asciiroute/labels.go:168-198 \u2014 These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2ascii/asciiroute/labels.go"},"region":{"startLine":136}}}],"partialFingerprints":{"codehealthFindingId/v1":"bac230826f26e07acd75b55060103f6cfc678d328be0dbb4903ca8b980bc0078"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (37 corresponding lines): d2renderers/d2fonts/fallback.go:300-336 | d2renderers/d2scenebuild/pattern_sources.go:56-95 \u2014 These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2fonts/fallback.go"},"region":{"startLine":300}}}],"partialFingerprints":{"codehealthFindingId/v1":"3f3d62197a6c4fecd5869c6e450cf8e8fb1354c5918d45c3d2b17ec63f0b4ce7"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (26 corresponding lines): d2renderers/d2scenebuild/shape_effects.go:251-276 | d2renderers/d2scenebuild/sketch_shapes.go:464-496 \u2014 These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/shape_effects.go"},"region":{"startLine":251}}}],"partialFingerprints":{"codehealthFindingId/v1":"0932d43a828e24228d3a7e780bf9ff3f5578a3509b095de42f47a31d71a8627d"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (15 corresponding lines): lib/shape/shape_diamond.go:37-51 | lib/shape/shape_person.go:41-63 \u2014 These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/shape/shape_diamond.go"},"region":{"startLine":37}}}],"partialFingerprints":{"codehealthFindingId/v1":"ea28c0d0a1486efa381b596bdbed30b815343cff433e2e7fd7d0dba067279c80"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (20 corresponding lines): lib/geo/box.go:31-50 | lib/geo/box.go:52-73 \u2014 These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/geo/box.go"},"region":{"startLine":31}}}],"partialFingerprints":{"codehealthFindingId/v1":"9eae98f89469cddf85d9166d1dcbad9f6115879beb125569175978c58a8246d6"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (31 corresponding lines): d2ir/pattern.go:134-164 | d2ir/pattern.go:166-196 \u2014 These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ir/pattern.go"},"region":{"startLine":134}}}],"partialFingerprints":{"codehealthFindingId/v1":"73625a98ec8336ab0de142ba1b09ace4b815aa4a08832794c5050d1f2755da33"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (25 corresponding lines): d2ir/pattern.go:73-97 | d2ir/pattern.go:108-132 \u2014 These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ir/pattern.go"},"region":{"startLine":73}}}],"partialFingerprints":{"codehealthFindingId/v1":"62fe2476c9dd37695ef07a331b5c370e9beda41be5ead0e7a19f03645fa42419"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (20 corresponding lines): d2layouts/d2talalayout/internal/packing/combine.go:69-88 | d2layouts/d2talalayout/internal/routing/snapshot.go:54-74 \u2014 These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/packing/combine.go"},"region":{"startLine":69}}}],"partialFingerprints":{"codehealthFindingId/v1":"717a3d1eaa1d0848230f4cb89111c0bcb03eb96ab0af3b65c4d216aba2715582"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (20 corresponding lines): d2renderers/d2raster/effects.go:610-632 | d2renderers/d2raster/effects.go:634-653 \u2014 These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/effects.go"},"region":{"startLine":610}}}],"partialFingerprints":{"codehealthFindingId/v1":"b733b3c8a23250527b5545a4b7008628ae96197caea9601f4c5262692f1e58aa"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copies of one member (3 members, 28\u002B corresponding lines): d2layouts/d2talalayout/internal/grouping/cluster_discovery.go:204-234 | d2layouts/d2talalayout/internal/packing/guard.go:57-84 | d2layouts/d2talalayout/internal/placement/optimization_guard.go:23-53 \u2014 These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 28 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/grouping/cluster_discovery.go"},"region":{"startLine":204}}}],"partialFingerprints":{"codehealthFindingId/v1":"f47b26a5e87631b5eac763e346debc70c1385dd93d54161abecc74e8d8da7ac7"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (21 corresponding lines): d2layouts/d2talalayout/internal/layoutgraph/edge.go:558-581 | d2layouts/d2talalayout/internal/routing/standalone_route_guard.go:301-321 \u2014 These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/edge.go"},"region":{"startLine":558}}}],"partialFingerprints":{"codehealthFindingId/v1":"2b7b58325379c08cb398043507f88a2c9d7c9bc9e793c6cc35ea774e9b1b36ff"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (24 corresponding lines): d2renderers/d2fonts/bundled_fallback.go:258-281 | d2renderers/d2fonts/fallback.go:622-649 \u2014 These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2fonts/bundled_fallback.go"},"region":{"startLine":258}}}],"partialFingerprints":{"codehealthFindingId/v1":"300646b91ecc3803c51070548c4bd59c199c7d2b33531f73a301c75b352da0d6"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (17 corresponding lines): d2cli/paged.go:223-239 | d2cli/raster.go:371-392 \u2014 These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2cli/paged.go"},"region":{"startLine":223}}}],"partialFingerprints":{"codehealthFindingId/v1":"559b1cb8adf3780649d7bbd68f2a727e0f8f21a2e1fe8a41bdfec9e961c56319"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (18 corresponding lines): d2renderers/d2raster/geometry.go:274-291 | d2renderers/d2raster/geometry.go:293-314 \u2014 These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/geometry.go"},"region":{"startLine":274}}}],"partialFingerprints":{"codehealthFindingId/v1":"a3ac481f64cf63f88844b5f70965afe2f61603ee0883472acf92dd584af99d67"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (20 corresponding lines): internal/rasterimage/firstframe.go:653-672 | internal/rasterimage/firstframe.go:674-698 \u2014 These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/rasterimage/firstframe.go"},"region":{"startLine":653}}}],"partialFingerprints":{"codehealthFindingId/v1":"5b740cb82623313db6729d8539cc72e1c3fc6952a633acd657b2d10e8aa2092e"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (18 corresponding lines): d2layouts/d2talalayout/internal/layoutgraph/transaction_snapshot.go:216-233 | d2layouts/d2talalayout/internal/packing/combine.go:50-67 \u2014 These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/transaction_snapshot.go"},"region":{"startLine":216}}}],"partialFingerprints":{"codehealthFindingId/v1":"5691cc726bf5819a60d6321e698102d0d1f3f9468efa938e9e492ae88652077f"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (10 corresponding lines): d2layouts/d2talalayout/internal/layoutgraph/node.go:1153-1170 | d2layouts/d2talalayout/internal/placementcost/geometry.go:95-104 \u2014 These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/node.go"},"region":{"startLine":1153}}}],"partialFingerprints":{"codehealthFindingId/v1":"4d4ad597b466397fc44c5a31811bf95ceaf724c109689232d664e932ca7c3ebc"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (21 corresponding lines): d2renderers/d2raster/session.go:455-475 | d2renderers/d2raster/session.go:477-499 \u2014 These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/session.go"},"region":{"startLine":455}}}],"partialFingerprints":{"codehealthFindingId/v1":"713c3b14d4b0a7cfd1d6b1a8d1f36e4d02e0bcf9b0ea2ee16cf51f540188c95d"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (19 corresponding lines): internal/testutil/pdf.go:250-272 | internal/testutil/pptx.go:155-173 \u2014 These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/testutil/pdf.go"},"region":{"startLine":250}}}],"partialFingerprints":{"codehealthFindingId/v1":"c8590d1b730338c24aac9de79a694f27bbcec378e0e6bf2b795c9f796f9ef260"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copies of one member (3 members, 15\u002B corresponding lines): lib/svg/path.go:84-98 | lib/svg/path.go:124-139 | lib/svg/path.go:141-156 \u2014 These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/svg/path.go"},"region":{"startLine":84}}}],"partialFingerprints":{"codehealthFindingId/v1":"6bbec66f9eeeda6415b0fb674fe3a22984aa96a3fcb9a28b0bb8a599c243f1a8"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (22 corresponding lines): d2layouts/d2talalayout/internal/nodeshape/shape_diamond.go:73-94 | d2layouts/d2talalayout/internal/nodeshape/shape_step.go:85-106 \u2014 These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/nodeshape/shape_diamond.go"},"region":{"startLine":73}}}],"partialFingerprints":{"codehealthFindingId/v1":"b792f0ba5f61dd8730c3c0523f9f2582eae940404463c7a8f11d424e0f252729"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (17 corresponding lines): d2layouts/d2talalayout/internal/trees/geometry.go:506-522 | d2layouts/d2talalayout/internal/trees/geometry.go:524-544 \u2014 These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/trees/geometry.go"},"region":{"startLine":506}}}],"partialFingerprints":{"codehealthFindingId/v1":"eab2c32d96a7a06ab97d93c83ec4b6b7ffb0931839a4061be7d33bfb3eb3b798"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (18 corresponding lines): d2renderers/d2raster/image.go:940-957 | d2renderers/d2raster/image.go:959-981 \u2014 These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/image.go"},"region":{"startLine":940}}}],"partialFingerprints":{"codehealthFindingId/v1":"174d6e0583aa0101a7619f48010fa322228b8ef6f9aee81e9b2ce3fca0437228"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (20 corresponding lines): d2renderers/d2raster/session.go:525-544 | lib/imageasset/imageasset.go:139-162 \u2014 These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/session.go"},"region":{"startLine":525}}}],"partialFingerprints":{"codehealthFindingId/v1":"f9070a41787f31e027b1fdcc170ba14269f9706785cc98fb7e509f3ed7ab6fe0"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copies of one member (3 members, 13\u002B corresponding lines): ci/release/releasetool/main.go:59-73 | ci/release/releasetool/main.go:75-87 | ci/release/releasetool/main.go:136-149 \u2014 These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"ci/release/releasetool/main.go"},"region":{"startLine":59}}}],"partialFingerprints":{"codehealthFindingId/v1":"3fc5052714acdf8ce13ab59137eaca2f449f066f66590056211295fddf187691"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (28 corresponding lines): d2ast/d2ast.go:1351-1382 | d2ast/d2ast.go:1399-1426 \u2014 These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ast/d2ast.go"},"region":{"startLine":1351}}}],"partialFingerprints":{"codehealthFindingId/v1":"763e191984c700e4010e1b49b11d4f46483457e5fb23720e98eac9959061c76d"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (15 corresponding lines): d2ir/merge.go:120-136 | d2ir/merge.go:147-161 \u2014 These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ir/merge.go"},"region":{"startLine":120}}}],"partialFingerprints":{"codehealthFindingId/v1":"f1839690393857a9f8ce2ba64fdc0b5fa8a62f111a9b6eb0113477a9b88ff317"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (13 corresponding lines): d2renderers/d2scene/geometry.go:112-124 | d2renderers/d2scenebuild/markdown.go:458-470 \u2014 These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scene/geometry.go"},"region":{"startLine":112}}}],"partialFingerprints":{"codehealthFindingId/v1":"920ff315225e6451e0865e730cc2dd67c644afe4006f97f7f943f330d908a170"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (24 corresponding lines): d2layouts/d2talalayout/internal/trees/preprocess_helpers.go:281-304 | d2layouts/d2talalayout/internal/trees/preprocess_helpers.go:375-398 \u2014 These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/trees/preprocess_helpers.go"},"region":{"startLine":281}}}],"partialFingerprints":{"codehealthFindingId/v1":"7562068b88d9aae8b3f3651f2363ab69588c00b275a1ab0a31402f9bab287ea9"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (22 corresponding lines): d2renderers/d2raster/raster.go:901-922 | d2renderers/d2raster/raster.go:924-948 \u2014 These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/raster.go"},"region":{"startLine":901}}}],"partialFingerprints":{"codehealthFindingId/v1":"13e373d31ef19f226325091005528228ee1730b31dec0022bffecb0d13a3b434"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (18 corresponding lines): d2layouts/d2talalayout/internal/grouping/clusters.go:111-128 | d2layouts/d2talalayout/internal/grouping/sequences.go:404-421 \u2014 These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/grouping/clusters.go"},"region":{"startLine":111}}}],"partialFingerprints":{"codehealthFindingId/v1":"fe3e03458ffd2d55a470b2f4c38477f17b9d2f0abf77142f83b7924bfd0e1967"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (20 corresponding lines): d2cli/raster_png_encoder.go:496-515 | d2cli/raster_png_encoder.go:517-537 \u2014 These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2cli/raster_png_encoder.go"},"region":{"startLine":496}}}],"partialFingerprints":{"codehealthFindingId/v1":"cbb236699d1a49c49596e1ff9ef43d50c54dc97ba09a3fa5143600d8dd8bf928"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (20 corresponding lines): d2layouts/d2talalayout/internal/placement/optimization_guard.go:73-92 | d2layouts/d2talalayout/internal/placement/optimization_guard.go:490-509 \u2014 These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/optimization_guard.go"},"region":{"startLine":73}}}],"partialFingerprints":{"codehealthFindingId/v1":"ea58422be7601247df33c5b19276f88019daf9d09b395a648b8a9cae35c4d1fc"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (17 corresponding lines): d2renderers/d2raster/effects.go:99-115 | d2renderers/d2raster/effects.go:117-133 \u2014 These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/effects.go"},"region":{"startLine":99}}}],"partialFingerprints":{"codehealthFindingId/v1":"6ca85f656ac136ebaab95d564e5cb29afb44c1bff77a4d866ac3f346aeb0ad4f"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (23 corresponding lines): d2layouts/d2talalayout/internal/packing/guard.go:394-416 | d2layouts/d2talalayout/internal/packing/guard.go:418-440 \u2014 These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/packing/guard.go"},"region":{"startLine":394}}}],"partialFingerprints":{"codehealthFindingId/v1":"db6e923a043a80977d64633a35635a85656956ad0493205f23a38a4ae3e13b10"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (19 corresponding lines): d2layouts/d2talalayout/internal/routing/cluster_route_guard.go:48-66 | d2layouts/d2talalayout/internal/routing/edge_simplify.go:242-266 \u2014 These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/cluster_route_guard.go"},"region":{"startLine":48}}}],"partialFingerprints":{"codehealthFindingId/v1":"599b9f4c9e21e2fa19863f75b4838cf5b47b3f11604a466803801c82a4104c95"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copies of one member (4 members, 19\u002B corresponding lines): d2renderers/d2raster/image.go:1200-1219 | d2renderers/d2raster/image.go:1221-1240 | d2renderers/d2raster/image.go:1242-1261 | d2renderers/d2raster/image.go:1290-1308 \u2014 These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/image.go"},"region":{"startLine":1200}}}],"partialFingerprints":{"codehealthFindingId/v1":"912775d8a1b9f852e4c795338c13124783eac1d536d61f7530cbeb6ca7641c27"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (28 corresponding lines): d2ast/d2ast.go:1318-1349 | d2ast/d2ast.go:1428-1455 \u2014 These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ast/d2ast.go"},"region":{"startLine":1318}}}],"partialFingerprints":{"codehealthFindingId/v1":"4bf8e0710600d88ef593e10a90c99318229e37c553d248c46013815e8cffcce5"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (15 corresponding lines): d2ir/d2ir.go:334-348 | d2ir/d2ir.go:350-366 \u2014 These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ir/d2ir.go"},"region":{"startLine":334}}}],"partialFingerprints":{"codehealthFindingId/v1":"ae630d0f07017c2fc4147d99410c5c07cb9d59867f31608af3378c6f4c314a0b"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (12 corresponding lines): d2renderers/d2raster/effects.go:1360-1372 | d2renderers/d2raster/effects.go:1374-1385 \u2014 These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/effects.go"},"region":{"startLine":1360}}}],"partialFingerprints":{"codehealthFindingId/v1":"180b20dc22823cacf3511ecfe7b5e309b6c9b5820b92387500104cdca032fc0d"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (18 corresponding lines): lib/textmeasure/textmeasure.go:197-218 | lib/textmeasure/textmeasure.go:224-241 \u2014 These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/textmeasure/textmeasure.go"},"region":{"startLine":197}}}],"partialFingerprints":{"codehealthFindingId/v1":"27162380c43fd2cfcb5eca845b2caf4015d1aaae1f4244e6b4be997767ea6940"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (14 corresponding lines): d2layouts/d2talalayout/internal/placement/optimization_guard.go:511-524 | d2layouts/d2talalayout/internal/placement/optimizer_spatial_index.go:69-88 \u2014 These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/optimization_guard.go"},"region":{"startLine":511}}}],"partialFingerprints":{"codehealthFindingId/v1":"eecc5103c072be461ac6bd0f4a15a0ca6bec6e1caac7c58806ecf0e95d691c28"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (15 corresponding lines): d2ast/d2ast.go:733-747 | d2ast/d2ast.go:749-763 \u2014 These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ast/d2ast.go"},"region":{"startLine":733}}}],"partialFingerprints":{"codehealthFindingId/v1":"a1cb72f18b3f091b63d4b190ac561d17bf3c41812d1c7426e53acd6de7e5e6ef"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (8 corresponding lines): d2layouts/d2talalayout/internal/placementcost/edge_length.go:109-116 | d2layouts/d2talalayout/internal/placementcost/edge_length.go:119-126 \u2014 These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placementcost/edge_length.go"},"region":{"startLine":109}}}],"partialFingerprints":{"codehealthFindingId/v1":"7d54c54373a97db22688ede6a51b7b165e766ff604c2c498a561900969e84305"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (19 corresponding lines): d2layouts/d2talalayout/internal/layoutgraph/node.go:2294-2322 | d2layouts/d2talalayout/internal/layoutgraph/node.go:2324-2342 \u2014 These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/node.go"},"region":{"startLine":2294}}}],"partialFingerprints":{"codehealthFindingId/v1":"1972814e39b9ad9609ab67976c45b917541f0a9ee8d34d84ce64d3e3f31a3c16"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copies of one member (3 members, 22\u002B corresponding lines): d2ir/d2ir.go:1459-1486 | d2ir/d2ir.go:1527-1554 | d2ir/d2ir.go:1570-1591 \u2014 These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ir/d2ir.go"},"region":{"startLine":1459}}}],"partialFingerprints":{"codehealthFindingId/v1":"5023e668464db1aa2e3e3ace0679e0c445f9f85cad887cb184c9373669527dda"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (13 corresponding lines): d2layouts/d2talalayout/internal/layoutgraph/node.go:2151-2169 | d2layouts/d2talalayout/internal/layoutgraph/node.go:2195-2207 \u2014 These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/node.go"},"region":{"startLine":2151}}}],"partialFingerprints":{"codehealthFindingId/v1":"a97e4074e7984a200f3715df645a7faafcef88907df7541247b2e7a36686396f"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (10 corresponding lines): d2renderers/d2raster/image.go:1263-1273 | d2renderers/d2raster/image.go:1275-1284 \u2014 These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/image.go"},"region":{"startLine":1263}}}],"partialFingerprints":{"codehealthFindingId/v1":"0811a621b88872386015dd9f6d749abf423c55ea6aa65eed9f5546f939828ff5"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copies of one member (3 members, 16\u002B corresponding lines): d2ir/import_cache.go:194-209 | d2ir/import_cache.go:225-240 | d2ir/import_cache.go:242-257 \u2014 These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ir/import_cache.go"},"region":{"startLine":194}}}],"partialFingerprints":{"codehealthFindingId/v1":"45facfd335d786bf8e6a1fa755c0d27b08c5385ae4ff529a130459f4ddb87384"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (5 corresponding lines): d2layouts/d2talalayout/internal/layoutgraph/node.go:1106-1110 | d2layouts/d2talalayout/internal/placementcost/geometry.go:106-110 \u2014 These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/node.go"},"region":{"startLine":1106}}}],"partialFingerprints":{"codehealthFindingId/v1":"506384b5ffd2896091ae3f7b6e66ec07eec3dc0041eeaf87c52a89ac0bf51259"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (17 corresponding lines): d2oracle/get.go:87-107 | d2oracle/get.go:109-125 \u2014 These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2oracle/get.go"},"region":{"startLine":87}}}],"partialFingerprints":{"codehealthFindingId/v1":"6fdf782ae86d1f358003a89edc64a4bd2d7fbc6ea8dc0cbea09deb72c8b1fae8"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (14 corresponding lines): lib/textmeasure/textmeasure.go:246-260 | lib/textmeasure/textmeasure.go:262-275 \u2014 These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/textmeasure/textmeasure.go"},"region":{"startLine":246}}}],"partialFingerprints":{"codehealthFindingId/v1":"0c69c9c71cb12cd6841cb8c7674bae0c17665a631f7f990232397554e578084d"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (14 corresponding lines): d2cli/isometric_paged.go:223-236 | d2renderers/d2isometric/d2isometricimg/gif.go:177-190 \u2014 These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2cli/isometric_paged.go"},"region":{"startLine":223}}}],"partialFingerprints":{"codehealthFindingId/v1":"b52cc7a1d0169c263dfb2a1d993ddcd4c60d8004e506ecb564199a7a59a83271"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (19 corresponding lines): d2layouts/d2talalayout/internal/layoutgraph/graph.go:532-550 | d2layouts/d2talalayout/internal/layoutgraph/graph.go:599-619 \u2014 These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/graph.go"},"region":{"startLine":532}}}],"partialFingerprints":{"codehealthFindingId/v1":"2f291ba7533bde8f40adcfa966913cba6b58c0d1a5a26162d128f48356ed4602"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copies of one member (3 members, 13\u002B corresponding lines): lib/shape/shape_package.go:54-66 | lib/shape/shape_parallelogram.go:35-50 | lib/shape/shape_step.go:36-50 \u2014 These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/shape/shape_package.go"},"region":{"startLine":54}}}],"partialFingerprints":{"codehealthFindingId/v1":"273fed1085532a804d9ce7f84616ce3666da947403fcfd40c7c960a890c3bb1e"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (12 corresponding lines): d2js/d2wasm/functions.go:599-612 | d2js/d2wasm/functions.go:614-625 \u2014 These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2js/d2wasm/functions.go"},"region":{"startLine":599}}}],"partialFingerprints":{"codehealthFindingId/v1":"a237b99f205d22e3c31da203fea894c9e2bbb9565083c8d7891b64418cbdcaed"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (19 corresponding lines): d2layouts/d2talalayout/internal/trees/preprocess_helpers.go:476-497 | d2layouts/d2talalayout/internal/trees/preprocess_helpers.go:558-576 \u2014 These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/trees/preprocess_helpers.go"},"region":{"startLine":476}}}],"partialFingerprints":{"codehealthFindingId/v1":"fb071a63025935bf626f26ae5727acc5beb52b547a8ea9cdc012b41c12df60ec"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (12 corresponding lines): d2renderers/d2scenebuild/sketch_shapes.go:32-45 | d2renderers/d2sketch/sketch.go:31-42 \u2014 These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/sketch_shapes.go"},"region":{"startLine":32}}}],"partialFingerprints":{"codehealthFindingId/v1":"c3c35f4418694959fe40a24c09c7a58003e04bd63df93c9759c42edc8b84ec91"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (14 corresponding lines): d2ir/d2ir.go:623-636 | d2ir/d2ir.go:795-811 \u2014 These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ir/d2ir.go"},"region":{"startLine":623}}}],"partialFingerprints":{"codehealthFindingId/v1":"2cac7131fa2c5677ab5fd5999d73f68c3584ae3977e366d0d7b992a076de323f"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (12 corresponding lines): d2renderers/d2scenebuild/build.go:1204-1215 | d2target/render_validation.go:350-361 \u2014 These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/build.go"},"region":{"startLine":1204}}}],"partialFingerprints":{"codehealthFindingId/v1":"b420fe85ffd2ee54c959a94eccac81ba353ad98a7bb399c79e7e4bd52c8848aa"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (12 corresponding lines): lib/imgbundler/imgbundler.go:100-115 | lib/imgbundler/imgbundler.go:132-143 \u2014 These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/imgbundler/imgbundler.go"},"region":{"startLine":100}}}],"partialFingerprints":{"codehealthFindingId/v1":"dabc99aeb51b67f807719bda3716230a28c48eebaf6902a3ab5d13e390e58c1d"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (14 corresponding lines): d2renderers/d2raster/effects.go:198-211 | d2renderers/d2raster/effects.go:484-500 \u2014 These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/effects.go"},"region":{"startLine":198}}}],"partialFingerprints":{"codehealthFindingId/v1":"bf44443cc50d7c13dc78f0dda18de2bce6d46c913cd0f210ca6934d8e46f2362"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (9 corresponding lines): lib/shape/shape_circle.go:25-33 | lib/shape/shape_oval.go:27-35 \u2014 These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/shape/shape_circle.go"},"region":{"startLine":25}}}],"partialFingerprints":{"codehealthFindingId/v1":"7ab0d78d31caf14cca284aa03ae31737f73e8a79d629733abcefcbf513105b88"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copies of one member (3 members, 15\u002B corresponding lines): d2layouts/d2talalayout/internal/layoutgraph/segment_crossing.go:38-52 | d2layouts/d2talalayout/internal/placementcost/edge_length.go:26-42 | d2layouts/d2talalayout/internal/placementcost/symmetry.go:68-87 \u2014 These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/segment_crossing.go"},"region":{"startLine":38}}}],"partialFingerprints":{"codehealthFindingId/v1":"560075ba412e5052be346b15984b5895d3de0555d774eb96b24e43869a37e511"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (19 corresponding lines): d2renderers/d2svgimport/image.go:563-581 | internal/rasterimage/firstframe.go:297-315 \u2014 These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svgimport/image.go"},"region":{"startLine":563}}}],"partialFingerprints":{"codehealthFindingId/v1":"884298091fd6f3a851d4caa7b4010848ff10991c86dcc11324b08fc9f517872f"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (17 corresponding lines): d2ir/d2ir.go:1014-1030 | d2ir/d2ir.go:1076-1092 \u2014 These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ir/d2ir.go"},"region":{"startLine":1014}}}],"partialFingerprints":{"codehealthFindingId/v1":"f764229cc47797696f9f2d2ee4cc5f67a916cb48bd848983bcc6e57a3b5830ca"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (14 corresponding lines): d2layouts/d2talalayout/internal/labeling/guard.go:235-251 | d2layouts/d2talalayout/internal/quality/labels.go:313-326 \u2014 These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/labeling/guard.go"},"region":{"startLine":235}}}],"partialFingerprints":{"codehealthFindingId/v1":"215f546bab830e3364926486c00919b4c630061969e291a75bf87588307e5ae3"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (15 corresponding lines): d2ir/compile.go:1219-1233 | d2ir/compile.go:1235-1252 \u2014 These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ir/compile.go"},"region":{"startLine":1219}}}],"partialFingerprints":{"codehealthFindingId/v1":"a141b2a4d3f87de15776e21e870cd0046a27c143300c196f720b90b951c90072"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copies of one member (3 members, 15\u002B corresponding lines): d2parser/parse.go:103-117 | d2parser/parse.go:119-133 | d2parser/parse.go:135-149 \u2014 These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2parser/parse.go"},"region":{"startLine":103}}}],"partialFingerprints":{"codehealthFindingId/v1":"9461b239f5bd4fb214f826dc2117c05f3b0d11a2ec7e045b1e8c14b0a9cd4053"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (11 corresponding lines): d2renderers/d2scenebuild/build.go:1256-1266 | d2target/render_validation.go:405-415 \u2014 These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/build.go"},"region":{"startLine":1256}}}],"partialFingerprints":{"codehealthFindingId/v1":"8813d7ec72f15a706bfe06891c8411d1035bfdb7e85a7cd5b9f5f793f6da1888"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (17 corresponding lines): d2graph/layout.go:374-394 | d2graph/layout.go:396-412 \u2014 These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2graph/layout.go"},"region":{"startLine":374}}}],"partialFingerprints":{"codehealthFindingId/v1":"56bcddf4c3bb74690129991529eefe42e5dcd3169d58c635a75f8552ed5ae0ac"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (14 corresponding lines): d2layouts/d2talalayout/internal/labeling/guard.go:450-464 | d2layouts/d2talalayout/internal/labeling/guard.go:466-479 \u2014 These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/labeling/guard.go"},"region":{"startLine":450}}}],"partialFingerprints":{"codehealthFindingId/v1":"47f750bdc54609e7e11098462b9da106704fa015108452cf6eee2fd096765fb9"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (14 corresponding lines): d2renderers/d2raster/session.go:296-309 | d2renderers/d2raster/session.go:419-434 \u2014 These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/session.go"},"region":{"startLine":296}}}],"partialFingerprints":{"codehealthFindingId/v1":"1e0b284581a8ccac88ecfed9529cd766d02b85178ce4bac0e92190cc56fab0a9"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (15 corresponding lines): d2layouts/d2talalayout/internal/layoutgraph/cluster.go:188-202 | d2layouts/d2talalayout/internal/layoutgraph/sequence.go:45-59 \u2014 These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/cluster.go"},"region":{"startLine":188}}}],"partialFingerprints":{"codehealthFindingId/v1":"a5a1e55a58234a96eacaa918b16d1dc0bd4bd0440cc2d20a3381b651f88e7e08"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (18 corresponding lines): d2layouts/d2talalayout/internal/routing/nudge_channels.go:173-191 | d2layouts/d2talalayout/internal/routing/shortcut_routes.go:34-51 \u2014 These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/nudge_channels.go"},"region":{"startLine":173}}}],"partialFingerprints":{"codehealthFindingId/v1":"c0157fac594e2499f3799abf40e2402240f00804cf70e8e51f829b3377a2bd86"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (21 corresponding lines): d2themes/d2themescatalog/earth_tones.go:5-25 | d2themes/d2themescatalog/vanilla_nitro_cola.go:5-25 \u2014 These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2themes/d2themescatalog/earth_tones.go"},"region":{"startLine":5}}}],"partialFingerprints":{"codehealthFindingId/v1":"e5f30b6da356cde19c66419a35e03cf51b8faccaad80f69512e776e1ad95eeb5"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copies of one member (3 members, 12\u002B corresponding lines): ci/release/releasetool/main.go:552-563 | d2cli/board_output_publish.go:324-335 | d2cli/board_output_publish.go:337-348 \u2014 These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"ci/release/releasetool/main.go"},"region":{"startLine":552}}}],"partialFingerprints":{"codehealthFindingId/v1":"5f3a0a2c176b3d260db8b8f06a7b7921321600b1eed5b44520a29373b003ffd0"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (13 corresponding lines): d2layouts/d2talalayout/internal/routing/ovg_resource.go:226-238 | d2layouts/d2talalayout/internal/routing/ovg_resource.go:240-253 \u2014 These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/ovg_resource.go"},"region":{"startLine":226}}}],"partialFingerprints":{"codehealthFindingId/v1":"7c322ab59538230774c38ee121a16714344013515c72a767a7e8a55df59a0e64"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (9 corresponding lines): d2renderers/d2fonts/bundled_fallback.go:285-293 | d2renderers/d2fonts/fallback.go:285-293 \u2014 These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2fonts/bundled_fallback.go"},"region":{"startLine":285}}}],"partialFingerprints":{"codehealthFindingId/v1":"917d26ecf515c51e108c16145ea249d7b9939a08c438090a74e5492412b0cd26"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (9 corresponding lines): d2renderers/d2scenebuild/connection.go:328-338 | d2renderers/d2svg/d2svg.go:885-893 \u2014 These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/connection.go"},"region":{"startLine":328}}}],"partialFingerprints":{"codehealthFindingId/v1":"0f0489169ed40822aea4827c6f7e3f4ea04118156c3441205043a585cd5b85aa"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (13 corresponding lines): d2renderers/d2svgimport/import.go:965-979 | lib/textmeasure/markdown_svg.go:366-378 \u2014 These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svgimport/import.go"},"region":{"startLine":965}}}],"partialFingerprints":{"codehealthFindingId/v1":"d5b764027231a95456ba024cdb3b9b2dc5c983ed1d567a92b2c9ea552d4609ac"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (19 corresponding lines): d2ir/d2ir.go:2221-2239 | d2ir/d2ir.go:2242-2260 \u2014 These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ir/d2ir.go"},"region":{"startLine":2221}}}],"partialFingerprints":{"codehealthFindingId/v1":"e8d7d476d5235737625f0dc2d7bbe98002ed0ca46c6737365f416853a6e7d5d7"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (15 corresponding lines): d2layouts/d2talalayout/internal/routing/nudge_channels.go:153-167 | d2layouts/d2talalayout/internal/routing/shortcut_routes.go:53-67 \u2014 These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/nudge_channels.go"},"region":{"startLine":153}}}],"partialFingerprints":{"codehealthFindingId/v1":"c127749dc655e1b51161be3c871e37239abd90acdd858c7778664dea2f0e0fad"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (3 corresponding lines): d2renderers/d2isometric/d2isometricimg/geometry.go:82-84 | d2renderers/d2isometric/d2isometricimg/raster.go:579-581 \u2014 These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/geometry.go"},"region":{"startLine":82}}}],"partialFingerprints":{"codehealthFindingId/v1":"1cbe5ccc3c1809e790b526e1cab55e8d9bf42fc02a58223063a7c607447ef9aa"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (14 corresponding lines): d2layouts/d2talalayout/internal/trees/preprocess_helpers.go:205-218 | d2layouts/d2talalayout/internal/trees/preprocess_helpers.go:461-474 \u2014 These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/trees/preprocess_helpers.go"},"region":{"startLine":205}}}],"partialFingerprints":{"codehealthFindingId/v1":"8a804aa30edcb12c5bcb1e82c7ced1fefdd8670dd4b5ba09381e023e974cf3f6"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (21 corresponding lines): d2themes/d2themescatalog/aubergine.go:5-25 | d2themes/d2themescatalog/grape_soda.go:5-25 \u2014 These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2themes/d2themescatalog/aubergine.go"},"region":{"startLine":5}}}],"partialFingerprints":{"codehealthFindingId/v1":"bf7d6558a4d4fb3877500a0a4db36ec0fbefe49f44dd6e0c623559ed93a0f657"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (21 corresponding lines): d2themes/d2themescatalog/cool_classics.go:5-25 | d2themes/d2themescatalog/mixed_berry_blue.go:5-25 \u2014 These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2themes/d2themescatalog/cool_classics.go"},"region":{"startLine":5}}}],"partialFingerprints":{"codehealthFindingId/v1":"98e4da6c5e1ee979cd90bbf56a6ac9cb30c2aa0ab825b80d8e4ddef104420b37"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (11 corresponding lines): d2layouts/d2talalayout/internal/hierarchy/placement.go:494-504 | d2layouts/d2talalayout/internal/hierarchy/placement.go:506-516 \u2014 These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/hierarchy/placement.go"},"region":{"startLine":494}}}],"partialFingerprints":{"codehealthFindingId/v1":"9711cc6162d42407bb69d49a7df83ad3968facef77744b8b58c3bd6861f27598"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (14 corresponding lines): d2oracle/get.go:204-217 | d2oracle/get.go:219-232 \u2014 These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2oracle/get.go"},"region":{"startLine":204}}}],"partialFingerprints":{"codehealthFindingId/v1":"d7bcdf6ef6d4c5b5ca07915e7a8af8c811959b597934de6b189d58b523d2cad9"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (9 corresponding lines): d2renderers/d2raster/raster.go:1632-1640 | d2renderers/d2scene/primitive.go:260-268 \u2014 These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/raster.go"},"region":{"startLine":1632}}}],"partialFingerprints":{"codehealthFindingId/v1":"d584f572dcdc88f3ade5ac46b8864f46134d79cb4657c01b03b53b195d0cfda4"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (11 corresponding lines): d2renderers/d2svgimport/path.go:425-435 | d2renderers/d2svgimport/transform.go:227-237 \u2014 These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svgimport/path.go"},"region":{"startLine":425}}}],"partialFingerprints":{"codehealthFindingId/v1":"159659193ebc7f505630aef74fa087ba0ed1ad51da9caeae431dac9dc4ebe50b"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (19 corresponding lines): d2layouts/d2elklayout/layout.go:211-229 | d2layouts/d2elklayout/layout.go:231-251 \u2014 These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2elklayout/layout.go"},"region":{"startLine":211}}}],"partialFingerprints":{"codehealthFindingId/v1":"51d51dc69ce46ec82b8b1239a8482097ce4981728797d58d84400f85abbf3ded"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (9 corresponding lines): lib/font/subsetFont.go:686-694 | lib/font/subsetFont.go:696-704 \u2014 These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/font/subsetFont.go"},"region":{"startLine":686}}}],"partialFingerprints":{"codehealthFindingId/v1":"34cb9bf9bed2105a4a48c58bd61ca0055f681ce5c799600b8ea4f699ac76eeb0"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (14 corresponding lines): d2layouts/d2talalayout/internal/grouping/join.go:125-138 | d2layouts/d2talalayout/internal/trees/layout.go:381-397 \u2014 These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/grouping/join.go"},"region":{"startLine":125}}}],"partialFingerprints":{"codehealthFindingId/v1":"e38c288bcffa77797be0d6de81b68879660ef6ce1122ae8e1b35ae286bd32e05"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (9 corresponding lines): d2layouts/d2talalayout/internal/layoutgraph/transaction_snapshot.go:25-33 | d2layouts/d2talalayout/internal/packing/combine.go:20-28 \u2014 These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/transaction_snapshot.go"},"region":{"startLine":25}}}],"partialFingerprints":{"codehealthFindingId/v1":"608f5d1ace9c24dd6e4d42a3a52553107f161732aa1b3723425c2f63526b3b37"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (12 corresponding lines): lib/imageasset/imageasset.go:422-439 | lib/netpolicy/netpolicy.go:114-125 \u2014 These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/imageasset/imageasset.go"},"region":{"startLine":422}}}],"partialFingerprints":{"codehealthFindingId/v1":"4db5765dd32eac470a30a922b46c6d65375bb4e4882e83c220a931c2fc22fd08"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (11 corresponding lines): d2cli/board_output.go:136-146 | d2cli/board_output.go:148-158 \u2014 These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2cli/board_output.go"},"region":{"startLine":136}}}],"partialFingerprints":{"codehealthFindingId/v1":"829183d741bf32402384ead7b2f80f2abe588b3388fda711117fd632e7d055b7"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (12 corresponding lines): d2ir/d2ir.go:866-879 | d2ir/d2ir.go:923-934 \u2014 These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ir/d2ir.go"},"region":{"startLine":866}}}],"partialFingerprints":{"codehealthFindingId/v1":"389097ed98885d2882ae88be257456beb3ac3663eff3f1c1448c2a6f260c9536"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (8 corresponding lines): d2renderers/d2fonts/bundled_fallback.go:295-302 | d2renderers/d2scenebuild/font_fallback.go:898-905 \u2014 These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2fonts/bundled_fallback.go"},"region":{"startLine":295}}}],"partialFingerprints":{"codehealthFindingId/v1":"6bc3e769a4d1bb0bcea384e0527de98129787fe44c08f8213ea037b6d97b290d"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (13 corresponding lines): d2layouts/d2sequence/sequence_diagram.go:50-62 | d2layouts/d2sequence/sequence_diagram.go:64-76 \u2014 These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2sequence/sequence_diagram.go"},"region":{"startLine":50}}}],"partialFingerprints":{"codehealthFindingId/v1":"f43e35025d62e643b1baa66b56c138c980755038d347245a73f3799877c38629"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (12 corresponding lines): d2renderers/d2raster/text.go:65-76 | d2renderers/d2raster/text.go:78-90 \u2014 These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/text.go"},"region":{"startLine":65}}}],"partialFingerprints":{"codehealthFindingId/v1":"38348e597a0e633bb172f258a63192343484c1a49099c5a1c511f057bc50262a"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (19 corresponding lines): d2ast/d2ast.go:225-244 | d2ast/d2ast.go:246-264 \u2014 These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ast/d2ast.go"},"region":{"startLine":225}}}],"partialFingerprints":{"codehealthFindingId/v1":"167d62908b72b7c7a23ac8666eca3eb7a916ede33e48a7550317c9f47bda794d"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (8 corresponding lines): lib/textmeasure/fontface.go:120-127 | lib/textmeasure/fontface.go:129-136 \u2014 These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/textmeasure/fontface.go"},"region":{"startLine":120}}}],"partialFingerprints":{"codehealthFindingId/v1":"15560dab618352da68e7bd1bc4a44d2e1f1fa8aa051b36d287569a1f83f44743"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copies of one member (3 members, 10\u002B corresponding lines): d2layouts/d2talalayout/internal/labeling/guard.go:34-50 | d2layouts/d2talalayout/internal/limits/work.go:68-85 | d2layouts/d2talalayout/internal/routing/route_stage_guard.go:46-55 \u2014 These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/labeling/guard.go"},"region":{"startLine":34}}}],"partialFingerprints":{"codehealthFindingId/v1":"a8a487fc46fcb40d56df081b3a1cdf1ddcac04bcb2ef37759fc134552f00dd25"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (14 corresponding lines): d2layouts/d2talalayout/internal/quality/score.go:30-43 | d2layouts/d2talalayout/result.go:29-42 \u2014 These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/quality/score.go"},"region":{"startLine":30}}}],"partialFingerprints":{"codehealthFindingId/v1":"c7b17564e8a7937e00f01929431128d78e837b3cc4d71f82c80fdeaa1b7cde21"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (10 corresponding lines): lib/shape/shape_diamond.go:26-35 | lib/shape/shape_hexagon.go:26-35 \u2014 These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/shape/shape_diamond.go"},"region":{"startLine":26}}}],"partialFingerprints":{"codehealthFindingId/v1":"0021ebb006e464237e780eec487ca61eb69788ebb6ffaa10ae54834575f0b58c"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (13 corresponding lines): d2ir/import_cache.go:211-223 | d2ir/import_cache.go:259-271 \u2014 These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ir/import_cache.go"},"region":{"startLine":211}}}],"partialFingerprints":{"codehealthFindingId/v1":"c7c5f63d6d7d6e2f42c6ca12dacfa082e85034e01bd5f13890c73f357867d8ff"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (14 corresponding lines): d2layouts/d2talalayout/internal/layoutgraph/sequence.go:134-147 | d2layouts/d2talalayout/internal/layoutgraph/cluster.go:205-218 \u2014 These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/sequence.go"},"region":{"startLine":134}}}],"partialFingerprints":{"codehealthFindingId/v1":"89e8ab99633689efff996823e4d5bbadf5484d9d33e695513e6f84f88d6d0150"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (10 corresponding lines): d2layouts/d2talalayout/internal/routing/swap_ports.go:19-31 | d2layouts/d2talalayout/internal/routing/trace.go:16-25 \u2014 These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/swap_ports.go"},"region":{"startLine":19}}}],"partialFingerprints":{"codehealthFindingId/v1":"3596b09aa37791832478066e7261e32fc4f9eca2c9ded8dc2852323f7bea4a36"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (5 corresponding lines): d2renderers/d2raster/raster.go:1467-1471 | d2renderers/d2raster/pattern.go:44-48 \u2014 These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/raster.go"},"region":{"startLine":1467}}}],"partialFingerprints":{"codehealthFindingId/v1":"d6fdf21902279aefd8abde0110c5e824cda7f670444aafaa8e417e123a8494a1"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (9 corresponding lines): d2renderers/d2raster/internal/scanline/rasterizer.go:836-844 | lib/xgif/encode.go:408-420 \u2014 These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/internal/scanline/rasterizer.go"},"region":{"startLine":836}}}],"partialFingerprints":{"codehealthFindingId/v1":"e98d5aa5fa3b8d23a1f68b57636b4f8ae87e9345f5c5e5422106a70d7b73a51a"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (9 corresponding lines): d2layouts/d2talalayout/internal/labeling/placement.go:1166-1176 | d2layouts/d2talalayout/internal/quality/labels.go:408-416 \u2014 These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/labeling/placement.go"},"region":{"startLine":1166}}}],"partialFingerprints":{"codehealthFindingId/v1":"af7294a3ee5d5a989ad597b715d1cddc7febeef182eb3cfd9f06f10fbf4f256c"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copies of one member (3 members, 7\u002B corresponding lines): lib/shape/shape_queue.go:36-43 | lib/shape/shape_step.go:28-34 | lib/shape/shape_stored_data.go:28-34 \u2014 These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/shape/shape_queue.go"},"region":{"startLine":36}}}],"partialFingerprints":{"codehealthFindingId/v1":"c3e81311d1967682240f77478788feaa287e67e372bd7103f8bcbec51716c916"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copies of one member (3 members, 7\u002B corresponding lines): d2layouts/d2talalayout/internal/layoutgraph/cluster.go:171-177 | d2layouts/d2talalayout/internal/layoutgraph/node.go:263-269 | d2layouts/d2talalayout/internal/layoutgraph/sequence.go:164-170 \u2014 These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/cluster.go"},"region":{"startLine":171}}}],"partialFingerprints":{"codehealthFindingId/v1":"e74364d3c8804c540067147ed60e4d91f7c7d1288d086281e597894b7ad57ff5"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (30 corresponding lines): d2layouts/d2talalayout/adapter.go:505-536 | d2layouts/d2talalayout/internal/graphjson/codec.go:939-968 \u2014 These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/adapter.go"},"region":{"startLine":505}}}],"partialFingerprints":{"codehealthFindingId/v1":"0510c6dd71b0ada2aeabbcfef5f04eecb73ffce09263d165ba5a84195d056910"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (10 corresponding lines): d2renderers/d2isometric/d2isometricimg/route_bridges.go:40-49 | d2renderers/d2isometric/d2isometricimg/route_lanes.go:42-51 \u2014 These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/route_bridges.go"},"region":{"startLine":40}}}],"partialFingerprints":{"codehealthFindingId/v1":"c7660e2b154d41af8bb23ba5f7d3fcda8fb9843a8d40d260451d692fedcd575f"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (12 corresponding lines): d2layouts/d2talalayout/internal/layoutgraph/topology_preflight.go:107-121 | d2layouts/d2talalayout/internal/proximity/nears.go:190-201 \u2014 These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/topology_preflight.go"},"region":{"startLine":107}}}],"partialFingerprints":{"codehealthFindingId/v1":"7065e81d79db1a224d51553478f6e563c9905e1c7ca65863dbc3847037f4e78e"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (3 corresponding lines): lib/shape/shape_circle.go:55-57 | lib/shape/shape_oval.go:72-74 \u2014 These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/shape/shape_circle.go"},"region":{"startLine":55}}}],"partialFingerprints":{"codehealthFindingId/v1":"6ec47ca751c1bf4049caf5fc71afac1c5d5b7722a8cdd9a3e5332116df29eabb"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (3 corresponding lines): d2layouts/d2talalayout/internal/hierarchy/eligibility.go:33-36 | d2layouts/d2talalayout/internal/placement/symmetry.go:120-122 \u2014 These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/hierarchy/eligibility.go"},"region":{"startLine":33}}}],"partialFingerprints":{"codehealthFindingId/v1":"122c8d50e0ef13882fa7f81812981d38770a56062539ac29f908d561aabe6226"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (32 corresponding lines): d2layouts/d2talalayout/internal/nodeshape/shape_parallelogram.go:51-84 | d2layouts/d2talalayout/internal/nodeshape/shape_step.go:52-83 \u2014 These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/nodeshape/shape_parallelogram.go"},"region":{"startLine":51}}}],"partialFingerprints":{"codehealthFindingId/v1":"d06db5fdad576b135bffa3aa12a7eb606b6dd6e525da9cfdf3105ec9065d5df9"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (1 corresponding lines): d2renderers/d2isometric/d2isometricimg/geometry.go:81-81 | d2renderers/d2isometric/d2isometricimg/raster.go:578-578 \u2014 These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/geometry.go"},"region":{"startLine":81}}}],"partialFingerprints":{"codehealthFindingId/v1":"0327abbc6086466c66f6913772c8bbd34340e9e86891aff46c408d3b140789e3"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (6 corresponding lines): d2renderers/d2svgimport/import.go:701-706 | lib/imageasset/probe.go:567-572 \u2014 These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svgimport/import.go"},"region":{"startLine":701}}}],"partialFingerprints":{"codehealthFindingId/v1":"a027823ee1c4d1ab3674ac0ef6cc9127b2eeb46985a1347bab163b0b41f8e2a1"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (3 corresponding lines): d2renderers/d2scenebuild/sketch_shapes.go:28-30 | d2renderers/d2sketch/sketch.go:27-29 \u2014 These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/sketch_shapes.go"},"region":{"startLine":28}}}],"partialFingerprints":{"codehealthFindingId/v1":"4909ee314a1ac025fa66b80a68623f7a530188206d8e74bee2ada4969bb4baa9"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (223 lines \u00D7 2): d2layouts/d2elklayout/layout.go:268-490 | d2layouts/d2elklayout/wasm.go:28-250 \u2014 before extracting anything, compare \u0060d2layouts/d2elklayout/layout.go\u0060 and \u0060d2layouts/d2elklayout/wasm.go\u0060 as WHOLE FILES: 91% of the shorter file\u0027s lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it \u2014 treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, \u0060d2layouts/d2elklayout/layout.go:265\u0060 calls \u0060CheckGraph\u0060 and \u0060d2layouts/d2elklayout/wasm.go:27\u0060 does not \u2014 after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2elklayout/layout.go"},"region":{"startLine":268}}}],"partialFingerprints":{"codehealthFindingId/v1":"935dd32e70738dcab85874b96fe65c43fab7323f061698c312786221b2cfc258"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (72\u201377 lines \u00D7 2): d2layouts/d2talalayout/internal/placementcost/edge_length.go:973-1049 | d2layouts/d2talalayout/internal/placementcost/edge_length.go:1050-1121 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, \u0060d2layouts/d2talalayout/internal/placementcost/edge_length.go:971\u0060 calls \u0060TurnCost\u0060 and \u0060d2layouts/d2talalayout/internal/placementcost/edge_length.go:1049\u0060 does not \u2014 after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placementcost/edge_length.go"},"region":{"startLine":973}}}],"partialFingerprints":{"codehealthFindingId/v1":"2ddfa77c7061fa436fd89dc046080329543655920092990cacd4961848bfa01e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (71 lines \u00D7 2): d2layouts/d2dagrelayout/layout.go:1523-1593 | d2layouts/d2dagrelayout/layout.go:1594-1664 \u2014 both copies are in the same file, so extract the block 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":1523}}}],"partialFingerprints":{"codehealthFindingId/v1":"a5d246c8d87a595b8fc7fb7094fa7c82c81ca1b18fc3829fbed409b1663594b7"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (62\u201370 lines \u00D7 2): d2layouts/d2talalayout/internal/layoutgraph/topology_preflight.go:441-502 | d2layouts/d2talalayout/internal/layoutgraph/topology_preflight.go:943-1012 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/layoutgraph/topology_preflight.go:441\u0060 it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows \u2014 the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members\u0027 bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run \u2014 a one-line delegation has no helper inside it to lift \u2014 so generate the run from the set it enumerates, or accept it and keep each member\u0027s own documentation with it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/topology_preflight.go"},"region":{"startLine":441}}}],"partialFingerprints":{"codehealthFindingId/v1":"6896fe5c69bc9842dc95abb145349c250955de35aecda37af6b584385edd595e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (65 lines \u00D7 2): d2layouts/d2talalayout/internal/layoutgraph/topology_preflight.go:383-447 | d2layouts/d2talalayout/internal/layoutgraph/topology_preflight.go:864-928 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/layoutgraph/topology_preflight.go"},"region":{"startLine":383}}}],"partialFingerprints":{"codehealthFindingId/v1":"764bf7c08129f7c56a4d94e25e9a6100b456741e76950085f227bafe933aefaf"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (54 lines \u00D7 2): d2layouts/d2talalayout/internal/layoutgraph/topology_preflight.go:245-298 | d2layouts/d2talalayout/internal/layoutgraph/topology_preflight.go:639-692 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/layoutgraph/topology_preflight.go:245\u0060 it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows \u2014 the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members\u0027 bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run \u2014 a one-line delegation has no helper inside it to lift \u2014 so generate the run from the set it enumerates, or accept it and keep each member\u0027s own documentation with it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/topology_preflight.go"},"region":{"startLine":245}}}],"partialFingerprints":{"codehealthFindingId/v1":"05eee1c33b4fc7098827b445a30b8ee2bd86240f6b516b50edf2094f1397dbfb"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (53 lines \u00D7 2): d2ast/d2ast.go:838-890 | d2ast/d2ast.go:930-982 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, \u0060d2ast/d2ast.go:984\u0060 calls \u0060Unbox\u0060 and \u0060d2ast/d2ast.go:892\u0060 does not \u2014 after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ast/d2ast.go"},"region":{"startLine":838}}}],"partialFingerprints":{"codehealthFindingId/v1":"df1ceb51fb67df2bb7d2d1638156391509a1fd47922eacc5332de83a5de20db8"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (51 lines \u00D7 2): d2layouts/d2talalayout/internal/layoutgraph/topology_preflight.go:330-380 | d2layouts/d2talalayout/internal/layoutgraph/topology_preflight.go:811-861 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/layoutgraph/topology_preflight.go:330\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/d2talalayout/internal/layoutgraph/topology_preflight.go"},"region":{"startLine":330}}}],"partialFingerprints":{"codehealthFindingId/v1":"3e655b916851e6c69c18c9034a4d932467d487bc5f2bf1287f9034a8c38766d6"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (45\u201346 lines \u00D7 2): d2layouts/d2talalayout/internal/routing/slingshot.go:797-841 | d2layouts/d2talalayout/internal/routing/slingshot.go:1112-1157 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/routing/slingshot.go:797\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":"d2layouts/d2talalayout/internal/routing/slingshot.go"},"region":{"startLine":797}}}],"partialFingerprints":{"codehealthFindingId/v1":"e79448d08c7b920fd6636176686b1534ca1d4fe195fd862822dd46c51ee4142e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (45 lines \u00D7 2): d2layouts/d2talalayout/internal/packing/combine_snapshot.go:52-96 | d2layouts/d2talalayout/internal/placement/types.go:74-118 \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/d2talalayout/internal/packing/combine_snapshot.go:52\u0060 it runs out through the closing brace of the declaration holding it \u2014 the window is that declaration\u0027s tail, not a fragment that begins part-way through something, so those exact 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":"d2layouts/d2talalayout/internal/packing/combine_snapshot.go"},"region":{"startLine":52}}}],"partialFingerprints":{"codehealthFindingId/v1":"fbd91d86416f823b955e064fb3d30cd3be717587c046b2d000e959eec192cc3b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (44 lines \u00D7 2): d2layouts/d2talalayout/internal/labeling/placement.go:379-422 | d2layouts/d2talalayout/internal/labeling/placement.go:611-654 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/labeling/placement.go"},"region":{"startLine":379}}}],"partialFingerprints":{"codehealthFindingId/v1":"cfda835a4aa5ae71ba6379fc6db20de623282b4bdf406c9bec804c9eee868443"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (44 lines \u00D7 2): d2parser/parse.go:530-573 | d2parser/parse.go:1666-1709 \u2014 both copies are in the same file, so extract the block 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":"d2parser/parse.go"},"region":{"startLine":530}}}],"partialFingerprints":{"codehealthFindingId/v1":"8540cd2bc444c7a9f67824aae272d782d75746cdae001c73f9f9490c30f27f8b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (35\u201342 lines \u00D7 2): d2layouts/d2talalayout/internal/labeling/placement.go:260-301 | d2layouts/d2talalayout/internal/labeling/placement.go:327-361 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/labeling/placement.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":"d2layouts/d2talalayout/internal/labeling/placement.go"},"region":{"startLine":260}}}],"partialFingerprints":{"codehealthFindingId/v1":"50ad368cd98038e4892206a9283d06d8afdbb4117bbab2d9c874e4f80407a28f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (38\u201339 lines \u00D7 2): d2renderers/d2svgimport/style.go:102-139 | d2renderers/d2svgimport/stylesheet.go:187-225 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2renderers/d2svgimport/style.go:102\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/d2svgimport/style.go"},"region":{"startLine":102}}}],"partialFingerprints":{"codehealthFindingId/v1":"298029b455e7dee31fc8d1316d7272514b07a5ab21e10e8c08f86971032818d2"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (37 lines \u00D7 2): d2compiler/compile.go:613-649 | d2ir/d2ir.go:201-237 \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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any \u0060return\u0060 inside it is the body\u0027s own exit and keeps its meaning in the moved unit."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2compiler/compile.go"},"region":{"startLine":613}}}],"partialFingerprints":{"codehealthFindingId/v1":"516447dcff545baca0a181c4c52f376f2ce1f9de82956428067c2a48cdad3ada"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (26\u201336 lines \u00D7 14): d2layouts/d2talalayout/internal/nodeshape/shape_callout.go:14-49 | d2layouts/d2talalayout/internal/nodeshape/shape_circle.go:12-47 | d2layouts/d2talalayout/internal/nodeshape/shape_cloud.go:14-49 | d2layouts/d2talalayout/internal/nodeshape/shape_cylinder.go:13-47 | d2layouts/d2talalayout/internal/nodeshape/shape_document.go:13-48 | d2layouts/d2talalayout/internal/nodeshape/shape_hexagon.go:13-48 | d2layouts/d2talalayout/internal/nodeshape/shape_image.go:12-37 | d2layouts/d2talalayout/internal/nodeshape/shape_oval.go:13-48 | d2layouts/d2talalayout/internal/nodeshape/shape_package.go:16-51 | d2layouts/d2talalayout/internal/nodeshape/shape_page.go:12-47 | d2layouts/d2talalayout/internal/nodeshape/shape_parallelogram.go:13-48 | d2layouts/d2talalayout/internal/nodeshape/shape_queue.go:13-48 | d2layouts/d2talalayout/internal/nodeshape/shape_square.go:14-48 | d2layouts/d2talalayout/internal/nodeshape/shape_stored_data.go:13-48 \u2014 before extracting anything, compare \u0060d2layouts/d2talalayout/internal/nodeshape/shape_callout.go\u0060 and \u0060d2layouts/d2talalayout/internal/nodeshape/shape_cloud.go\u0060 as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 87 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place. 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":"d2layouts/d2talalayout/internal/nodeshape/shape_callout.go"},"region":{"startLine":14}}}],"partialFingerprints":{"codehealthFindingId/v1":"fc1976a7dbb2ca65324fe0ad2f4be3edf40ffda24fa6f902ca3dd0a7f7821455"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (26\u201336 lines \u00D7 2): d2layouts/d2talalayout/internal/labeling/placement.go:1125-1160 | d2layouts/d2talalayout/internal/quality/labels.go:485-510 \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/d2talalayout/internal/labeling/placement.go:1125\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":"d2layouts/d2talalayout/internal/labeling/placement.go"},"region":{"startLine":1125}}}],"partialFingerprints":{"codehealthFindingId/v1":"6c1801d8bbdb10e89fae3a54a348a8cfc529023e46bf3c955ce8e26bdf99252a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (35 lines \u00D7 3): d2layouts/d2talalayout/internal/nodeshape/shape_c4person.go:14-48 | d2layouts/d2talalayout/internal/nodeshape/shape_diamond.go:14-48 | d2layouts/d2talalayout/internal/nodeshape/shape_step.go:14-48 \u2014 before extracting anything, compare \u0060d2layouts/d2talalayout/internal/nodeshape/shape_c4person.go\u0060 and \u0060d2layouts/d2talalayout/internal/nodeshape/shape_diamond.go\u0060 as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 117 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place. 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":"d2layouts/d2talalayout/internal/nodeshape/shape_c4person.go"},"region":{"startLine":14}}}],"partialFingerprints":{"codehealthFindingId/v1":"b037f0e46f5bda8834fd0eb563eb51d25e5d4cb1f98612faca56e1b8081e6102"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (31\u201335 lines \u00D7 3): d2renderers/d2svg/d2svg.go:192-222 | d2renderers/d2svg/d2svg.go:281-315 | d2renderers/d2svg/d2svg.go:3043-3073 \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. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, \u0060d2renderers/d2svg/d2svg.go:190\u0060 calls \u0060NewRuler\u0060 and \u0060d2renderers/d2svg/d2svg.go:279\u0060 does not \u2014 after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svg/d2svg.go"},"region":{"startLine":192}}}],"partialFingerprints":{"codehealthFindingId/v1":"de84a06f481cc669da83a3cb29c65a99404f62447181a456e44846ffaec48b4c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (35 lines \u00D7 2): d2compiler/compile.go:454-488 | d2compiler/compile.go:1248-1282 \u2014 both copies are in the same file, so extract the block 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:454\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":"d2compiler/compile.go"},"region":{"startLine":454}}}],"partialFingerprints":{"codehealthFindingId/v1":"ab01a1e901ecf162a80c3d7b5da9125b00048accf3b685139bef49618b0a6a43"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (28\u201335 lines \u00D7 2): d2layouts/d2talalayout/internal/layoutgraph/node.go:1433-1467 | d2layouts/d2talalayout/internal/routing/geometry.go:19-46 \u2014 before extracting anything, compare \u0060d2layouts/d2talalayout/internal/layoutgraph/node.go\u0060 and \u0060d2layouts/d2talalayout/internal/routing/geometry.go\u0060 as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 59 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2layouts/d2talalayout/internal/layoutgraph/node.go:1433\u0060 it runs out through the closing brace of the declaration holding it \u2014 the window is that declaration\u0027s tail, not a fragment that begins part-way through something, so those exact 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/d2talalayout/internal/layoutgraph/node.go"},"region":{"startLine":1433}}}],"partialFingerprints":{"codehealthFindingId/v1":"18efce9daef58a143b7a03c10ef4e3e0d9ee1542dc3ad9c12eaad38350b04955"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (31\u201334 lines \u00D7 2): d2renderers/d2svg/d2svg.go:1520-1550 | d2renderers/d2svg/d2svg.go:1653-1686 \u2014 both copies are in the same file, so extract the block 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:1520\u0060 it runs out through the closing brace of the declaration holding it \u2014 the window is that declaration\u0027s tail, not a fragment that begins part-way through something, so those exact 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 \u0060return\u0060 at the foot of the matched lines is the enclosing body\u0027s own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that \u0060return\u0060 occupied \u2014 no decision has to be handed back and re-acted on."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svg/d2svg.go"},"region":{"startLine":1520}}}],"partialFingerprints":{"codehealthFindingId/v1":"7f03ecb490bac55c23e93f6393744113b06ebce0ff8dfdd7c00a6da8561fa368"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (29\u201332 lines \u00D7 2): d2renderers/d2raster/gradient.go:478-509 | d2renderers/d2raster/gradient.go:529-557 \u2014 both copies are in the same file, so extract the block 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/d2raster/gradient.go"},"region":{"startLine":478}}}],"partialFingerprints":{"codehealthFindingId/v1":"f70972e8f7e924247cd17eb1c231ade8bc7d3687c09fc645df07314e7b329a4d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (32 lines \u00D7 2): d2renderers/d2svg/d2svg.go:1250-1281 | d2renderers/d2svg/d2svg.go:2129-2160 \u2014 both copies are in the same file, so extract the block 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:1250\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/d2svg/d2svg.go"},"region":{"startLine":1250}}}],"partialFingerprints":{"codehealthFindingId/v1":"a0e25bbf443548eaf5a504beb53c313282d17d3faa916286bedb18ce89301ba9"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (31 lines \u00D7 4): d2layouts/d2talalayout/internal/nodeshape/shape_c4person.go:19-49 | d2layouts/d2talalayout/internal/nodeshape/shape_diamond.go:19-49 | d2layouts/d2talalayout/internal/nodeshape/shape_person.go:19-49 | d2layouts/d2talalayout/internal/nodeshape/shape_step.go:19-49 \u2014 before extracting anything, compare \u0060d2layouts/d2talalayout/internal/nodeshape/shape_c4person.go\u0060 and \u0060d2layouts/d2talalayout/internal/nodeshape/shape_diamond.go\u0060 as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 117 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2layouts/d2talalayout/internal/nodeshape/shape_c4person.go:19\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":"d2layouts/d2talalayout/internal/nodeshape/shape_c4person.go"},"region":{"startLine":19}}}],"partialFingerprints":{"codehealthFindingId/v1":"9a407b73cb4cb290f24c4981f1b3b0cafd2ab3d27b288b113b57435ad209f236"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (31 lines \u00D7 2): d2layouts/d2talalayout/internal/layoutgraph/topology_preflight.go:220-250 | d2layouts/d2talalayout/internal/layoutgraph/topology_preflight.go:598-628 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/layoutgraph/topology_preflight.go:220\u0060 it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows \u2014 the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members\u0027 bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run \u2014 a one-line delegation has no helper inside it to lift \u2014 so generate the run from the set it enumerates, or accept it and keep each member\u0027s own documentation with it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/topology_preflight.go"},"region":{"startLine":220}}}],"partialFingerprints":{"codehealthFindingId/v1":"7ac4fb9d664d841b8e75f6ca6f364bb0f1c339eebfe27ecaf50977ec60faeae4"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (30 lines \u00D7 2): d2layouts/d2talalayout/internal/labeling/placement.go:53-82 | d2layouts/d2talalayout/internal/labeling/placement.go:495-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/d2talalayout/internal/labeling/placement.go:53\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/d2talalayout/internal/labeling/placement.go"},"region":{"startLine":53}}}],"partialFingerprints":{"codehealthFindingId/v1":"4f14b735ee826a837b871ab207a19f351d3c5bf3e04bac396c22815f1c6cf502"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (28\u201330 lines \u00D7 2): d2layouts/d2talalayout/internal/routing/balance_route_guard.go:102-129 | lib/geo/segment.go:90-119 \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/d2talalayout/internal/routing/balance_route_guard.go:102\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. Check import visibility before settling on that home: \u0060d2layouts/d2talalayout/internal/routing/balance_route_guard.go\u0060 sits under a restricted \u0060internal\u0060 directory, which only code inside its own subtree is permitted to import from \u2014 so it is reachable from some of these sites and not from others, and being able to see the copies is not the same as being allowed to share them. The home has to be somewhere every one of these sites is permitted to import from; if there is no such place, that restriction may be exactly why the copies are separate. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, \u0060d2layouts/d2talalayout/internal/routing/balance_route_guard.go:99\u0060 calls \u0060step\u0060 and \u0060lib/geo/segment.go:89\u0060 does not \u2014 after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/balance_route_guard.go"},"region":{"startLine":102}}}],"partialFingerprints":{"codehealthFindingId/v1":"a67f17aaaa4fa151ee87cdd2cf0574238fe7b9a7180e2eb0767635da6fc058de"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (25\u201330 lines \u00D7 2): d2layouts/d2talalayout/internal/routing/coordinator.go:976-1005 | d2layouts/d2talalayout/internal/routing/coordinator.go:1030-1054 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/routing/coordinator.go:976\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. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, \u0060d2layouts/d2talalayout/internal/routing/coordinator.go:972\u0060 calls \u0060Inf\u0060 and \u0060d2layouts/d2talalayout/internal/routing/coordinator.go:1028\u0060 does not \u2014 after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/coordinator.go"},"region":{"startLine":976}}}],"partialFingerprints":{"codehealthFindingId/v1":"d3117e94eda38cff89f28d9646071bfa5363af582ecfff9ca1f3bd08bb7b7289"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (30 lines \u00D7 2): d2oracle/edit.go:2371-2400 | d2oracle/edit.go:2416-2445 \u2014 both copies are in the same file, so extract the block 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:2371\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":2371}}}],"partialFingerprints":{"codehealthFindingId/v1":"b3e12d0982629df577df43dd5bb2ff18de1032fc55dc593de07f88a56a00ad88"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (28\u201330 lines \u00D7 2): d2oracle/edit.go:2940-2967 | d2oracle/edit.go:3128-3157 \u2014 both copies are in the same file, so extract the block 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":2940}}}],"partialFingerprints":{"codehealthFindingId/v1":"0d7af490c039febe340c61ab93e6c36294b043e615c22cbf32bb3fe3d35aebcd"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (40\u201341 lines \u00D7 2): lib/xgif/xgif.go:755-794 | lib/xgif/xgif.go:819-859 \u2014 both copies are in the same file, so extract the block 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/xgif/xgif.go:755\u0060 it runs out through the closing brace of the declaration holding it \u2014 the window is that declaration\u0027s tail, not a fragment that begins part-way through something, so those exact 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/xgif/xgif.go"},"region":{"startLine":755}}}],"partialFingerprints":{"codehealthFindingId/v1":"2206788e564a0de0cf63c1db02d14d7c817837305243a014f3bf3fb1bf2ccbf9"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (28\u201329 lines \u00D7 2): d2layouts/d2talalayout/internal/labeling/placement.go:426-454 | d2layouts/d2talalayout/internal/labeling/placement.go:658-685 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2layouts/d2talalayout/internal/labeling/placement.go:426\u0060 it runs out through the closing brace of the declaration holding it \u2014 the window is that declaration\u0027s tail, not a fragment that begins part-way through something, so those exact 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":"d2layouts/d2talalayout/internal/labeling/placement.go"},"region":{"startLine":426}}}],"partialFingerprints":{"codehealthFindingId/v1":"36dba451b81f88b828acfe1f39f9351a6be4f4dac1e31b25984e03968b7e95fe"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (28\u201329 lines \u00D7 2): d2layouts/d2talalayout/internal/packing/binpack.go:424-451 | d2layouts/d2talalayout/internal/packing/binpack.go:833-861 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/packing/binpack.go:424\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/d2talalayout/internal/packing/binpack.go"},"region":{"startLine":424}}}],"partialFingerprints":{"codehealthFindingId/v1":"0f7ddfbee528184c453ecbf255df9aa6bf0793e1b7ba0608f98c5571a7637071"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (16\u201329 lines \u00D7 2): d2layouts/d2talalayout/internal/placementcost/edge_length.go:629-657 | d2layouts/d2talalayout/internal/placementcost/edge_length.go:704-719 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/placementcost/edge_length.go:629\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/d2talalayout/internal/placementcost/edge_length.go"},"region":{"startLine":629}}}],"partialFingerprints":{"codehealthFindingId/v1":"0750b4e7df6a557c5bc91de750867da24a28f7aa7ad062c9add59d8c09a7adec"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (21\u201328 lines \u00D7 2): d2parser/parse.go:483-510 | d2parser/parse.go:1634-1654 \u2014 both copies are in the same file, so extract the block 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:483\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":483}}}],"partialFingerprints":{"codehealthFindingId/v1":"969edf6cac38be12851c8fb20697a256ec3704674557492892d7639c328de3d3"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (24\u201327 lines \u00D7 2): d2layouts/d2grid/layout.go:384-410 | d2layouts/d2grid/layout.go:477-500 \u2014 both copies are in the same file, so extract the block 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:384\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":384}}}],"partialFingerprints":{"codehealthFindingId/v1":"de80316b2122d68e9003ffeef3c96ce068b60e5509aedfe487d5b466658a740e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (26\u201327 lines \u00D7 2): d2oracle/edit.go:156-182 | d2oracle/edit.go:2537-2562 \u2014 both copies are in the same file, so extract the block 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:156\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":156}}}],"partialFingerprints":{"codehealthFindingId/v1":"022b7c352ca540275e9d67c10027df0375a094685c87279de61db55774cfa0eb"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (26 lines \u00D7 2): d2layouts/d2talalayout/internal/routing/coordinator.go:493-518 | d2layouts/d2talalayout/internal/routing/coordinator.go:634-659 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/routing/coordinator.go:493\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/d2talalayout/internal/routing/coordinator.go"},"region":{"startLine":493}}}],"partialFingerprints":{"codehealthFindingId/v1":"88bf4fef2aeaefb10ca88eb0a8d34b998e7d9d921f0ab2ff1c51b9770d642e2d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (26 lines \u00D7 2): d2renderers/d2sketch/sketch.go:80-105 | d2renderers/d2sketch/sketch.go:147-172 \u2014 both copies are in the same file, so extract the block 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:80\u0060 it runs out through the closing brace of the declaration holding it \u2014 the window is that declaration\u0027s tail, not a fragment that begins part-way through something, so those exact 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":80}}}],"partialFingerprints":{"codehealthFindingId/v1":"fb49ae1d40ad789e29e8a99409821110e865826d20ac5341d8fd7937e6996c39"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (25\u201326 lines \u00D7 2): d2renderers/d2svg/d2svg.go:230-254 | d2renderers/d2svg/d2svg.go:3077-3102 \u2014 both copies are in the same file, so extract the block 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:230\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":230}}}],"partialFingerprints":{"codehealthFindingId/v1":"f01da91e929ffdbd4bdab3331bd76f20633f3df257ca5fe98e1a39d2a2925e6a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (24\u201325 lines \u00D7 2): d2layouts/d2talalayout/internal/packing/binpack.go:344-368 | d2layouts/d2talalayout/internal/packing/binpack.go:788-811 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/packing/binpack.go"},"region":{"startLine":344}}}],"partialFingerprints":{"codehealthFindingId/v1":"e778a375259d56b96face923bbcb31be89ad08fd1b7982feccd36355a2a51489"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (23\u201325 lines \u00D7 2): lib/textmeasure/textmeasure.go:284-308 | lib/textmeasure/textmeasure.go:467-489 \u2014 both copies are in the same file, so extract the block 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":"lib/textmeasure/textmeasure.go"},"region":{"startLine":284}}}],"partialFingerprints":{"codehealthFindingId/v1":"eb1c34d2e5822219cd18e9489a085c099786ed310e880f4e66bf50fba6f3f5d0"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (24 lines \u00D7 2): d2ir/compile.go:1768-1791 | d2ir/compile.go:1842-1865 \u2014 both copies are in the same file, so extract the block 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:1768\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":1768}}}],"partialFingerprints":{"codehealthFindingId/v1":"48588292a3d5f50dfa67bd7323d8193fca30246271c50c3543ee364c02494f6b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12\u201324 lines \u00D7 2): d2layouts/d2talalayout/internal/placementcost/edge_length.go:671-694 | d2layouts/d2talalayout/internal/placementcost/edge_length.go:721-732 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/placementcost/edge_length.go:671\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/d2talalayout/internal/placementcost/edge_length.go"},"region":{"startLine":671}}}],"partialFingerprints":{"codehealthFindingId/v1":"246e30018790369259aed0f4d7d9e83ec3e91aec8335b01703b89b0e65370e7f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (16\u201325 lines \u00D7 2): d2layouts/d2talalayout/internal/placementcost/edge_length.go:751-775 | d2layouts/d2talalayout/internal/placementcost/edge_length.go:817-832 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/placementcost/edge_length.go:751\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/d2talalayout/internal/placementcost/edge_length.go"},"region":{"startLine":751}}}],"partialFingerprints":{"codehealthFindingId/v1":"94e1f7a2613e21f53e2a5d0e740653816b209d0ad191ec71717a519d64fa8ba1"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (24 lines \u00D7 2): d2renderers/d2svg/d2svg.go:1940-1963 | d2renderers/d2svg/d2svg.go:1972-1995 \u2014 both copies are in the same file, so extract the block 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:1940\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. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, \u0060d2renderers/d2svg/d2svg.go:1997\u0060 calls \u0060FromString\u0060, \u0060IsBorder\u0060, \u0060SetMaskID\u0060 and \u0060d2renderers/d2svg/d2svg.go:1964\u0060 does not \u2014 after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svg/d2svg.go"},"region":{"startLine":1940}}}],"partialFingerprints":{"codehealthFindingId/v1":"7a6f5154f7a6ff71cf4e5ad35815ab7af47361057c622f383295c3fec1afe46b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (20\u201323 lines \u00D7 2): d2ir/merge.go:35-54 | d2ir/merge.go:83-105 \u2014 both copies are in the same file, so extract the block 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:35\u0060 it runs out through the closing brace of the declaration holding it \u2014 the window is that declaration\u0027s tail, not a fragment that begins part-way through something, so those exact 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":35}}}],"partialFingerprints":{"codehealthFindingId/v1":"10e50efd61a71290cfaa8a9b2daea9519c91d5917a209c9a19bddde40bbeb3e9"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (23 lines \u00D7 2): d2layouts/d2talalayout/internal/quality/crossings.go:51-73 | d2layouts/d2talalayout/internal/routing/cost.go:42-64 \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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any \u0060return\u0060 inside it is the body\u0027s own exit and keeps its meaning in the moved unit."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/quality/crossings.go"},"region":{"startLine":51}}}],"partialFingerprints":{"codehealthFindingId/v1":"892ba3bb5514551f085c6b688f96c89158985f8f2beb3e9e1d30bd90a92de9ef"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (26 lines \u00D7 2): d2renderers/d2raster/gradient.go:955-980 | d2renderers/d2raster/gradient.go:1290-1315 \u2014 both copies are in the same file, so extract the block 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":"d2renderers/d2raster/gradient.go"},"region":{"startLine":955}}}],"partialFingerprints":{"codehealthFindingId/v1":"448b60be114eddbbc668ac5e85b440bc378bff400407e6ecaba07a85abe4185c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (22 lines \u00D7 2): d2graph/layout.go:434-455 | d2graph/layout.go:465-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:434\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":434}}}],"partialFingerprints":{"codehealthFindingId/v1":"488909a54839605925aef9e0650ba7703179ff67f01b4b83091b1e56c8285d87"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (22 lines \u00D7 2): d2graph/layout.go:516-537 | d2graph/layout.go:548-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:516\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":516}}}],"partialFingerprints":{"codehealthFindingId/v1":"da520726d86927317820863f6d40fc35be6827bdd5304f7df097d4bfa019cbcd"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (21\u201322 lines \u00D7 2): d2ir/compile.go:1530-1550 | d2ir/compile.go:1566-1587 \u2014 both copies are in the same file, so extract the block 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:1530\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 \u0060return\u0060 at the foot of the matched lines is the enclosing body\u0027s own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that \u0060return\u0060 occupied \u2014 no decision has to be handed back and re-acted on."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ir/compile.go"},"region":{"startLine":1530}}}],"partialFingerprints":{"codehealthFindingId/v1":"38371e27f9981492322b77da603096729d0eff9b9c3cebd97947b464fa5e772f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (22 lines \u00D7 2): d2layouts/d2talalayout/internal/graphjson/codec.go:107-128 | d2layouts/d2talalayout/internal/graphjson/codec.go:130-151 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/graphjson/codec.go:107\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/graphjson/codec.go"},"region":{"startLine":107}}}],"partialFingerprints":{"codehealthFindingId/v1":"3ed9bb8cb959ab4c4201ab9e6748a7bf4c906e45f53dc5b5cdef18b9b189baaf"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (22 lines \u00D7 2): d2layouts/d2talalayout/result_validate.go:311-332 | d2layouts/d2talalayout/result_validate.go:333-354 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/result_validate.go"},"region":{"startLine":311}}}],"partialFingerprints":{"codehealthFindingId/v1":"f2b6b3d3e3393ba27092975a23dc8971f90789c8f81146211084595d5201606a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (22 lines \u00D7 2): d2renderers/d2sketch/sketch.go:438-459 | d2renderers/d2sketch/sketch.go:571-592 \u2014 both copies are in the same file, so extract the block 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":438}}}],"partialFingerprints":{"codehealthFindingId/v1":"2173aca4dce5563fa974a6094c952c339f646f33a2283563988be936b6d18d5f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (21 lines \u00D7 18): d2layouts/d2talalayout/internal/nodeshape/shape_c4person.go:19-50 | d2layouts/d2talalayout/internal/nodeshape/shape_callout.go:27-50 | d2layouts/d2talalayout/internal/nodeshape/shape_circle.go:19-48 | d2layouts/d2talalayout/internal/nodeshape/shape_cloud.go:22-50 | d2layouts/d2talalayout/internal/nodeshape/shape_cylinder.go:20-48 | d2layouts/d2talalayout/internal/nodeshape/shape_diamond.go:19-50 | d2layouts/d2talalayout/internal/nodeshape/shape_document.go:21-49 | d2layouts/d2talalayout/internal/nodeshape/shape_hexagon.go:20-49 | d2layouts/d2talalayout/internal/nodeshape/shape_image.go:18-38 | d2layouts/d2talalayout/internal/nodeshape/shape_oval.go:20-49 | d2layouts/d2talalayout/internal/nodeshape/shape_package.go:29-52 | d2layouts/d2talalayout/internal/nodeshape/shape_page.go:19-48 | d2layouts/d2talalayout/internal/nodeshape/shape_parallelogram.go:22-49 | d2layouts/d2talalayout/internal/nodeshape/shape_person.go:19-50 | d2layouts/d2talalayout/internal/nodeshape/shape_queue.go:22-49 | d2layouts/d2talalayout/internal/nodeshape/shape_square.go:27-49 | d2layouts/d2talalayout/internal/nodeshape/shape_step.go:19-50 | d2layouts/d2talalayout/internal/nodeshape/shape_stored_data.go:22-49 \u2014 before extracting anything, compare \u0060d2layouts/d2talalayout/internal/nodeshape/shape_c4person.go\u0060 and \u0060d2layouts/d2talalayout/internal/nodeshape/shape_diamond.go\u0060 as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 117 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2layouts/d2talalayout/internal/nodeshape/shape_c4person.go:19\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":"d2layouts/d2talalayout/internal/nodeshape/shape_c4person.go"},"region":{"startLine":19}}}],"partialFingerprints":{"codehealthFindingId/v1":"4a4b8a912000527adac4f55ef8a0d8d10ae4997b287b74f54a85c001c822c98e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (21 lines \u00D7 3): d2layouts/d2talalayout/internal/routing/ovg_resource.go:462-482 | d2layouts/d2talalayout/internal/routing/route_search_guard.go:267-287 | d2layouts/d2talalayout/internal/routing/tunnel.go:71-91 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2layouts/d2talalayout/internal/routing/ovg_resource.go:462\u0060 it runs out through the closing brace of the declaration holding it \u2014 the window is that declaration\u0027s tail, not a fragment that begins part-way through something, so those exact 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/d2talalayout/internal/routing/ovg_resource.go"},"region":{"startLine":462}}}],"partialFingerprints":{"codehealthFindingId/v1":"2d6d3c01741c928e2aa9c772bdf5ca571579b38c46e606d24e05e1f6d0e1ca51"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (21 lines \u00D7 2): d2layouts/d2talalayout/internal/hierarchy/discovery.go:120-140 | d2layouts/d2talalayout/internal/hierarchy/placement.go:143-163 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2layouts/d2talalayout/internal/hierarchy/discovery.go:120\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a \u0060defer\u0060-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead \u2014 before the caller uses what it releases \u2014 so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/hierarchy/discovery.go"},"region":{"startLine":120}}}],"partialFingerprints":{"codehealthFindingId/v1":"ca1b831fcfc7ea2f31048cc9a3194e644a30ded55be4e999ef30614e00a676c8"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (21 lines \u00D7 2): d2layouts/d2talalayout/internal/layoutgraph/node.go:864-884 | d2layouts/d2talalayout/internal/layoutgraph/node.go:886-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 \u0060d2layouts/d2talalayout/internal/layoutgraph/node.go:864\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/d2talalayout/internal/layoutgraph/node.go"},"region":{"startLine":864}}}],"partialFingerprints":{"codehealthFindingId/v1":"17c7662cfb4385d26ce73469d39266c53d75233cb539714f64659e42f398b95e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (21 lines \u00D7 2): d2layouts/d2talalayout/internal/nodeshape/shape_cloud.go:80-100 | d2layouts/d2talalayout/internal/nodeshape/shape_person.go:80-100 \u2014 before extracting anything, compare \u0060d2layouts/d2talalayout/internal/nodeshape/shape_cloud.go\u0060 and \u0060d2layouts/d2talalayout/internal/nodeshape/shape_person.go\u0060 as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 72 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any \u0060return\u0060 inside it is the body\u0027s own exit and keeps its meaning in the moved unit."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/nodeshape/shape_cloud.go"},"region":{"startLine":80}}}],"partialFingerprints":{"codehealthFindingId/v1":"8ba712116a78a0d85f3bbbf91673708be10c9d8aed538723ad292a3e7eb0ef92"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (21 lines \u00D7 2): d2layouts/d2talalayout/internal/packing/binpack.go:305-325 | d2layouts/d2talalayout/internal/packing/binpack.go:742-762 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/packing/binpack.go:305\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/d2talalayout/internal/packing/binpack.go"},"region":{"startLine":305}}}],"partialFingerprints":{"codehealthFindingId/v1":"fcebf48f69d4168d2f40d479ea5f2551f9227f632bf41d4431c6751074d8d900"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12\u201321 lines \u00D7 2): d2layouts/d2talalayout/internal/placementcost/edge_length.go:786-806 | d2layouts/d2talalayout/internal/placementcost/edge_length.go:834-845 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/placementcost/edge_length.go:786\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/d2talalayout/internal/placementcost/edge_length.go"},"region":{"startLine":786}}}],"partialFingerprints":{"codehealthFindingId/v1":"a8870aae2026cf75aeecb08fc3e5114e176be6aad7c45ffccc4606c51ec95c16"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (20 lines \u00D7 3): d2renderers/d2raster/gradient.go:808-827 | d2renderers/d2raster/gradient.go:852-871 | d2renderers/d2raster/gradient.go:936-955 \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/d2raster/gradient.go:808\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/d2raster/gradient.go"},"region":{"startLine":808}}}],"partialFingerprints":{"codehealthFindingId/v1":"285bf2ff329788ef7574d1a5f56b7ac7cfb357f831c28857f228489a280adb62"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (20 lines \u00D7 3): d2renderers/d2raster/gradient.go:1143-1162 | d2renderers/d2raster/gradient.go:1187-1206 | d2renderers/d2raster/gradient.go:1271-1290 \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/d2raster/gradient.go:1143\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/d2raster/gradient.go"},"region":{"startLine":1143}}}],"partialFingerprints":{"codehealthFindingId/v1":"fde59411bf358a0f132093b3972af41503e13477cc6396cfb979937b742a0e2a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (20 lines \u00D7 2): d2layouts/d2talalayout/internal/grouping/lifecycle.go:130-149 | d2layouts/d2talalayout/internal/grouping/lifecycle.go:165-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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/grouping/lifecycle.go"},"region":{"startLine":130}}}],"partialFingerprints":{"codehealthFindingId/v1":"7493db2a1d90e2eeabcc73beea163a7400a86a3945d9a170de5c2cfb072e5b72"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (18\u201320 lines \u00D7 2): d2layouts/d2talalayout/internal/hierarchy/discovery.go:656-675 | d2layouts/d2talalayout/internal/hierarchy/discovery.go:680-697 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/hierarchy/discovery.go"},"region":{"startLine":656}}}],"partialFingerprints":{"codehealthFindingId/v1":"c6aeb87df5f8ee67d84a4a96d44451be6612d2a1928318f610b44f13aa51b8c9"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (20 lines \u00D7 2): d2layouts/d2talalayout/internal/packing/binpack.go:370-389 | d2layouts/d2talalayout/internal/packing/binpack.go:812-831 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/packing/binpack.go"},"region":{"startLine":370}}}],"partialFingerprints":{"codehealthFindingId/v1":"d0895bedcc325fffb8d3d80c1e32f6f13074981af3bed89c9f6c35ced2a5a276"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (19\u201320 lines \u00D7 2): d2oracle/edit.go:2834-2853 | d2oracle/edit.go:3041-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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2oracle/edit.go"},"region":{"startLine":2834}}}],"partialFingerprints":{"codehealthFindingId/v1":"b79a5b09df2259dd419788e0aaaa61a5ed79c36086e111e48bedfc552afdc1a1"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (31 lines \u00D7 2): d2renderers/d2fonts/bundled_fallback.go:98-128 | d2renderers/d2fonts/fallback.go:125-155 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. 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":"d2renderers/d2fonts/bundled_fallback.go"},"region":{"startLine":98}}}],"partialFingerprints":{"codehealthFindingId/v1":"143ba00b8cf92cabce2179a02e77fc64b36a766a8a398f249fd0a8dfec3cc447"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (20 lines \u00D7 2): d2renderers/d2fonts/bundled_fallback.go:262-281 | d2renderers/d2fonts/fallback.go:630-649 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2renderers/d2fonts/bundled_fallback.go:262\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/d2fonts/bundled_fallback.go"},"region":{"startLine":262}}}],"partialFingerprints":{"codehealthFindingId/v1":"e4b8b3745b7beed761ed18f395cde9e9bf59d18625f95b527ac43b228a7e2814"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (20 lines \u00D7 2): d2renderers/d2svg/d2svg.go:372-391 | d2renderers/d2svg/d2svg.go:419-438 \u2014 both copies are in the same file, so extract the block 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":372}}}],"partialFingerprints":{"codehealthFindingId/v1":"e919778ee6c3c0f1d82d1caa3b037c05a0775ef662e958289ef28e7506c03474"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (19 lines \u00D7 2): d2graph/layout.go:186-204 | d2graph/layout.go:240-258 \u2014 both copies are in the same file, so extract the block 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":"32dbff43dd972436d04aff9d94e45809ebeae4fa591ea71687e35b283cd814ab"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (19 lines \u00D7 2): d2layouts/d2talalayout/internal/placement/equidistance.go:338-356 | d2layouts/d2talalayout/internal/placement/equidistance.go:367-385 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/placement/equidistance.go:338\u0060 it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows \u2014 the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members\u0027 bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run \u2014 a one-line delegation has no helper inside it to lift \u2014 so generate the run from the set it enumerates, or accept it and keep each member\u0027s own documentation with it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/equidistance.go"},"region":{"startLine":338}}}],"partialFingerprints":{"codehealthFindingId/v1":"4e6afd9f0258b708d56816d06fd1f4fdd9537bfabe4cf2dd29cd3843857c3ffb"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (19 lines \u00D7 2): d2layouts/d2talalayout/internal/placement/swap.go:145-163 | d2layouts/d2talalayout/internal/placement/swap.go:176-194 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, \u0060d2layouts/d2talalayout/internal/placement/swap.go:144\u0060 calls \u0060Commit\u0060 and \u0060d2layouts/d2talalayout/internal/placement/swap.go:175\u0060 does not \u2014 after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/swap.go"},"region":{"startLine":145}}}],"partialFingerprints":{"codehealthFindingId/v1":"46116a00efec027f2248843412719b265d45b5b7a23720bfed1ce713badafca8"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (19 lines \u00D7 2): d2layouts/d2talalayout/internal/routing/coordinator.go:474-492 | d2layouts/d2talalayout/internal/routing/coordinator.go:614-632 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/routing/coordinator.go:474\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 \u0060return\u0060 at the foot of the matched lines is the enclosing body\u0027s own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that \u0060return\u0060 occupied \u2014 no decision has to be handed back and re-acted on."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/coordinator.go"},"region":{"startLine":474}}}],"partialFingerprints":{"codehealthFindingId/v1":"47c549c27fa6315ba7860210cdde03c0ae1d65cc26afa74d3dbe133a7cb75b5d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (19 lines \u00D7 2): d2oracle/edit.go:2879-2897 | d2oracle/edit.go:3197-3215 \u2014 both copies are in the same file, so extract the block 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:2879\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":2879}}}],"partialFingerprints":{"codehealthFindingId/v1":"b803df3b82fee670e85d58d7935e662701dcfea124466a323928312690eb7244"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (18\u201319 lines \u00D7 2): d2renderers/d2raster/effects.go:1399-1417 | d2renderers/d2raster/effects.go:1520-1537 \u2014 both copies are in the same file, so extract the block 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/d2raster/effects.go:1399\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/d2raster/effects.go"},"region":{"startLine":1399}}}],"partialFingerprints":{"codehealthFindingId/v1":"ac870e669bc77099c5200301a3a307b8ff226dbfbe1484d59e9e7520afcb7397"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (21 lines \u00D7 2): d2renderers/d2raster/effects.go:1494-1514 | d2renderers/d2raster/effects.go:1606-1626 \u2014 both copies are in the same file, so extract the block 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/d2raster/effects.go:1494\u0060 it runs out through the closing brace of the declaration holding it \u2014 the window is that declaration\u0027s tail, not a fragment that begins part-way through something, so those exact 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 \u0060return\u0060 at the foot of the matched lines is the enclosing body\u0027s own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that \u0060return\u0060 occupied \u2014 no decision has to be handed back and re-acted on."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/effects.go"},"region":{"startLine":1494}}}],"partialFingerprints":{"codehealthFindingId/v1":"1837ffdbf3c065e7edf932501d0320c64f05ed2037f74ab64736ec0d134a7f50"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (19 lines \u00D7 2): d2renderers/d2scenebuild/labels.go:136-154 | d2renderers/d2scenebuild/markdown.go:79-97 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/labels.go"},"region":{"startLine":136}}}],"partialFingerprints":{"codehealthFindingId/v1":"bc9f7008238fd6868dff3fdd381c38f06f8e4d1f82e7643b5deb3201d8fd95ca"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15\u201318 lines \u00D7 3): d2renderers/d2svg/d2svg.go:1522-1537 | d2renderers/d2svg/d2svg.go:1604-1618 | d2renderers/d2svg/d2svg.go:1655-1672 \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":"d2renderers/d2svg/d2svg.go"},"region":{"startLine":1522}}}],"partialFingerprints":{"codehealthFindingId/v1":"b8c2e6ff8a8fa25aba4528590456949a8a2f00ac95ba05bb2edd56c44d1053e0"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (18 lines \u00D7 2): d2ast/d2ast.go:814-831 | d2ast/d2ast.go:896-913 \u2014 both copies are in the same file, so extract the block 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":814}}}],"partialFingerprints":{"codehealthFindingId/v1":"f612df3616684a3b0747976217e2dbf97e516c63595a5755679ae4c3eb0d15c0"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (18 lines \u00D7 2): d2js/d2wasm/functions.go:291-308 | d2js/d2wasm/functions.go:427-444 \u2014 both copies are in the same file, so extract the block 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":"d2js/d2wasm/functions.go"},"region":{"startLine":291}}}],"partialFingerprints":{"codehealthFindingId/v1":"5281bc4f7cc82c445fe8cd7bd867405cf800658f567b3e471638a32e0532e314"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (18 lines \u00D7 2): d2layouts/d2talalayout/internal/hierarchy/discovery.go:418-435 | d2layouts/d2talalayout/internal/hierarchy/discovery.go:437-454 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/hierarchy/discovery.go"},"region":{"startLine":418}}}],"partialFingerprints":{"codehealthFindingId/v1":"093e001294de5baa235db05cb742e27b1901398cbaec90f24d14e3a4d0e2ab29"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (18 lines \u00D7 2): d2layouts/d2talalayout/internal/layoutgraph/topology_preflight.go:180-197 | d2layouts/d2talalayout/internal/layoutgraph/topology_preflight.go:558-575 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2layouts/d2talalayout/internal/layoutgraph/topology_preflight.go:180\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/d2talalayout/internal/layoutgraph/topology_preflight.go"},"region":{"startLine":180}}}],"partialFingerprints":{"codehealthFindingId/v1":"38d104b2c5ac851c0be5445d0c89af29995e4b4e043b71c294cd0a8f584617c5"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (18 lines \u00D7 2): d2layouts/d2talalayout/internal/layoutgraph/topology_preflight.go:200-217 | d2layouts/d2talalayout/internal/layoutgraph/topology_preflight.go:578-595 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/layoutgraph/topology_preflight.go:200\u0060 it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows \u2014 the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members\u0027 bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run \u2014 a one-line delegation has no helper inside it to lift \u2014 so generate the run from the set it enumerates, or accept it and keep each member\u0027s own documentation with it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/topology_preflight.go"},"region":{"startLine":200}}}],"partialFingerprints":{"codehealthFindingId/v1":"f03861d303a212e1909c437289754969c9c957655b88273197093c8e3fa97a45"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (18 lines \u00D7 2): d2layouts/d2talalayout/internal/placement/transpose.go:154-171 | d2layouts/d2talalayout/internal/placement/transpose.go:173-190 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/placement/transpose.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. 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/d2talalayout/internal/placement/transpose.go"},"region":{"startLine":154}}}],"partialFingerprints":{"codehealthFindingId/v1":"ce77bc5c2fc14bd9b2dc9d11c75b6d817214960759c94da4961e45ce267239fe"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (17\u201318 lines \u00D7 2): d2layouts/d2talalayout/internal/routing/swap_ports.go:593-610 | d2layouts/d2talalayout/internal/routing/swap_ports.go:613-629 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/swap_ports.go"},"region":{"startLine":593}}}],"partialFingerprints":{"codehealthFindingId/v1":"8d9a58581a12018515859e6eccedeeba8a0c364bb8dcaddd926035fd51271273"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (18 lines \u00D7 2): d2renderers/d2raster/gradient.go:831-848 | d2renderers/d2raster/gradient.go:875-892 \u2014 both copies are in the same file, so extract the block 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/d2raster/gradient.go:831\u0060 it runs out through the closing brace of the declaration holding it \u2014 the window is that declaration\u0027s tail, not a fragment that begins part-way through something, so those exact 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/d2raster/gradient.go"},"region":{"startLine":831}}}],"partialFingerprints":{"codehealthFindingId/v1":"21f2a98e15413d2694116ac95783377f1843fdc5aa1cba7c2ff13cb46a24c964"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (20 lines \u00D7 2): d2renderers/d2sketch/sketch.go:199-218 | d2renderers/d2sketch/sketch.go:271-290 \u2014 both copies are in the same file, so extract the block 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:199\u0060 it runs out through the closing brace of the declaration holding it \u2014 the window is that declaration\u0027s tail, not a fragment that begins part-way through something, so those exact 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":199}}}],"partialFingerprints":{"codehealthFindingId/v1":"055d7273357af4069455e64611a1664aea19793d960b20d51059f0e9baaa277d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (18 lines \u00D7 2): d2renderers/d2sketch/sketch.go:848-865 | d2renderers/d2sketch/sketch.go:881-898 \u2014 both copies are in the same file, so extract the block 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:848\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":848}}}],"partialFingerprints":{"codehealthFindingId/v1":"3870633984ac0d2bfcdc1340abe4198ff6a3d04c73e55058446ee01ce40acabe"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (17 lines \u00D7 2): d2compiler/compile.go:1439-1455 | d2compiler/compile.go:1480-1496 \u2014 both copies are in the same file, so extract the block 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:1439\u0060 it runs out through the closing brace of the declaration holding it \u2014 the window is that declaration\u0027s tail, not a fragment that begins part-way through something, so those exact 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":1439}}}],"partialFingerprints":{"codehealthFindingId/v1":"41cbabbd322f3bf1b7c345e3119a5f2358ec0e853acc2e1b252197bac8a4feaf"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (17 lines \u00D7 2): d2layouts/d2talalayout/internal/grouping/sequences.go:240-256 | d2layouts/d2talalayout/internal/grouping/sequences.go:258-274 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/grouping/sequences.go:240\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/d2talalayout/internal/grouping/sequences.go"},"region":{"startLine":240}}}],"partialFingerprints":{"codehealthFindingId/v1":"e571903df67f13bb339ea3ec8a4b94d4da987511ce624fdf86340c48759fd288"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (17 lines \u00D7 2): d2layouts/d2talalayout/internal/labeling/placement.go:34-50 | d2layouts/d2talalayout/internal/labeling/placement.go:468-484 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. The matched lines also register a scope-exit action (a \u0060defer\u0060-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead \u2014 before the caller uses what it releases \u2014 so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/labeling/placement.go"},"region":{"startLine":34}}}],"partialFingerprints":{"codehealthFindingId/v1":"a3ad9732a91c27f4848660b433b3e8552981df293f8d5e0b91c35450d8658dca"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (17 lines \u00D7 2): d2layouts/d2talalayout/internal/labeling/placement.go:89-105 | d2layouts/d2talalayout/internal/labeling/placement.go:555-571 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/labeling/placement.go:89\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/d2talalayout/internal/labeling/placement.go"},"region":{"startLine":89}}}],"partialFingerprints":{"codehealthFindingId/v1":"3c0214a6b52a1a430b496671b400ccb051c250e02aa66a46b48c44039651405c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (17 lines \u00D7 2): d2layouts/d2talalayout/internal/nodeshape/shape_package.go:115-131 | d2layouts/d2talalayout/internal/nodeshape/shape_square.go:82-98 \u2014 before extracting anything, compare \u0060d2layouts/d2talalayout/internal/nodeshape/shape_package.go\u0060 and \u0060d2layouts/d2talalayout/internal/nodeshape/shape_square.go\u0060 as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 134 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2layouts/d2talalayout/internal/nodeshape/shape_package.go:115\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. 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":"d2layouts/d2talalayout/internal/nodeshape/shape_package.go"},"region":{"startLine":115}}}],"partialFingerprints":{"codehealthFindingId/v1":"f9776487ebb1915227ad3198112889e9f085b3213134e3d27f15545f6f350477"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (16\u201317 lines \u00D7 2): d2layouts/d2talalayout/internal/packing/combine.go:73-88 | d2layouts/d2talalayout/internal/routing/snapshot.go:58-74 \u2014 before extracting anything, compare \u0060d2layouts/d2talalayout/internal/packing/combine.go\u0060 and \u0060d2layouts/d2talalayout/internal/routing/snapshot.go\u0060 as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2layouts/d2talalayout/internal/packing/combine.go:73\u0060 it runs out through the closing brace of the declaration holding it \u2014 the window is that declaration\u0027s tail, not a fragment that begins part-way through something, so those exact 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/d2talalayout/internal/packing/combine.go"},"region":{"startLine":73}}}],"partialFingerprints":{"codehealthFindingId/v1":"cd76bb5c7fb85f2d88fabf9d6055b02e7fa78b54b2f0693feeba19afe742f378"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (17 lines \u00D7 2): d2layouts/d2talalayout/internal/routing/ovg_edge_router.go:1017-1033 | d2layouts/d2talalayout/internal/routing/ovg_edge_router.go:1066-1082 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/routing/ovg_edge_router.go:1017\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. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, \u0060d2layouts/d2talalayout/internal/routing/ovg_edge_router.go:1084\u0060 calls \u0060isPortOf\u0060 and \u0060d2layouts/d2talalayout/internal/routing/ovg_edge_router.go:1036\u0060 does not \u2014 after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/ovg_edge_router.go"},"region":{"startLine":1017}}}],"partialFingerprints":{"codehealthFindingId/v1":"77ffc928f459ac3a75c600c9bd738ab427439579749e214fd487fcd43fe50448"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (17 lines \u00D7 2): d2layouts/d2talalayout/internal/routing/slingshot.go:110-126 | d2layouts/d2talalayout/internal/routing/slingshot.go:158-174 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/routing/slingshot.go:110\u0060 it runs out through the closing brace of the declaration holding it \u2014 the window is that declaration\u0027s tail, not a fragment that begins part-way through something, so those exact 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":"d2layouts/d2talalayout/internal/routing/slingshot.go"},"region":{"startLine":110}}}],"partialFingerprints":{"codehealthFindingId/v1":"a5c6026fc2850472f19eb024a38e881c1c68c743109588590ed30358b9d9fb64"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14\u201317 lines \u00D7 2): d2layouts/d2talalayout/result_validate.go:103-119 | d2layouts/d2talalayout/result_validate.go:265-278 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/result_validate.go:103\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":"d2layouts/d2talalayout/result_validate.go"},"region":{"startLine":103}}}],"partialFingerprints":{"codehealthFindingId/v1":"cfb3725acaf1051732dc72988680c9fa999f1a822176ea2343e61783aa24ebca"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (17 lines \u00D7 2): d2renderers/d2isometric/d2isometricimg/svg_order.go:234-250 | d2renderers/d2isometric/d2isometricimg/svg_visibility_tree.go:67-83 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2renderers/d2isometric/d2isometricimg/svg_order.go:234\u0060 it runs out through the closing brace of the declaration holding it \u2014 the window is that declaration\u0027s tail, not a fragment that begins part-way through something, so those exact 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/d2isometric/d2isometricimg/svg_order.go"},"region":{"startLine":234}}}],"partialFingerprints":{"codehealthFindingId/v1":"7fd303cf1092b1eecdf5fcadf168f59cf46fec69b0c3d2d0ecd76342b9b027c0"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (17 lines \u00D7 2): d2renderers/d2raster/gradient.go:1166-1182 | d2renderers/d2raster/gradient.go:1210-1226 \u2014 both copies are in the same file, so extract the block 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/d2raster/gradient.go:1166\u0060 it runs out through the closing brace of the declaration holding it \u2014 the window is that declaration\u0027s tail, not a fragment that begins part-way through something, so those exact 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/d2raster/gradient.go"},"region":{"startLine":1166}}}],"partialFingerprints":{"codehealthFindingId/v1":"08d1fafdebe58cba464ca0904ae192ba29b643ddab008e7980e02aa2950ce2ca"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (17 lines \u00D7 2): d2renderers/d2raster/image.go:628-644 | d2renderers/d2raster/image.go:907-923 \u2014 both copies are in the same file, so extract the block 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/d2raster/image.go:628\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/d2raster/image.go"},"region":{"startLine":628}}}],"partialFingerprints":{"codehealthFindingId/v1":"6f4afce3653047034bb9cc9f35b28d826628b9a8340f6c2a0f5e8eb6568dd5f4"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (17 lines \u00D7 2): d2renderers/d2raster/raster.go:1034-1050 | d2renderers/d2raster/vector_validation.go:260-276 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2renderers/d2raster/raster.go:1034\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/d2raster/raster.go"},"region":{"startLine":1034}}}],"partialFingerprints":{"codehealthFindingId/v1":"01d2e2f3c7f994503183134543062cce3b69ef293f181e7a4739ae3cd407468f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (16 lines \u00D7 4): d2layouts/d2talalayout/internal/proximity/nears.go:206-221 | d2layouts/d2talalayout/internal/routing/ovg_resource.go:463-478 | d2layouts/d2talalayout/internal/routing/route_search_guard.go:268-283 | d2layouts/d2talalayout/internal/routing/tunnel.go:72-87 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 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 4 times. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2layouts/d2talalayout/internal/proximity/nears.go:206\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/d2talalayout/internal/proximity/nears.go"},"region":{"startLine":206}}}],"partialFingerprints":{"codehealthFindingId/v1":"855e8007ef7ffd73e9a9e6891ee7402cb411adefafb88ff1b08dfd49a54ee3d6"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (16 lines \u00D7 3): d2layouts/d2talalayout/internal/labeling/placement.go:89-104 | d2layouts/d2talalayout/internal/labeling/placement.go:533-548 | d2layouts/d2talalayout/internal/labeling/placement.go:555-570 \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 \u0060d2layouts/d2talalayout/internal/labeling/placement.go:89\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/d2talalayout/internal/labeling/placement.go"},"region":{"startLine":89}}}],"partialFingerprints":{"codehealthFindingId/v1":"989cef5f387a5369d0e1b9941a4eeb80e78ff014833fb0844fa14fba6381620b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (16 lines \u00D7 2): d2ast/d2ast.go:1331-1346 | d2ast/d2ast.go:1435-1450 \u2014 both copies are in the same file, so extract the block 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":"e15a5276f9629e8d6213f78cb0b04655de7a5f20a0a49de92d0340bdf4139a4c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (16 lines \u00D7 2): d2format/format.go:106-121 | d2format/format.go:184-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:106\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":106}}}],"partialFingerprints":{"codehealthFindingId/v1":"a2d6c0b940ffa3a820628d6002b8c1cfbd21ece3dfd057937be4e0ad6204e753"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (16 lines \u00D7 2): d2ir/compile.go:2123-2138 | d2ir/compile.go:2143-2158 \u2014 both copies are in the same file, so extract the block 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":"d2ir/compile.go"},"region":{"startLine":2123}}}],"partialFingerprints":{"codehealthFindingId/v1":"c5f96031a48c3bbf51a54f4239fac342a8b0e4a84898e1826ed46865185cf2ab"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (16 lines \u00D7 2): d2layouts/d2talalayout/internal/graphjson/codec.go:386-401 | d2layouts/d2talalayout/internal/graphjson/codec.go:436-451 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/graphjson/codec.go:386\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/d2talalayout/internal/graphjson/codec.go"},"region":{"startLine":386}}}],"partialFingerprints":{"codehealthFindingId/v1":"6fecaac70d05471e91da2ebc14d7461e40494c7d44c2a93284d7a00092883b36"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (16 lines \u00D7 2): d2layouts/d2talalayout/internal/grouping/lifecycle.go:52-67 | d2layouts/d2talalayout/internal/grouping/lifecycle.go:82-97 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/grouping/lifecycle.go"},"region":{"startLine":52}}}],"partialFingerprints":{"codehealthFindingId/v1":"66cd0bc622a0b9f79b29ad7ddbc1f5e4ff8937979b30245d591798707d702ba5"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (16 lines \u00D7 2): d2layouts/d2talalayout/internal/hierarchy/discovery.go:615-630 | d2layouts/d2talalayout/internal/hierarchy/discovery.go:631-646 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/hierarchy/discovery.go"},"region":{"startLine":615}}}],"partialFingerprints":{"codehealthFindingId/v1":"c9013bb22a25059324c49fd5ddd3886886447d9a10cbaa99d85b2fef916de3d6"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (16 lines \u00D7 2): d2layouts/d2talalayout/internal/labeling/guard.go:605-620 | d2layouts/d2talalayout/internal/quality/labels.go:554-569 \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/d2talalayout/internal/labeling/guard.go:605\u0060 it runs out through the closing brace of the declaration holding it \u2014 the window is that declaration\u0027s tail, not a fragment that begins part-way through something, so those exact 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":"d2layouts/d2talalayout/internal/labeling/guard.go"},"region":{"startLine":605}}}],"partialFingerprints":{"codehealthFindingId/v1":"8a03fd86d6685568c7e3525dd9187d70bfbfbcd1c90b8a42ba39b11e7452dea4"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (25\u201326 lines \u00D7 2): d2layouts/d2talalayout/internal/labeling/placement.go:1057-1082 | d2layouts/d2talalayout/internal/quality/labels.go:439-463 \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/d2talalayout/internal/labeling/placement.go:1057\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/d2talalayout/internal/labeling/placement.go"},"region":{"startLine":1057}}}],"partialFingerprints":{"codehealthFindingId/v1":"59b090a226397ec5504cf40276fe09a82f1b13c5d21f2abef9597cc5da4c2775"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (16 lines \u00D7 2): d2layouts/d2talalayout/internal/packing/binpack.go:1150-1165 | d2layouts/d2talalayout/internal/packing/binpack.go:1168-1183 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/packing/binpack.go"},"region":{"startLine":1150}}}],"partialFingerprints":{"codehealthFindingId/v1":"89eb538fa9e07c545157cf582a3d89df6c93922ebb643c9cd98f91eda867de75"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (16 lines \u00D7 2): d2layouts/d2talalayout/internal/placement/sized_optimizer.go:311-326 | d2layouts/d2talalayout/internal/placement/sizeless_optimizer.go:602-617 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2layouts/d2talalayout/internal/placement/sized_optimizer.go:311\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/d2talalayout/internal/placement/sized_optimizer.go"},"region":{"startLine":311}}}],"partialFingerprints":{"codehealthFindingId/v1":"90e094c347b76299f74304d1977fa8a0a3ac8d8a7a37ef201f02fbff338a69e0"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (17 lines \u00D7 2): d2layouts/d2talalayout/internal/placement/sized_optimizer.go:1031-1047 | d2layouts/d2talalayout/internal/placement/sized_optimizer.go:1090-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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/sized_optimizer.go"},"region":{"startLine":1031}}}],"partialFingerprints":{"codehealthFindingId/v1":"da6962d281f1bd1c18ba55d391e764f905431f82b54c0f6ad42a9375276ba361"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (17 lines \u00D7 2): d2layouts/d2talalayout/internal/placement/sized_optimizer.go:1128-1144 | d2layouts/d2talalayout/internal/placement/sized_optimizer.go:1148-1164 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/placement/sized_optimizer.go"},"region":{"startLine":1128}}}],"partialFingerprints":{"codehealthFindingId/v1":"65576397d7d4ede3d8d4df08a16581c9b8f8ec741dcd5921bbae80f77b11d289"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (16 lines \u00D7 2): d2layouts/d2talalayout/internal/routing/ovg.go:889-904 | d2layouts/d2talalayout/internal/routing/ovg.go:1459-1474 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/routing/ovg.go:889\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/d2talalayout/internal/routing/ovg.go"},"region":{"startLine":889}}}],"partialFingerprints":{"codehealthFindingId/v1":"bca042387dbfbceca306214f6b3da107e8bc39f2a73e71fdc8950439dfd68f44"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (16 lines \u00D7 2): d2layouts/d2talalayout/internal/routing/slingshot.go:677-692 | d2layouts/d2talalayout/internal/routing/slingshot.go:901-916 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, \u0060d2layouts/d2talalayout/internal/routing/slingshot.go:918\u0060 calls \u0060Nodes\u0060 and \u0060d2layouts/d2talalayout/internal/routing/slingshot.go:694\u0060 does not \u2014 after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/slingshot.go"},"region":{"startLine":677}}}],"partialFingerprints":{"codehealthFindingId/v1":"ba77985e5463f0c2bb41bbf36ac73e0df3f46a879507cbfa5b42f6a838d26f2b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (16 lines \u00D7 2): d2oracle/edit.go:125-140 | d2oracle/edit.go:2512-2527 \u2014 both copies are in the same file, so extract the block 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":125}}}],"partialFingerprints":{"codehealthFindingId/v1":"5b088e5bd6c08009684a6f1ce2724b38b79746861651bfe16439d572cbe7426d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (16 lines \u00D7 2): d2oracle/edit.go:2857-2872 | d2oracle/edit.go:3063-3078 \u2014 both copies are in the same file, so extract the block 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:2857\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":2857}}}],"partialFingerprints":{"codehealthFindingId/v1":"6909c8c154a93cb26daaa92dabec1ef0accb06c270ddf0e2f2e996db285b4e11"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15\u201316 lines \u00D7 2): d2renderers/d2ascii/asciiroute/labels.go:137-151 | d2renderers/d2ascii/asciiroute/labels.go:169-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:137\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. 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":137}}}],"partialFingerprints":{"codehealthFindingId/v1":"2c7d013d7d1c15b4ba37493dcd6cfed2d7b18a67017bd4eaebf05417b589107b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13\u201316 lines \u00D7 2): d2renderers/d2isometric/d2isometricimg/solid_contacts.go:160-172 | d2renderers/d2isometric/d2isometricimg/solid_contacts.go:226-241 \u2014 both copies are in the same file, so extract the block 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/d2isometric/d2isometricimg/solid_contacts.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/d2isometric/d2isometricimg/solid_contacts.go"},"region":{"startLine":160}}}],"partialFingerprints":{"codehealthFindingId/v1":"f335fdb2dc4c78e16c8fa3077fb729fd7c83ff21835af85d1c188dcf285c3f84"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (16 lines \u00D7 2): d2renderers/d2raster/effects.go:1733-1748 | d2renderers/d2raster/effects.go:1872-1887 \u2014 both copies are in the same file, so extract the block 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/d2raster/effects.go:1733\u0060 it runs out through the closing brace of the declaration holding it \u2014 the window is that declaration\u0027s tail, not a fragment that begins part-way through something, so those exact 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 \u0060return\u0060 at the foot of the matched lines is the enclosing body\u0027s own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that \u0060return\u0060 occupied \u2014 no decision has to be handed back and re-acted on."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/effects.go"},"region":{"startLine":1733}}}],"partialFingerprints":{"codehealthFindingId/v1":"d8779724f123612779bd5c91d26c2c9ad57fd0060b9a567620f80c1fc3c27e2f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (16 lines \u00D7 2): d2renderers/d2svgimport/geometry.go:58-73 | d2renderers/d2svgimport/image.go:36-51 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: \u0060d2renderers/d2svgimport/image.go:36\u0060 is reached only past guards at line 29 (testing \u0060element.attrs\u0060) and line 32 (testing \u0060element.attrs\u0060) that each leave the function early, and \u0060d2renderers/d2svgimport/geometry.go:58\u0060 reads \u0060element.attrs\u0060 with no such check. What separates these copies is not which lines they run but which PRECONDITION they enforce, so one of them is operating on state the other one refuses. Decide which is intended BEFORE unifying them \u2014 extract the shared part and whichever copy is missing the check keeps running unchecked, and if the guard is the correct behaviour then that hole is already live."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svgimport/geometry.go"},"region":{"startLine":58}}}],"partialFingerprints":{"codehealthFindingId/v1":"4946d64bb3c237738a15f0a72ba2a367464bf5ee447851d7a309b51342d0af1d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (16 lines \u00D7 2): d2renderers/d2svgimport/geometry.go:71-86 | d2renderers/d2svgimport/geometry.go:114-129 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svgimport/geometry.go"},"region":{"startLine":71}}}],"partialFingerprints":{"codehealthFindingId/v1":"c905d9a0ee05d24798e488e21b400e37c4244a78c15fbdb74e912029ad1f242b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15\u201316 lines \u00D7 2): lib/textmeasure/textmeasure.go:198-213 | lib/textmeasure/textmeasure.go:225-239 \u2014 both copies are in the same file, so extract the block 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":"lib/textmeasure/textmeasure.go"},"region":{"startLine":198}}}],"partialFingerprints":{"codehealthFindingId/v1":"a71b8b3d972315ab80dc94fb094f3e6ec1015d573547a1c596460c6a33f01405"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15 lines \u00D7 11): d2layouts/d2talalayout/internal/layoutgraph/topology_preflight.go:225-239 | d2layouts/d2talalayout/internal/layoutgraph/topology_preflight.go:241-255 | d2layouts/d2talalayout/internal/layoutgraph/topology_preflight.go:257-271 | d2layouts/d2talalayout/internal/layoutgraph/topology_preflight.go:273-287 | d2layouts/d2talalayout/internal/layoutgraph/topology_preflight.go:289-303 | d2layouts/d2talalayout/internal/layoutgraph/topology_preflight.go:603-617 | d2layouts/d2talalayout/internal/layoutgraph/topology_preflight.go:619-633 | d2layouts/d2talalayout/internal/layoutgraph/topology_preflight.go:635-649 | d2layouts/d2talalayout/internal/layoutgraph/topology_preflight.go:651-665 | d2layouts/d2talalayout/internal/layoutgraph/topology_preflight.go:667-681 | d2layouts/d2talalayout/internal/layoutgraph/topology_preflight.go:683-697 \u2014 all 11 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any \u0060return\u0060 inside it is the body\u0027s own exit and keeps its meaning in the moved unit."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/topology_preflight.go"},"region":{"startLine":225}}}],"partialFingerprints":{"codehealthFindingId/v1":"e11ddd9e8389951e3175c897aca8daa511d7aa275880d4745ff5068ff88d1708"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15 lines \u00D7 4): d2oracle/edit.go:93-107 | d2oracle/edit.go:140-154 | d2oracle/edit.go:953-967 | d2oracle/edit.go:1770-1784 \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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2oracle/edit.go"},"region":{"startLine":93}}}],"partialFingerprints":{"codehealthFindingId/v1":"08f08cf050d84b57773f43fdf909aa16629bfd2ad4248e4f7564091b4e578684"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12\u201315 lines \u00D7 4): d2renderers/d2sketch/sketch.go:69-80 | d2renderers/d2sketch/sketch.go:116-130 | d2renderers/d2sketch/sketch.go:179-190 | d2renderers/d2sketch/sketch.go:232-246 \u2014 all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites \u2014 resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2renderers/d2sketch/sketch.go:69\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":69}}}],"partialFingerprints":{"codehealthFindingId/v1":"6ebb7cedaba543d51cee901f037aff69780c30d80a67638a5e0084bcf28ccafb"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11\u201315 lines \u00D7 3): d2layouts/d2talalayout/internal/layoutgraph/transaction_snapshot.go:236-250 | d2layouts/d2talalayout/internal/packing/combine.go:70-80 | d2layouts/d2talalayout/internal/routing/snapshot.go:55-66 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 and call it from each site; until then, every change has to be made 3 times."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/transaction_snapshot.go"},"region":{"startLine":236}}}],"partialFingerprints":{"codehealthFindingId/v1":"8f8be63ad4e8a63a87859278767232f4e4bc5bff87c2cab30b7c0714a9dc6387"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15 lines \u00D7 3): d2layouts/d2talalayout/internal/routing/slingshot.go:728-742 | d2layouts/d2talalayout/internal/routing/slingshot.go:958-972 | d2layouts/d2talalayout/internal/routing/slingshot.go:999-1013 \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 \u0060d2layouts/d2talalayout/internal/routing/slingshot.go:728\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/d2talalayout/internal/routing/slingshot.go"},"region":{"startLine":728}}}],"partialFingerprints":{"codehealthFindingId/v1":"d06ef6b6614383ee80a1f04c2e450c57b5c8b07ec692c8b1c16db8eb992e01db"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15 lines \u00D7 2): d2ast/d2ast.go:1364-1378 | d2ast/d2ast.go:1406-1420 \u2014 both copies are in the same file, so extract the block 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":"4914b454cbc2eec8fea5d1772d030e5c0d6e5f9a3d1fb7220c4a2a4e7cb06a6a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15 lines \u00D7 2): d2ast/d2ast.go:1400-1414 | d2ast/d2ast.go:1493-1507 \u2014 both copies are in the same file, so extract the block 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":"05808a79140878068aa09caf0ae23c69c01d0fb6c984a258a40951bce92a448f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15 lines \u00D7 2): d2compiler/compile.go:775-789 | d2compiler/compile.go:958-972 \u2014 both copies are in the same file, so extract the block 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":"d2compiler/compile.go"},"region":{"startLine":775}}}],"partialFingerprints":{"codehealthFindingId/v1":"f3070f8195f05fcbc039a727c4afb01e0c31ff0fa14a9acce12bdf396456c0d2"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15 lines \u00D7 2): d2layouts/d2dagrelayout/layout.go:1757-1771 | d2layouts/d2dagrelayout/layout.go:1774-1788 \u2014 both copies are in the same file, so extract the block 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:1757\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":1757}}}],"partialFingerprints":{"codehealthFindingId/v1":"94f0ad95d592c37cf4dcd3ba45cf06b34b8f3f9c94a6e1722260aa140002357b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15 lines \u00D7 2): d2layouts/d2talalayout/internal/layoutgraph/transaction.go:527-541 | d2layouts/d2talalayout/internal/layoutgraph/transaction.go:928-942 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/layoutgraph/transaction.go:527\u0060 it runs out through the closing brace of the declaration holding it \u2014 the window is that declaration\u0027s tail, not a fragment that begins part-way through something, so those exact 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":"d2layouts/d2talalayout/internal/layoutgraph/transaction.go"},"region":{"startLine":527}}}],"partialFingerprints":{"codehealthFindingId/v1":"5f5edb27e1d6e5bfdaf7f5432ae37a82f3aa23543fb3fdacfeb6144283164c2e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15 lines \u00D7 2): d2layouts/d2talalayout/internal/placement/optimization_guard.go:231-245 | d2layouts/d2talalayout/internal/placement/optimization_guard.go:310-324 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/placement/optimization_guard.go"},"region":{"startLine":231}}}],"partialFingerprints":{"codehealthFindingId/v1":"eafb9bbe962e4fc27d55369e67cc5a5a9abd3c074cd8e46526fbd939a566dc28"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15 lines \u00D7 2): d2layouts/d2talalayout/internal/routing/ovg.go:620-634 | d2layouts/d2talalayout/internal/routing/ovg.go:635-649 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/routing/ovg.go"},"region":{"startLine":620}}}],"partialFingerprints":{"codehealthFindingId/v1":"d93020b959d30d2887f5477114281d6a88e89fbd7ff8faf30a597834d994cb16"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15 lines \u00D7 2): d2layouts/d2talalayout/internal/routing/ovg.go:651-665 | d2layouts/d2talalayout/internal/routing/ovg.go:666-680 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/routing/ovg.go"},"region":{"startLine":651}}}],"partialFingerprints":{"codehealthFindingId/v1":"a35febc74a7c95a5f71b9b320bf3281778f8fe7496ef7dfe5d5e6a701b46a64e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15 lines \u00D7 2): d2layouts/d2talalayout/internal/routing/ovg.go:681-695 | d2layouts/d2talalayout/internal/routing/ovg.go:696-710 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/routing/ovg.go"},"region":{"startLine":681}}}],"partialFingerprints":{"codehealthFindingId/v1":"87a0972a7e5e3119a56a4dae82de976823d0fe176cb882a0ad549c874d6763a5"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14\u201315 lines \u00D7 2): d2layouts/d2talalayout/internal/routing/ovg_edge_router.go:913-927 | d2layouts/d2talalayout/internal/routing/ovg_edge_router.go:952-965 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/routing/ovg_edge_router.go:913\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/d2talalayout/internal/routing/ovg_edge_router.go"},"region":{"startLine":913}}}],"partialFingerprints":{"codehealthFindingId/v1":"3f5f99de983b75c5c369af0c859b159126c99192717e8fe2fbe1ca6aae993cd9"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15 lines \u00D7 2): d2layouts/d2talalayout/internal/routing/postprocess.go:609-623 | d2layouts/d2talalayout/internal/routing/postprocess.go:666-680 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/routing/postprocess.go"},"region":{"startLine":609}}}],"partialFingerprints":{"codehealthFindingId/v1":"237eb2db9afcd303394b26fcebfe1b2a0670224bb2a57856860d3db440e847c7"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15 lines \u00D7 2): d2renderers/d2raster/effects.go:1419-1433 | d2renderers/d2raster/effects.go:1477-1491 \u2014 both copies are in the same file, so extract the block 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/d2raster/effects.go"},"region":{"startLine":1419}}}],"partialFingerprints":{"codehealthFindingId/v1":"16e94328bdc009f5965614d2c315ba8cf6fd4807a6097d289094daa5876495d8"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14\u201315 lines \u00D7 2): d2renderers/d2scenebuild/appendix.go:55-68 | d2renderers/d2scenebuild/appendix.go:89-103 \u2014 both copies are in the same file, so extract the block 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/d2scenebuild/appendix.go:55\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/d2scenebuild/appendix.go"},"region":{"startLine":55}}}],"partialFingerprints":{"codehealthFindingId/v1":"624225d7272ae593c6d595602ce0cc20d05ee706c7b703cadd7dfa18e3be2aab"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13\u201315 lines \u00D7 2): d2renderers/d2scenebuild/appendix.go:289-301 | d2renderers/d2svg/d2svg.go:2279-2293 \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/d2scenebuild/appendix.go"},"region":{"startLine":289}}}],"partialFingerprints":{"codehealthFindingId/v1":"bcd773fd44bf53c8853855d06657a8dd338daf5878d1c607c264c2b46bb9b880"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15 lines \u00D7 2): d2renderers/d2svg/class.go:149-163 | d2renderers/d2svg/table.go:172-186 \u2014 before extracting anything, compare \u0060d2renderers/d2svg/class.go\u0060 and \u0060d2renderers/d2svg/table.go\u0060 as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2renderers/d2svg/class.go:149\u0060 it runs out through the closing brace of the declaration holding it \u2014 the window is that declaration\u0027s tail, not a fragment that begins part-way through something, so those exact 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":149}}}],"partialFingerprints":{"codehealthFindingId/v1":"4704f6f2cf25bc0e661b67ea9d38ab549dd1c7ff27b215091f74e9a4d78d3739"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15 lines \u00D7 2): d2renderers/d2svg/d2svg.go:1282-1296 | d2renderers/d2svg/d2svg.go:2165-2179 \u2014 both copies are in the same file, so extract the block 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:1282\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":1282}}}],"partialFingerprints":{"codehealthFindingId/v1":"9d9a1ed52e95bee296093200c07a7c7c3110d8a0625680a4676354f13926ca68"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15 lines \u00D7 2): d2renderers/d2svg/d2svg.go:1857-1871 | d2renderers/d2svg/d2svg.go:1906-1920 \u2014 both copies are in the same file, so extract the block 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:1857\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":1857}}}],"partialFingerprints":{"codehealthFindingId/v1":"7d5ef675fd34cb62d995bab96f230f703d2ac69cd2e650f531284d92f08e49e3"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 3): d2layouts/d2talalayout/internal/placement/transpose.go:98-111 | d2layouts/d2talalayout/internal/placement/transpose.go:154-167 | d2layouts/d2talalayout/internal/placement/transpose.go:173-186 \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 \u0060d2layouts/d2talalayout/internal/placement/transpose.go:98\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/d2talalayout/internal/placement/transpose.go"},"region":{"startLine":98}}}],"partialFingerprints":{"codehealthFindingId/v1":"b4ef727fd7852a55ff7a99cd371a427ee8aed2c1f7d2ccd70da1a7160dc076e9"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): ci/release/releasetool/main.go:221-234 | ci/release/releasetool/main.go:789-802 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. The matched lines also register a scope-exit action (a \u0060defer\u0060-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead \u2014 before the caller uses what it releases \u2014 so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"ci/release/releasetool/main.go"},"region":{"startLine":221}}}],"partialFingerprints":{"codehealthFindingId/v1":"b69be418676888a6f2af9614364f75bd355f42a467985c1d773a50f6074f4d68"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): d2ir/d2ir.go:1277-1290 | d2ir/d2ir.go:1312-1325 \u2014 both copies are in the same file, so extract the block 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:1277\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":1277}}}],"partialFingerprints":{"codehealthFindingId/v1":"b7dd33de9756382ee5f72a4b5b943ba011c86d4ae76a584b7e585fd499694082"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): d2ir/expansion.go:303-316 | d2ir/expansion.go:333-346 \u2014 both copies are in the same file, so extract the block 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/expansion.go:303\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 \u0060return\u0060 at the foot of the matched lines is the enclosing body\u0027s own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that \u0060return\u0060 occupied \u2014 no decision has to be handed back and re-acted on."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ir/expansion.go"},"region":{"startLine":303}}}],"partialFingerprints":{"codehealthFindingId/v1":"d22f8e6287190d15ca4629b513d4647d2559017c89e03c2f35a8d397aaecb76a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): d2layouts/d2dagrelayout/layout.go:596-609 | d2layouts/d2elklayout/layout.go:1172-1185 \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:596\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":596}}}],"partialFingerprints":{"codehealthFindingId/v1":"d0adf5a3c4fcc70a621cf9ad5e8d59b78e43ade130ac58ec592c1daa1d0233ad"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): d2layouts/d2talalayout/adapter.go:358-371 | d2layouts/d2talalayout/adapter.go:410-423 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/adapter.go:358\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. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, \u0060d2layouts/d2talalayout/adapter.go:425\u0060 calls \u0060Arrowhead\u0060 and \u0060d2layouts/d2talalayout/adapter.go:372\u0060 does not \u2014 after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/adapter.go"},"region":{"startLine":358}}}],"partialFingerprints":{"codehealthFindingId/v1":"875e98e4f4fe2bb5dbcad376eb026b3fcb85a75e0e78f5c25936a26776eabca9"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): d2layouts/d2talalayout/internal/placement/equidistance.go:105-118 | d2layouts/d2talalayout/internal/placement/transpose.go:38-51 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2layouts/d2talalayout/internal/placement/equidistance.go:105\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. 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":"d2layouts/d2talalayout/internal/placement/equidistance.go"},"region":{"startLine":105}}}],"partialFingerprints":{"codehealthFindingId/v1":"bcd1ce6c01fc3f43a01e3c78beeaccf89737a651bcf9392094a7ddd307154395"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): d2layouts/d2talalayout/internal/placement/metrics.go:67-80 | d2layouts/d2talalayout/internal/placement/optimization_guard.go:392-405 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/metrics.go"},"region":{"startLine":67}}}],"partialFingerprints":{"codehealthFindingId/v1":"19a6a5b5efd88bb3c4393a1e7e6b0019c75397adb31027373d1e9d7047210e5d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): d2layouts/d2talalayout/internal/placement/optimization_guard.go:267-280 | d2layouts/d2talalayout/internal/placement/optimization_guard.go:282-295 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/placement/optimization_guard.go:267\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/d2talalayout/internal/placement/optimization_guard.go"},"region":{"startLine":267}}}],"partialFingerprints":{"codehealthFindingId/v1":"c7a0ec2c0dae04266db452820d6ba18382445ae4af6fbd03a1e131df6316db2b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): d2layouts/d2talalayout/internal/placement/sized_optimizer.go:915-928 | d2layouts/d2talalayout/internal/placement/sizeless_optimizer.go:410-423 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once. The matched lines also register a scope-exit action (a \u0060defer\u0060-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead \u2014 before the caller uses what it releases \u2014 so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/sized_optimizer.go"},"region":{"startLine":915}}}],"partialFingerprints":{"codehealthFindingId/v1":"d4add2cd2f7a05f86c86a293826c9b85fcbc08f8f7a2a9e87d91dc9f0a6d6dcb"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): d2layouts/d2talalayout/internal/placementcost/edge_length.go:871-884 | d2layouts/d2talalayout/internal/placementcost/edge_length.go:887-900 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/placementcost/edge_length.go"},"region":{"startLine":871}}}],"partialFingerprints":{"codehealthFindingId/v1":"25bf17f7c6846d877317e99e7549fd05115ca2000fa02529ed928f14f580a368"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): d2oracle/edit.go:1036-1049 | d2oracle/edit.go:1091-1105 \u2014 both copies are in the same file, so extract the block 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:1036\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":1036}}}],"partialFingerprints":{"codehealthFindingId/v1":"e94158d23bd6dae52ddccb3d77325a80d3ef539a695de10512b8f9be41bc3d02"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): d2renderers/d2isometric/d2isometricimg/markdown_cards.go:50-63 | d2renderers/d2isometric/d2isometricimg/native_structured.go:144-157 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2renderers/d2isometric/d2isometricimg/markdown_cards.go:50\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. 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":"d2renderers/d2isometric/d2isometricimg/markdown_cards.go"},"region":{"startLine":50}}}],"partialFingerprints":{"codehealthFindingId/v1":"46f23896144117727305ca341be1b3645bf5cf3905182e9d0256ce6cbeb77439"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): d2renderers/d2raster/effects.go:1470-1483 | d2renderers/d2raster/effects.go:1852-1865 \u2014 both copies are in the same file, so extract the block 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/d2raster/effects.go:1470\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/d2raster/effects.go"},"region":{"startLine":1470}}}],"partialFingerprints":{"codehealthFindingId/v1":"23edf1d3d53083d00664e84e5e5fe9a03124468c4e1ba1e0fa6111eecfb64d9a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): d2renderers/d2raster/gradient.go:901-914 | d2renderers/d2raster/gradient.go:1238-1251 \u2014 both copies are in the same file, so extract the block 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/d2raster/gradient.go"},"region":{"startLine":901}}}],"partialFingerprints":{"codehealthFindingId/v1":"caa54fef91baed9f8c0164288857bbf418ecd589eeef545748e60677d336a4f4"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 4): d2layouts/d2talalayout/internal/labeling/placement.go:90-102 | d2layouts/d2talalayout/internal/labeling/placement.go:534-546 | d2layouts/d2talalayout/internal/labeling/placement.go:556-568 | d2layouts/d2talalayout/internal/labeling/placement.go:813-825 \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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/labeling/placement.go"},"region":{"startLine":90}}}],"partialFingerprints":{"codehealthFindingId/v1":"dc07f81416b127eb8ccb22a76edad709ded80d94650c1dfffdd0a89b79fcbf24"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 4): d2renderers/d2raster/gradient.go:830-842 | d2renderers/d2raster/gradient.go:874-886 | d2renderers/d2raster/gradient.go:1165-1177 | d2renderers/d2raster/gradient.go:1209-1221 \u2014 all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites \u2014 resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also 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/d2raster/gradient.go"},"region":{"startLine":830}}}],"partialFingerprints":{"codehealthFindingId/v1":"624954ccbee094c9e4f469b3c9b5c12eddb33d94a8649d681d2aaaee2747f385"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 3): d2layouts/d2talalayout/internal/hierarchy/discovery.go:46-58 | d2layouts/d2talalayout/internal/hierarchy/placement.go:116-128 | d2layouts/d2talalayout/internal/trees/layout.go:656-668 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2layouts/d2talalayout/internal/hierarchy/discovery.go:46\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a \u0060defer\u0060-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead \u2014 before the caller uses what it releases \u2014 so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, \u0060d2layouts/d2talalayout/internal/trees/layout.go:654\u0060 calls \u0060SetLimit\u0060 and \u0060d2layouts/d2talalayout/internal/hierarchy/discovery.go:45\u0060 does not \u2014 after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/hierarchy/discovery.go"},"region":{"startLine":46}}}],"partialFingerprints":{"codehealthFindingId/v1":"bde3ef508befd98067d37f2e6b33f002ec02a5089e199b25b1edcfd4afb88436"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 3): d2layouts/d2talalayout/internal/routing/ovg_edge_router.go:748-760 | d2layouts/d2talalayout/internal/routing/ovg_edge_router.go:770-782 | d2layouts/d2talalayout/internal/routing/ovg_edge_router.go:786-798 \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 \u0060d2layouts/d2talalayout/internal/routing/ovg_edge_router.go:748\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/d2talalayout/internal/routing/ovg_edge_router.go"},"region":{"startLine":748}}}],"partialFingerprints":{"codehealthFindingId/v1":"2f2c7b36a89e578ed87c2ce25fbf2df6b5ae1288df1d51c1c52b63e0931303ef"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 3): d2layouts/d2talalayout/internal/trees/geometry.go:254-266 | d2layouts/d2talalayout/internal/trees/geometry.go:723-735 | d2layouts/d2talalayout/internal/trees/geometry.go:777-789 \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 \u0060d2layouts/d2talalayout/internal/trees/geometry.go:254\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/d2talalayout/internal/trees/geometry.go"},"region":{"startLine":254}}}],"partialFingerprints":{"codehealthFindingId/v1":"60202dc6b09b9db82dcc0dfef0d40bb49ab4ff5ddca3d29d33a4ed0de7de9568"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12\u201313 lines \u00D7 3): d2oracle/edit.go:2829-2841 | d2oracle/edit.go:3021-3032 | d2oracle/edit.go:3036-3047 \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":"d2oracle/edit.go"},"region":{"startLine":2829}}}],"partialFingerprints":{"codehealthFindingId/v1":"b5ce13ba9ee777db4ed5bcfa4ffb71b29a101b6cb7af1c2de2d5a33414840ac9"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 3): d2renderers/d2ascii/d2ascii.go:157-169 | d2renderers/d2ascii/d2ascii.go:177-189 | d2renderers/d2ascii/d2ascii.go:197-209 \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/d2ascii/d2ascii.go:157\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":157}}}],"partialFingerprints":{"codehealthFindingId/v1":"2ce8b34d06e7f60686b3d4baee1965463fb2e3eebb10af5b3966d78e814ae2c1"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): d2format/format.go:257-270 | d2format/format.go:313-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:257\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":257}}}],"partialFingerprints":{"codehealthFindingId/v1":"ecb9a5a434785a6d413e9e99337b2f7070c03f48e80c150fd6d3d9f8260eb207"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): d2layouts/d2layouts.go:623-635 | d2lib/d2.go:165-177 \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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any \u0060return\u0060 inside it is the body\u0027s own exit and keeps its meaning in the moved unit."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2layouts.go"},"region":{"startLine":623}}}],"partialFingerprints":{"codehealthFindingId/v1":"0cd0f5cbfcbcce80051cf0cce85388d08b5cf3a3449dbc7448dc9363a242120c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): d2layouts/d2talalayout/internal/graphjson/codec.go:299-311 | d2layouts/d2talalayout/internal/graphjson/codec.go:320-332 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2layouts/d2talalayout/internal/graphjson/codec.go:299\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/d2talalayout/internal/graphjson/codec.go"},"region":{"startLine":299}}}],"partialFingerprints":{"codehealthFindingId/v1":"7f5f788fab0dc11a2e9801c59313badda5457b8ee62b6b9215ba233982609650"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): d2layouts/d2talalayout/internal/grouping/cluster_discovery.go:222-234 | d2layouts/d2talalayout/internal/packing/guard.go:72-84 \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/d2talalayout/internal/grouping/cluster_discovery.go:222\u0060 it runs out through the closing brace of the declaration holding it \u2014 the window is that declaration\u0027s tail, not a fragment that begins part-way through something, so those exact 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/d2talalayout/internal/grouping/cluster_discovery.go"},"region":{"startLine":222}}}],"partialFingerprints":{"codehealthFindingId/v1":"562387568132e3fe1c17e972dcd0ba92971dac3b7b1a24b47524c134f1d705d7"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (4\u201313 lines \u00D7 4): d2layouts/d2talalayout/internal/labeling/guard.go:508-511 | d2layouts/d2talalayout/internal/labeling/guard.go:558-570 | d2layouts/d2talalayout/internal/quality/labels.go:513-525 | d2layouts/d2talalayout/internal/routing/route_stage_guard.go:559-562 \u2014 there are 4 copies across 3 file(s) \u2014 more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2layouts/d2talalayout/internal/labeling/guard.go:508\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. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, \u0060d2layouts/d2talalayout/internal/labeling/guard.go:571\u0060 calls \u0060min\u0060 and \u0060d2layouts/d2talalayout/internal/labeling/guard.go:511\u0060 does not \u2014 after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/labeling/guard.go"},"region":{"startLine":508}}}],"partialFingerprints":{"codehealthFindingId/v1":"2ad9826d1863071442bf4b2d95731d67c48e1cd0335a5536ad88ed168b50c559"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): d2layouts/d2talalayout/internal/labeling/placement.go:223-235 | d2layouts/d2talalayout/internal/labeling/placement.go:578-590 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/labeling/placement.go"},"region":{"startLine":223}}}],"partialFingerprints":{"codehealthFindingId/v1":"4bcf79de224ae958f08407b88dfb214e0084054b54da689c4a23a67a606f3899"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): d2layouts/d2talalayout/internal/packing/combine_snapshot.go:32-44 | d2layouts/d2talalayout/internal/placement/types.go:54-66 \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/d2talalayout/internal/packing/combine_snapshot.go:32\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/d2talalayout/internal/packing/combine_snapshot.go"},"region":{"startLine":32}}}],"partialFingerprints":{"codehealthFindingId/v1":"1ab93192782a4530ddc25a46371286939ccd204a46a3366f1dc6f54aa8f1b4e3"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): d2layouts/d2talalayout/internal/placement/compaction.go:117-129 | d2layouts/d2talalayout/internal/placement/compaction.go:180-192 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/placement/compaction.go"},"region":{"startLine":117}}}],"partialFingerprints":{"codehealthFindingId/v1":"438bf256759179aed0f46c8117bb484765506a3ff45ea62b8ce0557e23a7103f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): d2layouts/d2talalayout/internal/placement/gapreduction.go:427-439 | d2layouts/d2talalayout/internal/placement/gapreduction.go:582-594 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/placement/gapreduction.go:427\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/d2talalayout/internal/placement/gapreduction.go"},"region":{"startLine":427}}}],"partialFingerprints":{"codehealthFindingId/v1":"b10618c38a9a8f7ba004d6a105f323a8fa045ee5c856c45d952caa9fc3b9e2e1"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): d2layouts/d2talalayout/internal/placementcost/axis.go:43-55 | d2layouts/d2talalayout/internal/placementcost/axis.go:81-93 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/placementcost/axis.go:43\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/d2talalayout/internal/placementcost/axis.go"},"region":{"startLine":43}}}],"partialFingerprints":{"codehealthFindingId/v1":"c227d2e49fc0c319247f5ef47f7e1216cf3faa747cb96383422b1276a60883ce"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): d2layouts/d2talalayout/internal/routing/coordinator.go:1226-1238 | d2layouts/d2talalayout/internal/routing/coordinator.go:1240-1252 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/routing/coordinator.go:1226\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/d2talalayout/internal/routing/coordinator.go"},"region":{"startLine":1226}}}],"partialFingerprints":{"codehealthFindingId/v1":"1689167fbe292ce992913e21c2c7f3cdfff507394cb7dfdc6a9c4b83539a884e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12\u201313 lines \u00D7 2): d2layouts/d2talalayout/internal/routing/coordinator.go:1699-1711 | d2layouts/d2talalayout/internal/routing/standalone_route_guard.go:368-379 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2layouts/d2talalayout/internal/routing/coordinator.go:1699\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/d2talalayout/internal/routing/coordinator.go"},"region":{"startLine":1699}}}],"partialFingerprints":{"codehealthFindingId/v1":"109c55f53c6e87a20eac1f9999e441927dd07399babc0ba0eb128733758eed0f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): d2layouts/d2talalayout/internal/routing/coordinator.go:1774-1786 | d2layouts/d2talalayout/internal/routing/standalone_route_guard.go:438-450 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2layouts/d2talalayout/internal/routing/coordinator.go:1774\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. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, \u0060d2layouts/d2talalayout/internal/routing/standalone_route_guard.go:435\u0060 calls \u0060step\u0060 and \u0060d2layouts/d2talalayout/internal/routing/coordinator.go:1773\u0060 does not \u2014 after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/coordinator.go"},"region":{"startLine":1774}}}],"partialFingerprints":{"codehealthFindingId/v1":"a8aa7ecf1c47254c72ca9aac1d5a12ee512bba2c813cf4eaa49295597c647d48"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): d2layouts/d2talalayout/internal/routing/ovg_edge_router.go:1234-1246 | d2layouts/d2talalayout/internal/routing/ovg_edge_router.go:1555-1567 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/routing/ovg_edge_router.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":"d2layouts/d2talalayout/internal/routing/ovg_edge_router.go"},"region":{"startLine":1234}}}],"partialFingerprints":{"codehealthFindingId/v1":"d416c9bea21e356574d6325868af9b8cafb49d5dd93ce4849c838b2ddb1e4bac"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): d2layouts/d2talalayout/internal/routing/ovg_resource.go:734-746 | d2layouts/d2talalayout/internal/routing/ovg_resource.go:755-767 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/routing/ovg_resource.go:734\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":"d2layouts/d2talalayout/internal/routing/ovg_resource.go"},"region":{"startLine":734}}}],"partialFingerprints":{"codehealthFindingId/v1":"2ec33c40481fd272ea63adaac64121d185c8ade32fdb1b79cdd7fb2d3531b9d4"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): d2oracle/edit.go:2958-2970 | d2oracle/edit.go:3257-3269 \u2014 both copies are in the same file, so extract the block 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:2958\u0060 it runs out through the closing brace of the declaration holding it \u2014 the window is that declaration\u0027s tail, not a fragment that begins part-way through something, so those exact 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":2958}}}],"partialFingerprints":{"codehealthFindingId/v1":"1c3bd39dfac83338d763c66d2df125fec3f8b6298a0bc02686708441b15cfae1"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): d2renderers/d2isometric/d2isometricimg/raster.go:739-751 | d2renderers/d2isometric/d2isometricimg/svg_lighting.go:237-249 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/raster.go"},"region":{"startLine":739}}}],"partialFingerprints":{"codehealthFindingId/v1":"557d8deb0cfabd6f37f6db20af9d224d10ab972122c1628dfad7b4ab493058a6"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): d2renderers/d2raster/geometry.go:501-514 | d2renderers/d2raster/gradient.go:1353-1366 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/geometry.go"},"region":{"startLine":501}}}],"partialFingerprints":{"codehealthFindingId/v1":"200ed52a59a0008f4ed94ec5df7491106cd961ed89f82ef29c70e65a3052126f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): d2renderers/d2raster/internal/scanline/rasterizer.go:580-592 | d2renderers/d2raster/internal/scanline/rasterizer.go:683-695 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2renderers/d2raster/internal/scanline/rasterizer.go:580\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":"d2renderers/d2raster/internal/scanline/rasterizer.go"},"region":{"startLine":580}}}],"partialFingerprints":{"codehealthFindingId/v1":"0e8a16c7a74cea70452d7a24f2e12377158dac3e9c2cb6d0bc9eacaa18e5dc84"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): d2renderers/d2scenebuild/build.go:607-619 | d2renderers/d2scenebuild/build.go:636-648 \u2014 both copies are in the same file, so extract the block 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/d2scenebuild/build.go"},"region":{"startLine":607}}}],"partialFingerprints":{"codehealthFindingId/v1":"89be6111393c2934e9d86e8f2a53dabe95331bdab126687765ec13950fab71b7"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): d2renderers/d2svgimport/boilerplate.go:64-76 | d2renderers/d2svgimport/clip.go:39-51 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2renderers/d2svgimport/boilerplate.go:64\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svgimport/boilerplate.go"},"region":{"startLine":64}}}],"partialFingerprints":{"codehealthFindingId/v1":"56a6d5a74abd4b4ca1bc0b7bfa73128d76670c8ffcc441c5e3c9820486b4de07"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (17\u201320 lines \u00D7 2): d2renderers/d2svgimport/boilerplate.go:174-190 | d2renderers/d2svgimport/import.go:583-602 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any \u0060return\u0060 inside it is the body\u0027s own exit and keeps its meaning in the moved unit."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svgimport/boilerplate.go"},"region":{"startLine":174}}}],"partialFingerprints":{"codehealthFindingId/v1":"c75a5eaf5bf1bf7553b388f9d91f5a9816aeb29ff401b77fc4f70f01ce561749"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (18\u201319 lines \u00D7 2): lib/xgif/xgif.go:723-740 | lib/xgif/xgif.go:797-815 \u2014 both copies are in the same file, so extract the block 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":"lib/xgif/xgif.go"},"region":{"startLine":723}}}],"partialFingerprints":{"codehealthFindingId/v1":"d7dfa9b09ea5d67dc692923e44ee45b18edb42f702229222f5a56d587c433447"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 4): d2layouts/d2talalayout/internal/hierarchy/discovery.go:48-59 | d2layouts/d2talalayout/internal/hierarchy/placement.go:118-129 | d2layouts/d2talalayout/internal/hierarchy/placement.go:211-222 | d2layouts/d2talalayout/internal/trees/layout.go:658-669 \u2014 there are 4 copies across 3 file(s) \u2014 more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2layouts/d2talalayout/internal/hierarchy/discovery.go:48\u0060 it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows \u2014 the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members\u0027 bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run \u2014 a one-line delegation has no helper inside it to lift \u2014 so generate the run from the set it enumerates, or accept it and keep each member\u0027s own documentation with it. 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. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, \u0060d2layouts/d2talalayout/internal/trees/layout.go:654\u0060 calls \u0060SetLimit\u0060 and \u0060d2layouts/d2talalayout/internal/hierarchy/discovery.go:45\u0060 does not \u2014 after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/hierarchy/discovery.go"},"region":{"startLine":48}}}],"partialFingerprints":{"codehealthFindingId/v1":"fa7e26517c242f1cdd3bac640b92abaed53396d0472e5ae9ac4e83dbf9354d16"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 4): d2layouts/d2talalayout/internal/layoutgraph/topology_preflight.go:185-196 | d2layouts/d2talalayout/internal/layoutgraph/topology_preflight.go:205-216 | d2layouts/d2talalayout/internal/layoutgraph/topology_preflight.go:563-574 | d2layouts/d2talalayout/internal/layoutgraph/topology_preflight.go:583-594 \u2014 all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites \u2014 resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also 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":"d2layouts/d2talalayout/internal/layoutgraph/topology_preflight.go"},"region":{"startLine":185}}}],"partialFingerprints":{"codehealthFindingId/v1":"9b1431130156196110550d10b7ecf1109c85be3e76093d808060a4f9fb850a14"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 4): d2renderers/d2raster/gradient.go:700-711 | d2renderers/d2raster/gradient.go:815-826 | d2renderers/d2raster/gradient.go:859-870 | d2renderers/d2raster/gradient.go:943-954 \u2014 all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites \u2014 resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2renderers/d2raster/gradient.go:700\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/d2raster/gradient.go"},"region":{"startLine":700}}}],"partialFingerprints":{"codehealthFindingId/v1":"7f2f40e81d608fb84f349efdf9e03d15c11ba926ace2757bf089d488a8a5ce03"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 3): d2ast/d2ast.go:1363-1374 | d2ast/d2ast.go:1405-1416 | d2ast/d2ast.go:1498-1509 \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 \u0060d2ast/d2ast.go:1363\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":"d2ast/d2ast.go"},"region":{"startLine":1363}}}],"partialFingerprints":{"codehealthFindingId/v1":"cb05fad7a03dc62aef7a13568b18e3ba5c730c76d93d7291bd33c7dbd4ad3f8f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 3): d2cli/raster_png_encoder.go:589-600 | d2renderers/d2raster/raster.go:598-609 | lib/xgif/xgif.go:1528-1539 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 and call it from each site; until then, every change has to be made 3 times. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any \u0060return\u0060 inside it is the body\u0027s own exit and keeps its meaning in the moved unit."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2cli/raster_png_encoder.go"},"region":{"startLine":589}}}],"partialFingerprints":{"codehealthFindingId/v1":"f91623fb9f227e207de8c4b0df2b270de15d4ff8e641ffe9c31778cfbc77b7e0"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 3): d2ir/d2ir.go:1602-1613 | d2ir/d2ir.go:1729-1740 | d2ir/d2ir.go:1861-1872 \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:1602\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":1602}}}],"partialFingerprints":{"codehealthFindingId/v1":"22ff6e7de4f5bf9d9d415d630e02f33b18def5eff12e3162650dfbf6d005dce5"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 3): d2layouts/d2talalayout/internal/labeling/placement.go:163-174 | d2layouts/d2talalayout/internal/labeling/placement.go:596-607 | d2layouts/d2talalayout/internal/routing/ovg_edge_router.go:626-637 \u2014 there are 3 copies across 2 file(s) \u2014 more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2layouts/d2talalayout/internal/labeling/placement.go:163\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/d2talalayout/internal/labeling/placement.go"},"region":{"startLine":163}}}],"partialFingerprints":{"codehealthFindingId/v1":"5cbf199479f32a765d8ad3fc5587d572a2ee0b3358551ec7ed32f6332985626b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 3): d2renderers/d2raster/effects.go:1735-1746 | d2renderers/d2raster/effects.go:1835-1846 | d2renderers/d2raster/effects.go:1874-1885 \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/d2raster/effects.go:1735\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/d2raster/effects.go"},"region":{"startLine":1735}}}],"partialFingerprints":{"codehealthFindingId/v1":"35d9e69fb505f1c967d73015fd9f736074e7cee22335bd179dae5dda4d504e43"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): d2cli/paged.go:461-472 | d2cli/paged.go:543-554 \u2014 both copies are in the same file, so extract the block 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/paged.go:461\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/paged.go"},"region":{"startLine":461}}}],"partialFingerprints":{"codehealthFindingId/v1":"70b9598d8e99b01fb30889041e716e795de4f0f2753bc003235dccba7e7ff31c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): d2ir/compile.go:1517-1528 | d2ir/compile.go:1553-1564 \u2014 both copies are in the same file, so extract the block 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":"d2ir/compile.go"},"region":{"startLine":1517}}}],"partialFingerprints":{"codehealthFindingId/v1":"c3105d175b72f3b598036ebd7a69d018f2ff9d3a120fce3af23ebb4d9e713bb8"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): d2ir/d2ir.go:337-348 | d2ir/d2ir.go:355-366 \u2014 both copies are in the same file, so extract the block 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:337\u0060 it runs out through the closing brace of the declaration holding it \u2014 the window is that declaration\u0027s tail, not a fragment that begins part-way through something, so those exact 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":337}}}],"partialFingerprints":{"codehealthFindingId/v1":"159d493f93190f6061c401439e4e5599e94c2d965874e6d922cb425b9f099303"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): d2ir/d2ir.go:1618-1629 | d2ir/d2ir.go:1745-1756 \u2014 both copies are in the same file, so extract the block 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:1618\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":1618}}}],"partialFingerprints":{"codehealthFindingId/v1":"f6740435f188c356804e74ceae7a8272b8ff4227932955c25fc1591edc4c2738"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): d2layouts/d2dagrelayout/layout.go:1159-1170 | d2layouts/d2dagrelayout/layout.go:1200-1212 \u2014 both copies are in the same file, so extract the block 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:1159\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":1159}}}],"partialFingerprints":{"codehealthFindingId/v1":"ebd5f8199004f4052e863111b901054209f0ec98982540a910df47b257b40fcf"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): d2layouts/d2dagrelayout/layout.go:1724-1735 | d2layouts/d2dagrelayout/layout.go:1818-1829 \u2014 both copies are in the same file, so extract the block 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":1724}}}],"partialFingerprints":{"codehealthFindingId/v1":"b2cc877d0d613e150a343cce0e5e3ac9494bed1f756a46adbf1523658c7dcda4"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): d2layouts/d2talalayout/internal/grouping/cluster_discovery.go:205-216 | d2layouts/d2talalayout/internal/packing/guard.go:58-69 \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/d2talalayout/internal/grouping/cluster_discovery.go:205\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/d2talalayout/internal/grouping/cluster_discovery.go"},"region":{"startLine":205}}}],"partialFingerprints":{"codehealthFindingId/v1":"c763e8200700ac6a5bbd9b7875ac842b2a5976de9dfa553bf09dbd210d65581e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11\u201312 lines \u00D7 2): d2layouts/d2talalayout/internal/layoutgraph/node.go:1524-1535 | d2layouts/d2talalayout/internal/quality/labels.go:362-372 \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/d2talalayout/internal/layoutgraph/node.go:1524\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/d2talalayout/internal/layoutgraph/node.go"},"region":{"startLine":1524}}}],"partialFingerprints":{"codehealthFindingId/v1":"e4544567fe86bf22153df95a4b012228705e52d7c5d69594c26bf2fe945ac361"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): d2layouts/d2talalayout/internal/layoutgraph/transaction.go:310-321 | d2layouts/d2talalayout/internal/layoutgraph/transaction.go:331-342 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/layoutgraph/transaction.go:310\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/d2talalayout/internal/layoutgraph/transaction.go"},"region":{"startLine":310}}}],"partialFingerprints":{"codehealthFindingId/v1":"e6800a76a4fa3e808a9ae693f36b4a564ce9f51c6e1b7f82896a4e850e096966"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): d2layouts/d2talalayout/internal/layoutgraph/tree_access.go:82-93 | d2layouts/d2talalayout/internal/trees/preprocess_helpers.go:685-696 \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/d2talalayout/internal/layoutgraph/tree_access.go:82\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/d2talalayout/internal/layoutgraph/tree_access.go"},"region":{"startLine":82}}}],"partialFingerprints":{"codehealthFindingId/v1":"72db046abd581efa280a673b5f275fad75102584e7a70bd6d84a5f533c7135a5"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): d2layouts/d2talalayout/internal/packing/binpack.go:390-401 | d2layouts/d2talalayout/internal/packing/binpack.go:405-416 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2layouts/d2talalayout/internal/packing/binpack.go:390\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/d2talalayout/internal/packing/binpack.go"},"region":{"startLine":390}}}],"partialFingerprints":{"codehealthFindingId/v1":"86c1981699ab1a34950b6a96cfa9a3f318c547e2e0cd7042616b463e1512c662"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): d2layouts/d2talalayout/internal/packing/combine.go:248-259 | d2layouts/d2talalayout/internal/packing/combine.go:388-399 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/packing/combine.go:248\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. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, \u0060d2layouts/d2talalayout/internal/packing/combine.go:387\u0060 calls \u0060MoveWithChildren\u0060 and \u0060d2layouts/d2talalayout/internal/packing/combine.go:247\u0060 does not \u2014 after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/packing/combine.go"},"region":{"startLine":248}}}],"partialFingerprints":{"codehealthFindingId/v1":"e747470fa561108ad4b8761d388b698eedc5cd9008db3075a96ce82956b7c7c6"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): d2layouts/d2talalayout/internal/placement/dejitter.go:337-348 | d2layouts/d2talalayout/internal/placement/dejitter.go:368-379 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/dejitter.go"},"region":{"startLine":337}}}],"partialFingerprints":{"codehealthFindingId/v1":"14aaa8da8bcac3e89e1c7f83ea5d22f64c2ff68622d6ab9e86ca5af6a8e08ed2"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): d2layouts/d2talalayout/internal/placement/metrics.go:55-66 | d2layouts/d2talalayout/internal/placement/optimization_guard.go:377-388 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, \u0060d2layouts/d2talalayout/internal/placement/optimization_guard.go:389\u0060 calls \u0060AddSort\u0060 and \u0060d2layouts/d2talalayout/internal/placement/metrics.go:67\u0060 does not \u2014 after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/metrics.go"},"region":{"startLine":55}}}],"partialFingerprints":{"codehealthFindingId/v1":"9bc00fc12c5e8379d0bf18c4d4cfb4bc4490ba5914d4e66bcc18217eb12bfc97"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): d2layouts/d2talalayout/internal/quality/labels.go:531-542 | d2layouts/d2talalayout/internal/routing/route_stage_guard.go:566-578 \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/d2talalayout/internal/quality/labels.go:531\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/quality/labels.go"},"region":{"startLine":531}}}],"partialFingerprints":{"codehealthFindingId/v1":"8e3c7f47abcb75f776165f434923267137a2eedfc899316757d06b6afb4f6ae3"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): d2layouts/d2talalayout/internal/routing/ovg_edge_router.go:126-137 | d2layouts/d2talalayout/internal/routing/tunnel.go:371-382 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/ovg_edge_router.go"},"region":{"startLine":126}}}],"partialFingerprints":{"codehealthFindingId/v1":"d6fc5c4abd14f03b0a42c4d55b9e898014f27bf74c712d5d272b62c93cdfbb58"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10\u201312 lines \u00D7 2): d2layouts/d2talalayout/internal/routing/ovg_edge_router.go:435-446 | d2layouts/d2talalayout/internal/routing/ovg_edge_router.go:448-457 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/routing/ovg_edge_router.go"},"region":{"startLine":435}}}],"partialFingerprints":{"codehealthFindingId/v1":"913f451b738352990cdd6c60689d0b7be705903b03d869d4debca1fc164f7a59"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): d2layouts/d2talalayout/internal/routing/slingshot.go:715-726 | d2layouts/d2talalayout/internal/routing/slingshot.go:940-951 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/routing/slingshot.go"},"region":{"startLine":715}}}],"partialFingerprints":{"codehealthFindingId/v1":"1b88595ae5e3432d60c0773cdf8b157e1d138b71ae6af2b5e3dd7ff62f5e2ddf"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): d2layouts/d2talalayout/internal/trees/geometry.go:683-694 | d2layouts/d2talalayout/internal/trees/geometry.go:812-823 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/trees/geometry.go"},"region":{"startLine":683}}}],"partialFingerprints":{"codehealthFindingId/v1":"4b4410ad07bca95f39fb3b57721edc29fd682ea059456f7c51362637ec363218"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): d2layouts/d2talalayout/internal/trees/geometry.go:740-751 | d2layouts/d2talalayout/internal/trees/geometry.go:825-836 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/trees/geometry.go:740\u0060 it runs out through the closing brace of the declaration holding it \u2014 the window is that declaration\u0027s tail, not a fragment that begins part-way through something, so those exact 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":"d2layouts/d2talalayout/internal/trees/geometry.go"},"region":{"startLine":740}}}],"partialFingerprints":{"codehealthFindingId/v1":"0835488bce2f52b241581d37daa00297cb68227e48e1954ee9622000c5f92bc0"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): d2parser/parse.go:640-651 | d2parser/parse.go:1495-1506 \u2014 both copies are in the same file, so extract the block 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:640\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":640}}}],"partialFingerprints":{"codehealthFindingId/v1":"7ff8c5d1ebda25941473a7903dc30ff72f49ba601804e1974dfb0ad0132cbfa9"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): d2renderers/d2raster/effects.go:621-632 | d2renderers/d2raster/effects.go:642-653 \u2014 both copies are in the same file, so extract the block 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/d2raster/effects.go:621\u0060 it runs out through the closing brace of the declaration holding it \u2014 the window is that declaration\u0027s tail, not a fragment that begins part-way through something, so those exact 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. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, \u0060d2renderers/d2raster/effects.go:620\u0060 calls \u0060addFillSubpath\u0060 and \u0060d2renderers/d2raster/effects.go:641\u0060 does not \u2014 after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/effects.go"},"region":{"startLine":621}}}],"partialFingerprints":{"codehealthFindingId/v1":"134341d2a188778cd319c51756ac71e47e4730bb81ea8dace296c44c349f135c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): d2renderers/d2raster/effects.go:705-716 | d2renderers/d2raster/effects.go:755-766 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2renderers/d2raster/effects.go:705\u0060 it runs out through the closing brace of the declaration holding it \u2014 the window is that declaration\u0027s tail, not a fragment that begins part-way through something, so those exact 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/d2raster/effects.go"},"region":{"startLine":705}}}],"partialFingerprints":{"codehealthFindingId/v1":"3f81643fb6a73df26af8e90dd346344f8038de25f76bbd76213429a206800965"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): d2renderers/d2raster/effects.go:1720-1731 | d2renderers/d2raster/effects.go:1859-1870 \u2014 both copies are in the same file, so extract the block 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/d2raster/effects.go"},"region":{"startLine":1720}}}],"partialFingerprints":{"codehealthFindingId/v1":"92cc5e2e2451f093347363855870cd3e67e445781232db050830685a8526dcdd"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): d2renderers/d2raster/gradient.go:793-804 | d2renderers/d2raster/gradient.go:1127-1138 \u2014 both copies are in the same file, so extract the block 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/d2raster/gradient.go:793\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/d2raster/gradient.go"},"region":{"startLine":793}}}],"partialFingerprints":{"codehealthFindingId/v1":"734845765035ac1721c9b87de0cf0540427c6765bf1533c99bf8648b5cbe0f1b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): d2renderers/d2raster/image.go:941-952 | d2renderers/d2raster/image.go:960-971 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2renderers/d2raster/image.go:941\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/d2raster/image.go"},"region":{"startLine":941}}}],"partialFingerprints":{"codehealthFindingId/v1":"16e0fe90ccada384d3e86196b8f37e9417604570aefaa4c878e2a3af11bc3698"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): d2renderers/d2raster/internal/scanline/rasterizer.go:509-520 | d2renderers/d2raster/internal/scanline/rasterizer.go:615-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. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2renderers/d2raster/internal/scanline/rasterizer.go:509\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/d2raster/internal/scanline/rasterizer.go"},"region":{"startLine":509}}}],"partialFingerprints":{"codehealthFindingId/v1":"1c0c2388cf352e46b4a2c48aa6a3ff6fc96f7f83a56b42529096d5ad6b7cc5b9"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): d2renderers/d2raster/session.go:185-196 | d2renderers/d2scenebuild/assets.go:312-323 \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 \u0060d2renderers/d2raster/session.go:185\u0060 it runs out through the closing brace of the declaration holding it \u2014 the window is that declaration\u0027s tail, not a fragment that begins part-way through something, so those exact 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/d2raster/session.go"},"region":{"startLine":185}}}],"partialFingerprints":{"codehealthFindingId/v1":"495f896f161c09e609d2139f32dd0c79f3655bfa0666b94ca3b25e3fedd2eaba"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): d2renderers/d2sketch/sketch.go:141-152 | d2renderers/d2sketch/sketch.go:257-268 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2renderers/d2sketch/sketch.go:141\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":141}}}],"partialFingerprints":{"codehealthFindingId/v1":"93313b8e122892a3f30f3cd2bd35c9abd9625650716625ea0a326c32b316e911"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): d2renderers/d2sketch/sketch.go:464-475 | d2renderers/d2sketch/sketch.go:598-609 \u2014 both copies are in the same file, so extract the block 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":464}}}],"partialFingerprints":{"codehealthFindingId/v1":"ea1b63113e9a68caa2c6b4c7c06ee3a902fa5c9a4c4e00f24c47d60845c029dd"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): d2renderers/d2svg/class.go:16-27 | d2renderers/d2svg/table.go:49-60 \u2014 before extracting anything, compare \u0060d2renderers/d2svg/class.go\u0060 and \u0060d2renderers/d2svg/table.go\u0060 as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2renderers/d2svg/class.go:16\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":16}}}],"partialFingerprints":{"codehealthFindingId/v1":"f32afa0431bdb04bf5818c76ae0d4da2a9aeaa22d7a97a1d0ce0c8ce468e014f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): d2renderers/d2svg/class.go:100-111 | d2renderers/d2svg/table.go:124-135 \u2014 before extracting anything, compare \u0060d2renderers/d2svg/class.go\u0060 and \u0060d2renderers/d2svg/table.go\u0060 as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svg/class.go"},"region":{"startLine":100}}}],"partialFingerprints":{"codehealthFindingId/v1":"0bcb2c122d1aecb9ee2c126521ae7a94239c0b711e4c9af07d5d569e82957068"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): d2renderers/d2svgimport/path.go:339-351 | d2renderers/d2svgimport/path.go:370-382 \u2014 both copies are in the same file, so extract the block 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/d2svgimport/path.go"},"region":{"startLine":339}}}],"partialFingerprints":{"codehealthFindingId/v1":"a2d0169900191812a718a3dda95d8aea31540ec83baa6dc039b2d14ed4615c41"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): d2renderers/d2svgimport/transform.go:144-156 | d2renderers/d2svgimport/transform.go:175-187 \u2014 both copies are in the same file, so extract the block 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/d2svgimport/transform.go"},"region":{"startLine":144}}}],"partialFingerprints":{"codehealthFindingId/v1":"dcfe243e0a0d611891c57aa3ea91beeb9fa148790f4ebbd3ec284dede2d4be95"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11\u201312 lines \u00D7 2): lib/geo/bezier.go:185-195 | lib/geo/bezier.go:261-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:185\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 \u0060return\u0060 at the foot of the matched lines is the enclosing body\u0027s own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that \u0060return\u0060 occupied \u2014 no decision has to be handed back and re-acted on."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/geo/bezier.go"},"region":{"startLine":185}}}],"partialFingerprints":{"codehealthFindingId/v1":"3565990afec9892f67f6029e9f3aa14c63304d77ba38a6466742ee4fdf27efb3"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 7): d2renderers/d2sketch/sketch.go:77-87 | d2renderers/d2sketch/sketch.go:127-137 | d2renderers/d2sketch/sketch.go:144-154 | d2renderers/d2sketch/sketch.go:187-197 | d2renderers/d2sketch/sketch.go:243-253 | d2renderers/d2sketch/sketch.go:260-270 | d2renderers/d2sketch/sketch.go:304-314 \u2014 all 7 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":"d2renderers/d2sketch/sketch.go"},"region":{"startLine":77}}}],"partialFingerprints":{"codehealthFindingId/v1":"6cce6650d951945d612d32f81d4f31faa54a1943e92ae3932658f3b3c1a82e4e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 4): d2renderers/d2raster/gradient.go:1102-1112 | d2renderers/d2raster/gradient.go:1151-1161 | d2renderers/d2raster/gradient.go:1195-1205 | d2renderers/d2raster/gradient.go:1279-1289 \u2014 all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites \u2014 resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2renderers/d2raster/gradient.go:1102\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/d2raster/gradient.go"},"region":{"startLine":1102}}}],"partialFingerprints":{"codehealthFindingId/v1":"de6f24e7ea082a9b76c3ff3db3c107a7094b9e0715d95b68fe8c228243a4bc7e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 3): d2oracle/edit.go:2958-2968 | d2oracle/edit.go:3147-3158 | d2oracle/edit.go:3257-3267 \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":"d2oracle/edit.go"},"region":{"startLine":2958}}}],"partialFingerprints":{"codehealthFindingId/v1":"cb8c03d2e18dc7146aad8ef2ed54d144ea00927c96bf71a66b73b22ff6a37496"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 3): d2renderers/d2raster/effects.go:388-398 | d2renderers/d2raster/effects.go:409-419 | d2renderers/d2raster/effects.go:469-479 \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. 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/d2raster/effects.go"},"region":{"startLine":388}}}],"partialFingerprints":{"codehealthFindingId/v1":"2ba9c36feaddb6383c0a816c3805b69d6b2307a1c7b1248e65198e4a551928ae"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10\u201311 lines \u00D7 3): d2renderers/d2scenebuild/labels.go:136-145 | d2renderers/d2scenebuild/markdown.go:79-88 | d2renderers/d2svg/d2svg.go:2054-2064 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2renderers/d2scenebuild/labels.go:136\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, \u0060d2renderers/d2scenebuild/markdown.go:78\u0060 calls \u0060targetGeometry\u0060 and \u0060d2renderers/d2svg/d2svg.go:2053\u0060 does not \u2014 after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/labels.go"},"region":{"startLine":136}}}],"partialFingerprints":{"codehealthFindingId/v1":"173ef86aada0c7768e209c6d5be153066bd8eea54bb378b76945ad9319465a84"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): d2ir/compile.go:424-434 | d2ir/compile.go:561-571 \u2014 both copies are in the same file, so extract the block 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:424\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":424}}}],"partialFingerprints":{"codehealthFindingId/v1":"9b399dc2c57fd0e99d500d6336f95c416cff9bf643a28258dd77688504362430"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): d2ir/d2ir.go:1360-1370 | d2ir/d2ir.go:1426-1436 \u2014 both copies are in the same file, so extract the block 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":"d2ir/d2ir.go"},"region":{"startLine":1360}}}],"partialFingerprints":{"codehealthFindingId/v1":"7ef1123de5f833b18324d6ac8d680b8ff64ddebb19a78f6b2ba243cc2d25e674"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): d2js/d2wasm/functions.go:145-155 | d2js/d2wasm/functions.go:197-207 \u2014 both copies are in the same file, so extract the block 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":"d2js/d2wasm/functions.go"},"region":{"startLine":145}}}],"partialFingerprints":{"codehealthFindingId/v1":"30641ab8ff5d2e7dbcf3d46497100b47bd3aa13b4592eb07d16b7f4e6e316386"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10\u201311 lines \u00D7 2): d2layouts/d2dagrelayout/layout.go:1226-1235 | d2layouts/d2dagrelayout/layout.go:1237-1247 \u2014 both copies are in the same file, so extract the block 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":1226}}}],"partialFingerprints":{"codehealthFindingId/v1":"def6ee8804b026e8bd35919d1cbf69eda8d0b7afd62f48581ed968be68fce6f0"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10\u201311 lines \u00D7 2): d2layouts/d2talalayout/internal/graphbounds/bounds.go:148-157 | d2layouts/d2talalayout/internal/layoutgraph/node.go:528-538 \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/d2talalayout/internal/graphbounds/bounds.go:148\u0060 it runs out through the closing brace of the declaration holding it \u2014 the window is that declaration\u0027s tail, not a fragment that begins part-way through something, so those exact 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. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, \u0060d2layouts/d2talalayout/internal/layoutgraph/node.go:527\u0060 calls \u0060boundingBoxValues\u0060 and \u0060d2layouts/d2talalayout/internal/graphbounds/bounds.go:147\u0060 does not \u2014 after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/graphbounds/bounds.go"},"region":{"startLine":148}}}],"partialFingerprints":{"codehealthFindingId/v1":"b5413d50efd5171aebc4d5b065d733f6196e77c674ffa1d142427fa8bd1a701b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): d2layouts/d2talalayout/internal/grouping/join.go:306-316 | d2layouts/d2talalayout/internal/grouping/join.go:332-342 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/grouping/join.go"},"region":{"startLine":306}}}],"partialFingerprints":{"codehealthFindingId/v1":"b474259aa889bf77300b9fbd51bf57b98d8e223506594944d1535e1e2da5aa8e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): d2layouts/d2talalayout/internal/labeling/guard.go:518-528 | d2layouts/d2talalayout/internal/routing/route_stage_guard.go:569-579 \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/d2talalayout/internal/labeling/guard.go:518\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/d2talalayout/internal/labeling/guard.go"},"region":{"startLine":518}}}],"partialFingerprints":{"codehealthFindingId/v1":"1fb0e2139033d54f86c44986afd61b38942254187f2fb7e2d439045e2c72d30c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): d2layouts/d2talalayout/internal/layoutgraph/graph.go:884-894 | d2layouts/d2talalayout/internal/layoutgraph/graph.go:900-910 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2layouts/d2talalayout/internal/layoutgraph/graph.go:884\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/d2talalayout/internal/layoutgraph/graph.go"},"region":{"startLine":884}}}],"partialFingerprints":{"codehealthFindingId/v1":"27775f8dd72e86f8e816fcddb98e5d752118315600689fb57579b368975125fb"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): d2layouts/d2talalayout/internal/layoutgraph/transaction_snapshot.go:223-233 | d2layouts/d2talalayout/internal/packing/combine.go:57-67 \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/d2talalayout/internal/layoutgraph/transaction_snapshot.go:223\u0060 it runs out through the closing brace of the declaration holding it \u2014 the window is that declaration\u0027s tail, not a fragment that begins part-way through something, so those exact 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/d2talalayout/internal/layoutgraph/transaction_snapshot.go"},"region":{"startLine":223}}}],"partialFingerprints":{"codehealthFindingId/v1":"cecab467aabc02cfa87c9b773768198d46f19353bb9de920d74497c5fd1544a5"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10\u201311 lines \u00D7 2): d2layouts/d2talalayout/internal/packing/combine.go:39-48 | d2layouts/d2talalayout/internal/routing/snapshot.go:42-52 \u2014 before extracting anything, compare \u0060d2layouts/d2talalayout/internal/packing/combine.go\u0060 and \u0060d2layouts/d2talalayout/internal/routing/snapshot.go\u0060 as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any \u0060return\u0060 inside it is the body\u0027s own exit and keeps its meaning in the moved unit."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/packing/combine.go"},"region":{"startLine":39}}}],"partialFingerprints":{"codehealthFindingId/v1":"ca2a404f19fd93caae45874b522d58344ab207396a3cafb103377adb6c0c9cd0"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): d2layouts/d2talalayout/internal/placement/cluster_optimization.go:296-306 | d2layouts/d2talalayout/internal/placement/cluster_optimization.go:324-334 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/placement/cluster_optimization.go:296\u0060 it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows \u2014 the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members\u0027 bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run \u2014 a one-line delegation has no helper inside it to lift \u2014 so generate the run from the set it enumerates, or accept it and keep each member\u0027s own documentation with it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/cluster_optimization.go"},"region":{"startLine":296}}}],"partialFingerprints":{"codehealthFindingId/v1":"c9bbddee0cf9700b7a38175bde439a88d55052329d563e8b7759a51039ced9b6"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): d2layouts/d2talalayout/internal/placement/metrics.go:136-146 | d2layouts/d2talalayout/internal/placement/metrics.go:177-187 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/placement/metrics.go"},"region":{"startLine":136}}}],"partialFingerprints":{"codehealthFindingId/v1":"a0bfe799b5d861039dd75c6eb7c74044ed5f9df415be20985ded8786bae1ad26"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): d2layouts/d2talalayout/internal/placementcost/symmetry.go:653-663 | d2layouts/d2talalayout/internal/placementcost/symmetry.go:675-685 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2layouts/d2talalayout/internal/placementcost/symmetry.go:653\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":"d2layouts/d2talalayout/internal/placementcost/symmetry.go"},"region":{"startLine":653}}}],"partialFingerprints":{"codehealthFindingId/v1":"c369f601cf70b456ade96dca1559a971a3d51d5003652136e288d8c38575de69"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): d2layouts/d2talalayout/internal/routing/nudge_channels.go:234-244 | d2layouts/d2talalayout/internal/routing/nudge_channels.go:443-453 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/routing/nudge_channels.go"},"region":{"startLine":234}}}],"partialFingerprints":{"codehealthFindingId/v1":"5ab41c0d500917040d5c1867db38d48c7c011a7b39ec5ff4085ab71d610e812e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): d2layouts/d2talalayout/internal/routing/ovg.go:347-357 | d2layouts/d2talalayout/internal/routing/ovg.go:359-369 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, \u0060d2layouts/d2talalayout/internal/routing/ovg.go:357\u0060 calls \u0060Sort\u0060 and \u0060d2layouts/d2talalayout/internal/routing/ovg.go:345\u0060 does not \u2014 after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/ovg.go"},"region":{"startLine":347}}}],"partialFingerprints":{"codehealthFindingId/v1":"aea39427edde61f1a49901742dd6a7120605c0acc057985fdbb588205c6f15d7"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): d2layouts/d2talalayout/internal/routing/ovg.go:1025-1035 | d2layouts/d2talalayout/internal/routing/ovg.go:1715-1725 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/routing/ovg.go:1025\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/d2talalayout/internal/routing/ovg.go"},"region":{"startLine":1025}}}],"partialFingerprints":{"codehealthFindingId/v1":"1b1ef5e35e21123d8223629249528e357ae1308a9fcae146ff4690c30f04012d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): d2layouts/d2talalayout/internal/trees/preprocess_helpers.go:221-231 | d2layouts/d2talalayout/internal/trees/preprocess_helpers.go:462-472 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/trees/preprocess_helpers.go"},"region":{"startLine":221}}}],"partialFingerprints":{"codehealthFindingId/v1":"35143bdead2ec15e50d0c78b116583cab22a2d26c52ca603204fc2f39f993bba"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): d2oracle/edit.go:186-196 | d2oracle/edit.go:2568-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. 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":186}}}],"partialFingerprints":{"codehealthFindingId/v1":"397597a9062eb0d6f9490566fdd339e6f874525600570cd2aaf6e4eaaec1f089"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): d2parser/parse.go:580-590 | d2parser/parse.go:1430-1440 \u2014 both copies are in the same file, so extract the block 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:580\u0060 it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows \u2014 the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members\u0027 bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run \u2014 a one-line delegation has no helper inside it to lift \u2014 so generate the run from the set it enumerates, or accept it and keep each member\u0027s own documentation with it. 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":580}}}],"partialFingerprints":{"codehealthFindingId/v1":"053141ae2024602b95bec39e7a14234c1d637e23355055c0f69943086ab0e257"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): d2parser/parse.go:1824-1834 | d2parser/parse.go:1874-1884 \u2014 both copies are in the same file, so extract the block 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:1824\u0060 it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows \u2014 the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members\u0027 bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run \u2014 a one-line delegation has no helper inside it to lift \u2014 so generate the run from the set it enumerates, or accept it and keep each member\u0027s own documentation with it. 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":1824}}}],"partialFingerprints":{"codehealthFindingId/v1":"24699c9ef81d69a7f2fb7a02682cf260c3d0b7d1a25910555c43aae6e66a0f65"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (4\u201311 lines \u00D7 3): d2renderers/d2ascii/asciishapes/helpers.go:30-40 | d2renderers/d2ascii/asciishapes/page.go:28-38 | d2renderers/d2ascii/asciishapes/rectangle.go:45-48 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2renderers/d2ascii/asciishapes/helpers.go:30\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/d2ascii/asciishapes/helpers.go"},"region":{"startLine":30}}}],"partialFingerprints":{"codehealthFindingId/v1":"51a146daa2e910782c0c532410f820cbbed893d530f9755ccf4fb82539aeb543"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7\u201311 lines \u00D7 2): d2renderers/d2isometric/d2isometricimg/native_edges.go:571-581 | d2renderers/d2isometric/d2isometricimg/native_ink_joins.go:75-81 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/native_edges.go"},"region":{"startLine":571}}}],"partialFingerprints":{"codehealthFindingId/v1":"e0fcbb67f30a9b2d0754f75926d871807c94fdd6e58085e1e786ead697c895c7"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): d2renderers/d2raster/bands.go:146-156 | d2renderers/d2raster/effects.go:288-298 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/bands.go"},"region":{"startLine":146}}}],"partialFingerprints":{"codehealthFindingId/v1":"63f3be891b348f8ebefdb7780b1f77f5a21fc923632d9b8655dab40e00db2e65"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): d2renderers/d2raster/colrv1.go:128-138 | d2renderers/d2raster/colrv1.go:161-171 \u2014 both copies are in the same file, so extract the block 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/d2raster/colrv1.go:128\u0060 it runs out through the closing brace of the declaration holding it \u2014 the window is that declaration\u0027s tail, not a fragment that begins part-way through something, so those exact 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/d2raster/colrv1.go"},"region":{"startLine":128}}}],"partialFingerprints":{"codehealthFindingId/v1":"e0955215dc8600a18b3b1b8dade0f629055965fc9cfe1b9dab60aaff01dab46d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): d2renderers/d2raster/effects.go:1542-1552 | d2renderers/d2raster/effects.go:1702-1712 \u2014 both copies are in the same file, so extract the block 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/d2raster/effects.go:1542\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/d2raster/effects.go"},"region":{"startLine":1542}}}],"partialFingerprints":{"codehealthFindingId/v1":"218799b0bb9882d3294d0ac1fc5d191a848c7a38e86c401348c4773a3f93c876"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): d2renderers/d2raster/geometry.go:575-585 | d2renderers/d2raster/geometry.go:693-703 \u2014 both copies are in the same file, so extract the block 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":"d2renderers/d2raster/geometry.go"},"region":{"startLine":575}}}],"partialFingerprints":{"codehealthFindingId/v1":"8b95df15ae9525a9a5dd7e9afce273f722df57c1476568ca05acb3e45184ee66"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (17 lines \u00D7 2): d2renderers/d2raster/image.go:201-217 | d2renderers/d2svgimport/image.go:344-360 \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 \u0060d2renderers/d2raster/image.go:201\u0060 it runs out through the closing brace of the declaration holding it \u2014 the window is that declaration\u0027s tail, not a fragment that begins part-way through something, so those exact 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/d2raster/image.go"},"region":{"startLine":201}}}],"partialFingerprints":{"codehealthFindingId/v1":"fc8070cf89b36e1aec3671abdc6efb49908ece8f5252250cff787022fdde4390"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): d2renderers/d2raster/image.go:757-767 | d2renderers/d2raster/image.go:791-801 \u2014 both copies are in the same file, so extract the block 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/d2raster/image.go:757\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":"d2renderers/d2raster/image.go"},"region":{"startLine":757}}}],"partialFingerprints":{"codehealthFindingId/v1":"a17af8c01a616579a137a0dde600c2b4fa1974bb0c2591d24f682b08f05b7a13"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12\u201314 lines \u00D7 2): d2renderers/d2scenebuild/build.go:1094-1105 | d2renderers/d2scenebuild/markdown.go:370-383 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2renderers/d2scenebuild/build.go:1094\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/build.go"},"region":{"startLine":1094}}}],"partialFingerprints":{"codehealthFindingId/v1":"785b49b6b0b75ee43fec757c963d203189900e511f9c7722b5e5b5ee38d02a48"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): d2renderers/d2scenebuild/build.go:1231-1241 | d2target/render_validation.go:380-390 \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 \u0060d2renderers/d2scenebuild/build.go:1231\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/d2scenebuild/build.go"},"region":{"startLine":1231}}}],"partialFingerprints":{"codehealthFindingId/v1":"466a8013dca0e4ff8d7a7368941329ff1c492d3bf51325741e106262f2bec6c1"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): d2renderers/d2svg/d2svg.go:1237-1247 | d2renderers/d2svg/d2svg.go:2100-2110 \u2014 both copies are in the same file, so extract the block 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:1237\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":1237}}}],"partialFingerprints":{"codehealthFindingId/v1":"93435a70891b8c0e9f8e169ca35fefaa25318426de513e3f25ce3e7b1018aa1d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): d2renderers/d2svg/d2svg.go:1300-1312 | d2renderers/d2svg/d2svg.go:2196-2208 \u2014 both copies are in the same file, so extract the block 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":1300}}}],"partialFingerprints":{"codehealthFindingId/v1":"903fd81c2b85df97f87c9ade09b2f0088c4ae964b4b0ca09f92fe8f19f954b54"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): lib/imageasset/resolve.go:610-620 | lib/textmeasure/markdown_svg.go:408-418 \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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any \u0060return\u0060 inside it is the body\u0027s own exit and keeps its meaning in the moved unit."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/imageasset/resolve.go"},"region":{"startLine":610}}}],"partialFingerprints":{"codehealthFindingId/v1":"84570102ae7df58573559e3ad71f3bfa0464d643d95e9510aac85c02450f3bf4"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 3): d2layouts/d2talalayout/internal/labeling/placement.go:199-208 | d2layouts/d2talalayout/internal/labeling/placement.go:224-233 | d2layouts/d2talalayout/internal/labeling/placement.go:579-588 \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":"d2layouts/d2talalayout/internal/labeling/placement.go"},"region":{"startLine":199}}}],"partialFingerprints":{"codehealthFindingId/v1":"c7fccdf9d1f79222a0a91ac194560ea7d39b295d163f5595c71044d0366a6c4e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 3): d2renderers/d2raster/filter.go:944-953 | d2renderers/d2raster/filter.go:984-993 | d2renderers/d2raster/filter.go:1110-1119 \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/d2raster/filter.go:944\u0060 it runs out through the closing brace of the declaration holding it \u2014 the window is that declaration\u0027s tail, not a fragment that begins part-way through something, so those exact 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 \u0060return\u0060 at the foot of the matched lines is the enclosing body\u0027s own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that \u0060return\u0060 occupied \u2014 no decision has to be handed back and re-acted on."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/filter.go"},"region":{"startLine":944}}}],"partialFingerprints":{"codehealthFindingId/v1":"56fbe408256bd39a41645a54f444ab333b14e4fdc564c5edca7a5ac2475f0e6d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 3): d2renderers/d2raster/internal/scanline/rasterizer.go:509-518 | d2renderers/d2raster/internal/scanline/rasterizer.go:615-624 | d2renderers/d2raster/internal/scanline/rasterizer.go:739-748 \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/d2raster/internal/scanline/rasterizer.go:509\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/d2raster/internal/scanline/rasterizer.go"},"region":{"startLine":509}}}],"partialFingerprints":{"codehealthFindingId/v1":"113a706ad94d4e241e0cb3db73624eccb95c0c6bd42ab366eb6b2c16e11e8aac"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 3): d2renderers/d2raster/internal/scanline/rasterizer.go:578-587 | d2renderers/d2raster/internal/scanline/rasterizer.go:681-690 | d2renderers/d2raster/internal/scanline/rasterizer.go:783-792 \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/d2raster/internal/scanline/rasterizer.go:578\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/d2raster/internal/scanline/rasterizer.go"},"region":{"startLine":578}}}],"partialFingerprints":{"codehealthFindingId/v1":"cb36c5e45d986e64881487a65226b7f97c58603144bb393ccda74a21a5272902"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): d2cli/board_output_publish.go:326-335 | d2cli/board_output_publish.go:339-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. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2cli/board_output_publish.go:326\u0060 it runs out through the closing brace of the declaration holding it \u2014 the window is that declaration\u0027s tail, not a fragment that begins part-way through something, so those exact 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":"d2cli/board_output_publish.go"},"region":{"startLine":326}}}],"partialFingerprints":{"codehealthFindingId/v1":"e965488952075f4e9368e9f76209ba5291b65b5a0922f9e1610a2195ccc2a86f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): d2cli/raster_png_encoder.go:113-122 | d2renderers/d2raster/raster.go:581-590 \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 \u0060d2cli/raster_png_encoder.go:113\u0060 it runs out through the closing brace of the declaration holding it \u2014 the window is that declaration\u0027s tail, not a fragment that begins part-way through something, so those exact 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":"d2cli/raster_png_encoder.go"},"region":{"startLine":113}}}],"partialFingerprints":{"codehealthFindingId/v1":"e47234c444e6eb8bcbeae5a17a06fc08ea86e808526866499e98b3014375f808"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9\u201310 lines \u00D7 3): d2ir/d2ir.go:2419-2428 | d2ir/d2ir.go:2430-2439 | d2ir/d2ir.go:2440-2448 \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:2419\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. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, \u0060d2ir/d2ir.go:2419\u0060 calls \u0060ScalarString\u0060 and \u0060d2ir/d2ir.go:2440\u0060 does not \u2014 after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ir/d2ir.go"},"region":{"startLine":2419}}}],"partialFingerprints":{"codehealthFindingId/v1":"f634acc071684da3b7cda8b3dcc41c7ae69f3d9653be5ac866b050b0b77afe42"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): d2layouts/d2dagrelayout/layout.go:583-592 | d2layouts/d2elklayout/layout.go:1159-1168 \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:583\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":583}}}],"partialFingerprints":{"codehealthFindingId/v1":"db243b12e829a650472e37b9013cc76d17ed69a4b193ddfa0055357cec229ea3"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): d2layouts/d2talalayout/internal/graphbounds/bounds.go:114-123 | d2layouts/d2talalayout/internal/labeling/guard.go:382-391 \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/d2talalayout/internal/graphbounds/bounds.go:114\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/d2talalayout/internal/graphbounds/bounds.go"},"region":{"startLine":114}}}],"partialFingerprints":{"codehealthFindingId/v1":"03bc35b32bd0de5c7059ab4a28786d8e448b686184254db4f63fc994d0e64f16"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): d2layouts/d2talalayout/internal/hierarchy/rank_simplex.go:145-154 | d2layouts/d2talalayout/internal/hierarchy/rank_simplex.go:462-471 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2layouts/d2talalayout/internal/hierarchy/rank_simplex.go:145\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/d2talalayout/internal/hierarchy/rank_simplex.go"},"region":{"startLine":145}}}],"partialFingerprints":{"codehealthFindingId/v1":"7cb5499e9c0f458d0171773e4e6689839bf6bcb35b278df050e1b4355c4b6a7b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8\u201310 lines \u00D7 2): d2layouts/d2talalayout/internal/labeling/placement.go:1209-1218 | d2layouts/d2talalayout/internal/labeling/placement.go:1238-1245 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/labeling/placement.go"},"region":{"startLine":1209}}}],"partialFingerprints":{"codehealthFindingId/v1":"cdab3cdd407a71f004a09dd4bf6054674a489455fdb5929b9df2a3316827f75e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9\u201310 lines \u00D7 2): d2layouts/d2talalayout/internal/layoutgraph/node.go:1007-1016 | d2layouts/d2talalayout/internal/quality/labels.go:329-337 \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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any \u0060return\u0060 inside it is the body\u0027s own exit and keeps its meaning in the moved unit."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/node.go"},"region":{"startLine":1007}}}],"partialFingerprints":{"codehealthFindingId/v1":"5d9a20f224ead4fa0cbb6e9da2fd9a73748ea51cc5aa746d48b50f2f36bf36cb"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): d2layouts/d2talalayout/internal/packing/binpack.go:256-265 | d2layouts/d2talalayout/internal/packing/binpack.go:894-903 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/packing/binpack.go:256\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/d2talalayout/internal/packing/binpack.go"},"region":{"startLine":256}}}],"partialFingerprints":{"codehealthFindingId/v1":"4a28be7206354aeb85da069a746bc5f4412ad39925dc4eefa6ee7f833c62ce6a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): d2layouts/d2talalayout/internal/packing/binpack.go:623-632 | d2layouts/d2talalayout/internal/packing/binpack.go:729-738 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/packing/binpack.go:623\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/d2talalayout/internal/packing/binpack.go"},"region":{"startLine":623}}}],"partialFingerprints":{"codehealthFindingId/v1":"6f25c5a57551ce54d1934a590344637191b89dd7eaa6be337587783d33e7a730"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): d2layouts/d2talalayout/internal/placement/optimization_guard.go:663-672 | d2layouts/d2talalayout/internal/trees/geometry.go:609-618 \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/d2talalayout/internal/placement/optimization_guard.go:663\u0060 it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows \u2014 the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members\u0027 bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run \u2014 a one-line delegation has no helper inside it to lift \u2014 so generate the run from the set it enumerates, or accept it and keep each member\u0027s own documentation with it. 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":"d2layouts/d2talalayout/internal/placement/optimization_guard.go"},"region":{"startLine":663}}}],"partialFingerprints":{"codehealthFindingId/v1":"267c2ba08734f49bb8ca63eb2aca31f8de0e7ba41819b92be33a9e66d9bceb70"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): d2layouts/d2talalayout/internal/quality/crossings.go:92-101 | d2layouts/d2talalayout/internal/routing/cost.go:73-82 \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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any \u0060return\u0060 inside it is the body\u0027s own exit and keeps its meaning in the moved unit."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/quality/crossings.go"},"region":{"startLine":92}}}],"partialFingerprints":{"codehealthFindingId/v1":"00d7a3908eb75e93bb871afb4581c9ade9b40c9d7f2f202f153ed20fc1c1c839"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): d2layouts/d2talalayout/internal/routing/coordinator.go:1168-1177 | d2layouts/d2talalayout/internal/routing/coordinator.go:1181-1190 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/routing/coordinator.go:1168\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/d2talalayout/internal/routing/coordinator.go"},"region":{"startLine":1168}}}],"partialFingerprints":{"codehealthFindingId/v1":"7198006b6c62c1793793d678dd2b03dc8afe1564597495478ef1d832f7186556"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): d2layouts/d2talalayout/internal/routing/ovg.go:1556-1565 | d2layouts/d2talalayout/internal/routing/ovg.go:1597-1606 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/routing/ovg.go"},"region":{"startLine":1556}}}],"partialFingerprints":{"codehealthFindingId/v1":"8d4e86378da38b96add691c651c3e8559d5dbaca63c7b6dc36ef83b99c71151d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): d2layouts/d2talalayout/internal/routing/slingshot.go:703-712 | d2layouts/d2talalayout/internal/routing/slingshot.go:928-937 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/routing/slingshot.go:703\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":"d2layouts/d2talalayout/internal/routing/slingshot.go"},"region":{"startLine":703}}}],"partialFingerprints":{"codehealthFindingId/v1":"bc34103736fc0dbe7114c836efb63cf387bc466da2f284d52dc4640153027515"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): d2layouts/d2talalayout/internal/routing/standalone_route_guard.go:455-464 | d2layouts/d2talalayout/internal/routing/standalone_route_guard.go:466-475 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/routing/standalone_route_guard.go:455\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/d2talalayout/internal/routing/standalone_route_guard.go"},"region":{"startLine":455}}}],"partialFingerprints":{"codehealthFindingId/v1":"02d72fa5fbae28699745ee168e319c6dab2ccd983fb003e7db9ae0798035c3de"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): d2renderers/d2ascii/asciiroute/routing.go:196-205 | d2renderers/d2ascii/asciiroute/routing.go:270-279 \u2014 both copies are in the same file, so extract the block 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:196\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/asciiroute/routing.go"},"region":{"startLine":196}}}],"partialFingerprints":{"codehealthFindingId/v1":"7a0beb8bbeda5fad7dbf6fd7568ec49b381f9317d2695f8914d476999f26b610"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): d2renderers/d2ascii/d2ascii.go:370-379 | d2renderers/d2ascii/d2ascii.go:387-396 \u2014 both copies are in the same file, so extract the block 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":370}}}],"partialFingerprints":{"codehealthFindingId/v1":"1bac314d3d2ed3cfb5e3522501d1c83aa7a0fc4eb4e6a9c06e7dfddea9de8b58"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): d2renderers/d2raster/animation_value.go:222-231 | d2renderers/d2raster/gradient.go:514-523 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any \u0060return\u0060 inside it is the body\u0027s own exit and keeps its meaning in the moved unit."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/animation_value.go"},"region":{"startLine":222}}}],"partialFingerprints":{"codehealthFindingId/v1":"90451d84ea3530a4915ecd4cd2f3566d0c49771592b6b52b837765ab60d6baf6"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): d2renderers/d2raster/geometry.go:198-207 | d2renderers/d2raster/geometry.go:253-262 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/geometry.go"},"region":{"startLine":198}}}],"partialFingerprints":{"codehealthFindingId/v1":"9bd65bd31d1add8b5f929f98fce068b6f00428173e302fd69eef174c39fa0a3c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): d2renderers/d2raster/gradient.go:728-737 | d2renderers/d2raster/gradient.go:1027-1038 \u2014 both copies are in the same file, so extract the block 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/d2raster/gradient.go"},"region":{"startLine":728}}}],"partialFingerprints":{"codehealthFindingId/v1":"16c3af72926f1586e24e82bb591a3122d19abbcd3fa6b54846dab5d4cc818648"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): d2renderers/d2raster/image.go:994-1003 | d2renderers/d2raster/image.go:1026-1035 \u2014 both copies are in the same file, so extract the block 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/d2raster/image.go:994\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/d2raster/image.go"},"region":{"startLine":994}}}],"partialFingerprints":{"codehealthFindingId/v1":"7d15a5d70b61cd6175735bfbeb998ce7112d5d85c2adfef3b9eb917070c0b552"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9\u201310 lines \u00D7 2): d2renderers/d2scenebuild/assets.go:162-171 | d2renderers/d2scenebuild/latex.go:75-83 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/assets.go"},"region":{"startLine":162}}}],"partialFingerprints":{"codehealthFindingId/v1":"eadb292860d6f85430f119f9cf90f5c9becd0ae81a820672de67b7221942334c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): d2renderers/d2svg/d2svg.go:458-467 | d2renderers/d2svg/d2svg.go:507-516 \u2014 both copies are in the same file, so extract the block 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:458\u0060 it runs out through the closing brace of the declaration holding it \u2014 the window is that declaration\u0027s tail, not a fragment that begins part-way through something, so those exact 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/d2svg/d2svg.go"},"region":{"startLine":458}}}],"partialFingerprints":{"codehealthFindingId/v1":"c0a6083f290be480e7b8e156422336155646c9cf8b366040f57abd10e1b4ba5a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): d2renderers/d2svg/d2svg.go:1884-1893 | d2renderers/d2svg/d2svg.go:1914-1923 \u2014 both copies are in the same file, so extract the block 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":1884}}}],"partialFingerprints":{"codehealthFindingId/v1":"4f0b202a5cda975ffc0ad7118bed7d98faaa2e987d674577e2ad6455c49a9600"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 6): d2renderers/d2raster/gradient.go:1040-1048 | d2renderers/d2raster/gradient.go:1093-1101 | d2renderers/d2raster/gradient.go:1141-1149 | d2renderers/d2raster/gradient.go:1185-1193 | d2renderers/d2raster/gradient.go:1229-1237 | d2renderers/d2raster/gradient.go:1269-1277 \u2014 all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites \u2014 resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2renderers/d2raster/gradient.go:1040\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. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, \u0060d2renderers/d2raster/gradient.go:1049\u0060 calls \u0060wrapped\u0060 and \u0060d2renderers/d2raster/gradient.go:1102\u0060 does not \u2014 after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/gradient.go"},"region":{"startLine":1040}}}],"partialFingerprints":{"codehealthFindingId/v1":"ed4fa85669ba6a28f73ac59c113227b2ec9edea6aff45df917e6982118670d51"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 6): d2renderers/d2raster/internal/scanline/rasterizer.go:507-516 | d2renderers/d2raster/internal/scanline/rasterizer.go:576-585 | d2renderers/d2raster/internal/scanline/rasterizer.go:613-622 | d2renderers/d2raster/internal/scanline/rasterizer.go:679-688 | d2renderers/d2raster/internal/scanline/rasterizer.go:737-746 | d2renderers/d2raster/internal/scanline/rasterizer.go:781-790 \u2014 all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites \u2014 resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2renderers/d2raster/internal/scanline/rasterizer.go:507\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. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, \u0060d2renderers/d2raster/internal/scanline/rasterizer.go:574\u0060 calls \u0060RGBA\u0060 and \u0060d2renderers/d2raster/internal/scanline/rasterizer.go:678\u0060 does not \u2014 after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/internal/scanline/rasterizer.go"},"region":{"startLine":507}}}],"partialFingerprints":{"codehealthFindingId/v1":"1d3f6c005f58ee365bfca6bd7d0a7704cc46aa6ad690d166b402cbcb061f5032"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 5): d2renderers/d2raster/gradient.go:699-707 | d2renderers/d2raster/gradient.go:814-822 | d2renderers/d2raster/gradient.go:858-866 | d2renderers/d2raster/gradient.go:915-923 | d2renderers/d2raster/gradient.go:942-950 \u2014 all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites \u2014 resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2renderers/d2raster/gradient.go:699\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/d2raster/gradient.go"},"region":{"startLine":699}}}],"partialFingerprints":{"codehealthFindingId/v1":"b5bc0e968addd7ff9c2b6044787b049f07891ba9ed8694cca22f8d334a9a9f6b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 3): d2renderers/d2raster/effects.go:1024-1032 | d2renderers/d2raster/effects.go:1118-1126 | d2renderers/d2raster/effects.go:1238-1246 \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/d2raster/effects.go:1024\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/d2raster/effects.go"},"region":{"startLine":1024}}}],"partialFingerprints":{"codehealthFindingId/v1":"80fad98cd3914b5585e7aef74d18a908b895c3d146d0f885517b8bf682c80cdc"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 3): d2renderers/d2svgimport/path.go:343-351 | d2renderers/d2svgimport/path.go:354-362 | d2renderers/d2svgimport/path.go:374-382 \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":"d2renderers/d2svgimport/path.go"},"region":{"startLine":343}}}],"partialFingerprints":{"codehealthFindingId/v1":"2aa1f8e52757501f1666877f8bcea9a84799bf0adaa3d2dbac4e69fb834a2b3e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 3): d2renderers/d2svgimport/transform.go:148-156 | d2renderers/d2svgimport/transform.go:159-167 | d2renderers/d2svgimport/transform.go:179-187 \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":"d2renderers/d2svgimport/transform.go"},"region":{"startLine":148}}}],"partialFingerprints":{"codehealthFindingId/v1":"fa53e6b9534c22be8b5b09341daa4b2ef5add3612d6a22029e7f41ed2c2347d6"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): d2graph/d2graph.go:1913-1921 | d2graph/layout.go:298-306 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2graph/d2graph.go:1913\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":1913}}}],"partialFingerprints":{"codehealthFindingId/v1":"69244fd7a052603feb7b7958e1d29cb9009a1e09c37c65c490952a92268ce899"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): d2graph/layout.go:144-152 | d2layouts/d2elklayout/descendant_shifter.go:119-127 \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 \u0060d2graph/layout.go:144\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":144}}}],"partialFingerprints":{"codehealthFindingId/v1":"dd8c778e7325b954ef6520fabcfcdddc0a7baa15d63dc4344dd3c700c8f583e5"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): d2ir/d2ir.go:1643-1651 | d2ir/d2ir.go:1788-1796 \u2014 both copies are in the same file, so extract the block 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:1643\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":"d2ir/d2ir.go"},"region":{"startLine":1643}}}],"partialFingerprints":{"codehealthFindingId/v1":"92ff4cb84d7aea9ec019f62fd27320205c119b4596d8d659ae12662dc5edc0f6"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): d2ir/import.go:27-35 | d2ir/import.go:197-205 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ir/import.go"},"region":{"startLine":27}}}],"partialFingerprints":{"codehealthFindingId/v1":"180dbdac4bde3dc2ba7c99eb935a37f7f7722301e436b6b88ad806cbb8bef9dd"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (21 lines \u00D7 2): d2layouts/d2dagrelayout/layout.go:339-359 | d2layouts/d2elklayout/layout.go:639-659 \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":"d2layouts/d2dagrelayout/layout.go"},"region":{"startLine":339}}}],"partialFingerprints":{"codehealthFindingId/v1":"2b8f3c4e2d2b5ba4737f173a4043347c71f94bffc807a26391131596a1823329"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): d2layouts/d2grid/layout.go:282-290 | d2layouts/d2grid/layout.go:297-305 \u2014 both copies are in the same file, so extract the block 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:282\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/d2grid/layout.go"},"region":{"startLine":282}}}],"partialFingerprints":{"codehealthFindingId/v1":"0d32cd8f8f41e51e7f1cb2086306b999eeb1ad599e6d02fe87b640d9f373f1b1"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): d2layouts/d2talalayout/internal/layoutgraph/transaction.go:1039-1047 | d2layouts/d2talalayout/internal/layoutgraph/transaction.go:1050-1058 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/layoutgraph/transaction.go:1039\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/d2talalayout/internal/layoutgraph/transaction.go"},"region":{"startLine":1039}}}],"partialFingerprints":{"codehealthFindingId/v1":"e7be73b8a5fd5fc71278c44ca5dabf3b954988938a1f7867f519c0dc076ecbd7"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): d2layouts/d2talalayout/internal/layoutgraph/transaction_snapshot.go:304-312 | d2layouts/d2talalayout/internal/layoutgraph/transaction_snapshot.go:733-741 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/layoutgraph/transaction_snapshot.go:304\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/d2talalayout/internal/layoutgraph/transaction_snapshot.go"},"region":{"startLine":304}}}],"partialFingerprints":{"codehealthFindingId/v1":"ed677c0a3eda2dbd3a4d0782dc00a9d8ff6ad480cf2d9ef30372623dd8b5eae9"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): d2layouts/d2talalayout/internal/placement/alignment.go:89-97 | d2layouts/d2talalayout/internal/placement/alignment.go:162-170 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/placement/alignment.go"},"region":{"startLine":89}}}],"partialFingerprints":{"codehealthFindingId/v1":"16a70fd616fc93eb005f54bf2b3880695342e29d1d0f90ba88fc0a213d30ce2d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8\u20139 lines \u00D7 2): d2layouts/d2talalayout/internal/placement/gapreduction.go:608-616 | d2layouts/d2talalayout/internal/placement/gapreduction.go:701-708 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/placement/gapreduction.go:608\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/d2talalayout/internal/placement/gapreduction.go"},"region":{"startLine":608}}}],"partialFingerprints":{"codehealthFindingId/v1":"7f3a3c5a4376751c5aa91f2d6ef5b4534d2178d402e3cd865342be7218d92a84"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): d2layouts/d2talalayout/internal/placementcost/symmetry.go:626-634 | d2layouts/d2talalayout/internal/routing/turns.go:13-21 \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":"d2layouts/d2talalayout/internal/placementcost/symmetry.go"},"region":{"startLine":626}}}],"partialFingerprints":{"codehealthFindingId/v1":"a86fc7b31640e469fe708ee3371220747c817f9a7739b9d377a4d22e8ece9b84"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 4): d2layouts/d2talalayout/internal/routing/ovg.go:512-520 | d2layouts/d2talalayout/internal/routing/ovg.go:522-530 | d2layouts/d2talalayout/internal/routing/ovg.go:531-539 | d2layouts/d2talalayout/internal/routing/ovg.go:541-549 \u2014 all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites \u2014 resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2layouts/d2talalayout/internal/routing/ovg.go:531\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. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, \u0060d2layouts/d2talalayout/internal/routing/ovg.go:539\u0060 calls \u0060NewPoint\u0060 and \u0060d2layouts/d2talalayout/internal/routing/ovg.go:520\u0060 does not \u2014 after which the two agree again for 5 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/ovg.go"},"region":{"startLine":512}}}],"partialFingerprints":{"codehealthFindingId/v1":"07629e8a300de39ca8a896fac5e2cf1be99a672e2555e6ffee990b2ed90f3e75"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): d2layouts/d2talalayout/internal/routing/ovg_edge_router.go:520-528 | d2layouts/d2talalayout/internal/routing/ovg_edge_router.go:529-537 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/routing/ovg_edge_router.go"},"region":{"startLine":520}}}],"partialFingerprints":{"codehealthFindingId/v1":"b0b47133c8e5f23e009456dd5a8d03d074a394de90db973c2048af198e4bd839"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): d2layouts/d2talalayout/internal/routing/shortcut_routes.go:477-486 | d2layouts/d2talalayout/internal/routing/shortcut_routes.go:495-504 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/routing/shortcut_routes.go:477\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/d2talalayout/internal/routing/shortcut_routes.go"},"region":{"startLine":477}}}],"partialFingerprints":{"codehealthFindingId/v1":"7d94bc122504b4858ca43d0a687687ec1cf17407cd6438a72d6c87109ae9ebae"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): d2oracle/edit.go:198-206 | d2oracle/edit.go:2581-2589 \u2014 both copies are in the same file, so extract the block 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":"b9e877381f1456f05a9e543e26987e6b7284e91444d8a4f54e389a03b5b1185b"}},{"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, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, 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":"a93645e9d3fa82c8ac97ff7a6eba11ec0f224205ba093190cf616a2277588157"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): d2renderers/d2ascii/asciishapes/helpers.go:57-65 | d2renderers/d2ascii/asciishapes/helpers.go:71-79 \u2014 both copies are in the same file, so extract the block 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/asciishapes/helpers.go"},"region":{"startLine":57}}}],"partialFingerprints":{"codehealthFindingId/v1":"af8dc57aa0fae9f306e1e33081f7fe9291b2f631ebd0a24c709287de879e50c0"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): d2renderers/d2isometric/d2isometricimg/raster.go:723-731 | d2renderers/d2isometric/d2isometricimg/raster.go:955-963 \u2014 both copies are in the same file, so extract the block 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/d2isometric/d2isometricimg/raster.go:723\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/d2isometric/d2isometricimg/raster.go"},"region":{"startLine":723}}}],"partialFingerprints":{"codehealthFindingId/v1":"61c6be8dc1a73dee18258d65b1e53e9cb2fecd72ac46e7c7e46c6ff5aba698c2"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): d2renderers/d2isometric/d2isometricimg/route_bridges.go:94-103 | d2renderers/d2isometric/d2isometricimg/route_lanes.go:103-112 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2renderers/d2isometric/d2isometricimg/route_bridges.go:94\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/d2isometric/d2isometricimg/route_bridges.go"},"region":{"startLine":94}}}],"partialFingerprints":{"codehealthFindingId/v1":"dee40413959459f9a99acdccce50829cde7fd33a88e3c3aafba2308e8eb573c1"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): d2renderers/d2raster/effects.go:696-704 | d2renderers/d2raster/raster.go:1547-1555 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2renderers/d2raster/effects.go:696\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/d2raster/effects.go"},"region":{"startLine":696}}}],"partialFingerprints":{"codehealthFindingId/v1":"eb7f222310abb4706f2e8bde893b0c0d1f68ca9fc6afdb9fdfd413954092c742"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): d2renderers/d2raster/filter.go:572-584 | d2renderers/d2raster/filter.go:615-627 \u2014 both copies are in the same file, so extract the block 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/d2raster/filter.go:572\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/d2raster/filter.go"},"region":{"startLine":572}}}],"partialFingerprints":{"codehealthFindingId/v1":"45ed9c50c1bfa8f6d8d7095adfc6e758950be03320e47d57d4b73323376f16b7"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): d2renderers/d2raster/filter.go:707-715 | d2renderers/d2raster/filter.go:877-885 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2renderers/d2raster/filter.go:707\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/d2raster/filter.go"},"region":{"startLine":707}}}],"partialFingerprints":{"codehealthFindingId/v1":"be83aa74e4b68e72f1dbd76725e08ffd86359b8dc3507deb32dcbb65cc1879e8"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): d2renderers/d2raster/geometry.go:449-457 | d2renderers/d2raster/geometry.go:471-479 \u2014 both copies are in the same file, so extract the block 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/d2raster/geometry.go"},"region":{"startLine":449}}}],"partialFingerprints":{"codehealthFindingId/v1":"a3dad056899493ac35e25b7bedd9d54bf1d471430baa9c91e3dff8d2d2279c5a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): d2renderers/d2raster/image.go:649-657 | d2renderers/d2raster/image.go:896-904 \u2014 both copies are in the same file, so extract the block 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/d2raster/image.go:649\u0060 it runs out through the closing brace of the declaration holding it \u2014 the window is that declaration\u0027s tail, not a fragment that begins part-way through something, so those exact 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 \u0060return\u0060 at the foot of the matched lines is the enclosing body\u0027s own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that \u0060return\u0060 occupied \u2014 no decision has to be handed back and re-acted on."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/image.go"},"region":{"startLine":649}}}],"partialFingerprints":{"codehealthFindingId/v1":"249d546952c353b588b9978d643b57884439f90d7f695a6d50dd28285dd61556"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): d2renderers/d2scenebuild/legend.go:133-141 | d2renderers/d2svg/d2svg.go:479-487 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 and call it from each site; until then, every change has to be made twice. Note what the matched lines are: every one of them assigns one field to another, so the block is a hand-written mapper between two data shapes rather than behaviour with a helper inside it. Extracting one shared function only works if both sites map the SAME pair of types in the same direction \u2014 check that first, because inverse or differently-typed mappers have no single function they can both call. Where they do not, the moves that exist are a generated or reflective mapper, a common embedded/base type the fields live on once, or accepting the run and covering it with a test that fails when a field is added to one side only."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/legend.go"},"region":{"startLine":133}}}],"partialFingerprints":{"codehealthFindingId/v1":"1ae0d897805947aab227da9566c1fabbdda79e279c54ba64ff242a5f1d2126b6"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): d2renderers/d2scenebuild/markdown.go:127-135 | d2renderers/d2scenebuild/tooltip.go:33-41 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/markdown.go"},"region":{"startLine":127}}}],"partialFingerprints":{"codehealthFindingId/v1":"135c15096684f6bd9c14d04e3daab374ed3047c6a63ab6760a345e573ce971c4"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): d2renderers/d2scenebuild/patterns.go:268-276 | d2renderers/d2scenebuild/sketch_shapes.go:214-222 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2renderers/d2scenebuild/patterns.go:268\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/d2scenebuild/patterns.go"},"region":{"startLine":268}}}],"partialFingerprints":{"codehealthFindingId/v1":"a4ea9b6430af89da0d565a803b1479c5ab976824bca435c9a0fcbb2bdd6ff7df"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): d2renderers/d2svgimport/style.go:142-150 | d2renderers/d2svgimport/stylesheet.go:228-236 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2renderers/d2svgimport/style.go:142\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/d2svgimport/style.go"},"region":{"startLine":142}}}],"partialFingerprints":{"codehealthFindingId/v1":"a9000154c36cf91f90d1cd2620a87dc42407171812b661800ad1434ca03fa166"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8\u20139 lines \u00D7 2): lib/geo/bezier.go:183-190 | lib/geo/bezier.go:203-211 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060lib/geo/bezier.go:183\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/geo/bezier.go"},"region":{"startLine":183}}}],"partialFingerprints":{"codehealthFindingId/v1":"3620d03042e53d5870326fc7d70d97d22cb7816eeab8fc927bd4116fc9f59374"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): lib/imageasset/imageasset.go:147-155 | lib/imageasset/imageasset.go:193-201 \u2014 both copies are in the same file, so extract the block 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/imageasset/imageasset.go:147\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/imageasset/imageasset.go"},"region":{"startLine":147}}}],"partialFingerprints":{"codehealthFindingId/v1":"873fcb011ee1dda5cd5f07d5e2aadd0f5c0fdad00a7d14e375a9e4cfd6d72509"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 6): d2layouts/d2talalayout/internal/trees/geometry.go:252-259 | d2layouts/d2talalayout/internal/trees/geometry.go:680-687 | d2layouts/d2talalayout/internal/trees/geometry.go:721-728 | d2layouts/d2talalayout/internal/trees/geometry.go:775-782 | d2layouts/d2talalayout/internal/trees/geometry.go:809-816 | d2layouts/d2talalayout/internal/trees/preprocess_helpers.go:582-589 \u2014 there are 6 copies across 2 file(s) \u2014 more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 6 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2layouts/d2talalayout/internal/trees/geometry.go:252\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/d2talalayout/internal/trees/geometry.go"},"region":{"startLine":252}}}],"partialFingerprints":{"codehealthFindingId/v1":"d2ca81f8b339d672f09a537e85a80917fd46f2fb2da563ffc55e9aa25e2b0d30"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 4): d2layouts/d2talalayout/internal/routing/ovg_edge_router.go:739-746 | d2layouts/d2talalayout/internal/routing/ovg_edge_router.go:747-754 | d2layouts/d2talalayout/internal/routing/ovg_edge_router.go:769-776 | d2layouts/d2talalayout/internal/routing/ovg_edge_router.go:785-792 \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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/ovg_edge_router.go"},"region":{"startLine":739}}}],"partialFingerprints":{"codehealthFindingId/v1":"76d2a10ab910b6d4240e35cf2fe5b4b75bdd68ab228b47e6eb413f30c769287a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 4): d2renderers/d2raster/filter.go:601-608 | d2renderers/d2raster/filter.go:644-651 | d2renderers/d2raster/filter.go:701-708 | d2renderers/d2raster/filter.go:754-761 \u2014 all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites \u2014 resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2renderers/d2raster/filter.go:601\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 \u0060return\u0060 at the foot of the matched lines is the enclosing body\u0027s own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that \u0060return\u0060 occupied \u2014 no decision has to be handed back and re-acted on."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/filter.go"},"region":{"startLine":601}}}],"partialFingerprints":{"codehealthFindingId/v1":"055d741870a7aef288d09c4e898528bf15a14970a862793ed9deddef0c0ea654"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 3): d2layouts/d2talalayout/internal/nodeshape/shape_c4person.go:93-100 | d2layouts/d2talalayout/internal/nodeshape/shape_package.go:127-134 | d2layouts/d2talalayout/internal/nodeshape/shape_square.go:94-101 \u2014 before extracting anything, compare \u0060d2layouts/d2talalayout/internal/nodeshape/shape_c4person.go\u0060 and \u0060d2layouts/d2talalayout/internal/nodeshape/shape_package.go\u0060 as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 66 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2layouts/d2talalayout/internal/nodeshape/shape_c4person.go:93\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/nodeshape/shape_c4person.go"},"region":{"startLine":93}}}],"partialFingerprints":{"codehealthFindingId/v1":"46e5f8e4704af6f6cd3a1827b85abbe96f4a6f11c834463109584d742abf4773"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 3): d2layouts/d2talalayout/internal/nodeshape/shape_package.go:114-121 | d2layouts/d2talalayout/internal/nodeshape/shape_square.go:81-88 | d2layouts/d2talalayout/internal/nodeshape/shape_step.go:86-93 \u2014 before extracting anything, compare \u0060d2layouts/d2talalayout/internal/nodeshape/shape_package.go\u0060 and \u0060d2layouts/d2talalayout/internal/nodeshape/shape_square.go\u0060 as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 134 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2layouts/d2talalayout/internal/nodeshape/shape_package.go:114\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":"d2layouts/d2talalayout/internal/nodeshape/shape_package.go"},"region":{"startLine":114}}}],"partialFingerprints":{"codehealthFindingId/v1":"00531a39a5aa1d46fab3641eb240b93a1aa97e113ad1a0f5dc8191c1cf7fe8f6"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 3): d2oracle/edit.go:2064-2071 | d2oracle/edit.go:2078-2085 | d2oracle/edit.go:2090-2097 \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. 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":2064}}}],"partialFingerprints":{"codehealthFindingId/v1":"11eb8f28ce01c1e7139955084c666e7da1e9fac7ea0b1d8522fa9aee1938ad34"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 3): d2renderers/d2raster/effects.go:1419-1426 | d2renderers/d2raster/effects.go:1477-1484 | d2renderers/d2raster/effects.go:1590-1597 \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":"d2renderers/d2raster/effects.go"},"region":{"startLine":1419}}}],"partialFingerprints":{"codehealthFindingId/v1":"fadbc18d40b53342ca2fdc233b67cd477af1517759f49c466b4a1562415e9a31"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 3): d2renderers/d2raster/internal/scanline/rasterizer.go:543-550 | d2renderers/d2raster/internal/scanline/rasterizer.go:645-652 | d2renderers/d2raster/internal/scanline/rasterizer.go:755-762 \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":"d2renderers/d2raster/internal/scanline/rasterizer.go"},"region":{"startLine":543}}}],"partialFingerprints":{"codehealthFindingId/v1":"25e8c9295294522513adb706a74a8fa69ee97e4d90f3f6364389ce2f5963dd41"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 3): d2renderers/d2sketch/sketch.go:84-91 | d2renderers/d2sketch/sketch.go:151-158 | d2renderers/d2sketch/sketch.go:606-613 \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":"d2renderers/d2sketch/sketch.go"},"region":{"startLine":84}}}],"partialFingerprints":{"codehealthFindingId/v1":"a168d0e4f1822b7364adcb3dd568e2dbe583489f84d378a56ef198c1a7898477"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): d2cli/isometric_image.go:156-163 | d2cli/isometric_image.go:167-174 \u2014 both copies are in the same file, so extract the block 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/isometric_image.go:156\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":"d2cli/isometric_image.go"},"region":{"startLine":156}}}],"partialFingerprints":{"codehealthFindingId/v1":"3721bf2968618f84f22dc04fcdcb45a8db5c58b9e4dc8eb07f7e2eec4aa8233d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): d2ir/pattern.go:74-81 | d2ir/pattern.go:109-116 \u2014 both copies are in the same file, so extract the block 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/pattern.go:74\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/pattern.go"},"region":{"startLine":74}}}],"partialFingerprints":{"codehealthFindingId/v1":"a2f055033a68bc04d17f792275a20daf57ee3000265877ebdff75cfe1e3912c8"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): d2layouts/d2talalayout/internal/layoutgraph/edge.go:388-397 | d2layouts/d2talalayout/internal/layoutgraph/edge.go:402-411 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/layoutgraph/edge.go:388\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/d2talalayout/internal/layoutgraph/edge.go"},"region":{"startLine":388}}}],"partialFingerprints":{"codehealthFindingId/v1":"de0e4df7d6efe76a32e77c88f562a417c099b3f7bd56f01fb806bdcaee3e2d78"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): d2layouts/d2talalayout/internal/layoutgraph/topology_preflight.go:172-179 | d2layouts/d2talalayout/internal/layoutgraph/topology_preflight.go:549-556 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/layoutgraph/topology_preflight.go"},"region":{"startLine":172}}}],"partialFingerprints":{"codehealthFindingId/v1":"41ffd6b13d652344b0de97978ec8cd9f228c41120d06056edfbffd0d39676bc6"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): d2layouts/d2talalayout/internal/layoutgraph/transaction_snapshot.go:26-33 | d2layouts/d2talalayout/internal/packing/combine.go:21-28 \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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any \u0060return\u0060 inside it is the body\u0027s own exit and keeps its meaning in the moved unit."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/transaction_snapshot.go"},"region":{"startLine":26}}}],"partialFingerprints":{"codehealthFindingId/v1":"6bf5b5e86fd2df90765ae1844a352da1cb5aeb7db5737fa4f9634c850f6d4054"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): d2layouts/d2talalayout/internal/placement/sized_optimizer.go:126-133 | d2layouts/d2talalayout/internal/placement/sizeless_optimizer.go:40-47 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2layouts/d2talalayout/internal/placement/sized_optimizer.go:126\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/d2talalayout/internal/placement/sized_optimizer.go"},"region":{"startLine":126}}}],"partialFingerprints":{"codehealthFindingId/v1":"bd930d0c8e96d94ef03bd06826f9efa5a0edeafa60855ce1226c929a792f5e16"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): d2layouts/d2talalayout/internal/routing/balance_route_guard.go:56-63 | d2layouts/d2talalayout/internal/routing/standalone_route_guard.go:162-169 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2layouts/d2talalayout/internal/routing/balance_route_guard.go:56\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":"d2layouts/d2talalayout/internal/routing/balance_route_guard.go"},"region":{"startLine":56}}}],"partialFingerprints":{"codehealthFindingId/v1":"6209a033db50d90b7bc6d451288036c2288a77ec29374c4481feae85bdc5eed3"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): d2layouts/d2talalayout/internal/routing/ovg_hierarchy.go:62-69 | d2layouts/d2talalayout/internal/routing/ovg_hierarchy.go:71-78 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/routing/ovg_hierarchy.go"},"region":{"startLine":62}}}],"partialFingerprints":{"codehealthFindingId/v1":"7879de36ec2817e5885f8d5e1d0bea1b47fe7ee93a5b199980e7b283764dbfa0"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): d2layouts/d2talalayout/internal/routing/ovg_hierarchy.go:87-94 | d2layouts/d2talalayout/internal/routing/ovg_hierarchy.go:96-103 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/routing/ovg_hierarchy.go"},"region":{"startLine":87}}}],"partialFingerprints":{"codehealthFindingId/v1":"e8c17254d13b087dc9cb49fab6c5a6e00c04e00885032b951f5b33d1dc57ebb6"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): d2renderers/d2fonts/bundled_fallback.go:286-293 | d2renderers/d2fonts/fallback.go:286-293 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any \u0060return\u0060 inside it is the body\u0027s own exit and keeps its meaning in the moved unit."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2fonts/bundled_fallback.go"},"region":{"startLine":286}}}],"partialFingerprints":{"codehealthFindingId/v1":"b8aa5aabfbae5eee2faeb5221977a030f9094a76e7cd5720fbe64c015829657a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): d2renderers/d2raster/effects.go:1363-1372 | d2renderers/d2raster/effects.go:1376-1385 \u2014 both copies are in the same file, so extract the block 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/d2raster/effects.go:1363\u0060 it runs out through the closing brace of the declaration holding it \u2014 the window is that declaration\u0027s tail, not a fragment that begins part-way through something, so those exact 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/d2raster/effects.go"},"region":{"startLine":1363}}}],"partialFingerprints":{"codehealthFindingId/v1":"1ef3023e55e37b40f84efbc7fb04c308404d2a22a9480cfd05a21eed6a37f83e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): d2renderers/d2raster/effects.go:1848-1855 | lib/xgif/xgif.go:1431-1438 \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 \u0060d2renderers/d2raster/effects.go:1848\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/d2raster/effects.go"},"region":{"startLine":1848}}}],"partialFingerprints":{"codehealthFindingId/v1":"e911e38dfc3942f6a25b3e2d1dcdc6cc055445f8dd6d061790e26a7e95adf236"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): d2renderers/d2raster/filter.go:789-796 | d2renderers/d2raster/filter.go:816-823 \u2014 both copies are in the same file, so extract the block 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/d2raster/filter.go:789\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/d2raster/filter.go"},"region":{"startLine":789}}}],"partialFingerprints":{"codehealthFindingId/v1":"816ae23a06f6fc1e3cc33f5134a5283356a5f58765a812b6f2843cf1adfc4a24"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (2\u20138 lines \u00D7 3): d2renderers/d2raster/gradient.go:771-778 | d2renderers/d2raster/gradient.go:1071-1078 | d2renderers/d2raster/pattern.go:286-287 \u2014 there are 3 copies across 2 file(s) \u2014 more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2renderers/d2raster/gradient.go:771\u0060 it runs out through the closing brace of the declaration holding it \u2014 the window is that declaration\u0027s tail, not a fragment that begins part-way through something, so those exact 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/d2raster/gradient.go"},"region":{"startLine":771}}}],"partialFingerprints":{"codehealthFindingId/v1":"92ae5a39ef6a52bedfea738197af812f3c9fe412cafe9ff237c695a1182fa003"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (2\u20138 lines \u00D7 4): d2renderers/d2raster/internal/scanline/rasterizer.go:521-528 | d2renderers/d2raster/internal/scanline/rasterizer.go:593-600 | d2renderers/d2raster/internal/scanline/rasterizer.go:631-632 | d2renderers/d2raster/internal/scanline/rasterizer.go:700-701 \u2014 all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites \u2014 resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2renderers/d2raster/internal/scanline/rasterizer.go:521\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/d2raster/internal/scanline/rasterizer.go"},"region":{"startLine":521}}}],"partialFingerprints":{"codehealthFindingId/v1":"2cd300814baffca565a28b4144817b9055b192418f50a47d9d1133ab46dabaa9"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): d2renderers/d2raster/session.go:210-217 | d2renderers/d2raster/session.go:235-242 \u2014 both copies are in the same file, so extract the block 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/d2raster/session.go:210\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. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, \u0060d2renderers/d2raster/session.go:243\u0060 calls \u0060releaseLoad\u0060 and \u0060d2renderers/d2raster/session.go:218\u0060 does not \u2014 after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/session.go"},"region":{"startLine":210}}}],"partialFingerprints":{"codehealthFindingId/v1":"b2e1810f0687162063b4d4c9ed5ffcdebe8ed5ec5cc2948524fe5eba28fead76"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): d2renderers/d2raster/session.go:345-352 | d2renderers/d2raster/session.go:372-379 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2renderers/d2raster/session.go:345\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. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, \u0060d2renderers/d2raster/session.go:380\u0060 calls \u0060releaseLoad\u0060 and \u0060d2renderers/d2raster/session.go:353\u0060 does not \u2014 after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/session.go"},"region":{"startLine":345}}}],"partialFingerprints":{"codehealthFindingId/v1":"3f7c5602a8f9723731e49d8727550cb539db74e7c60af637555af357e4afbc63"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): d2renderers/d2scenebuild/build.go:872-879 | d2renderers/d2scenebuild/build.go:910-917 \u2014 both copies are in the same file, so extract the block 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/d2scenebuild/build.go:872\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":"d2renderers/d2scenebuild/build.go"},"region":{"startLine":872}}}],"partialFingerprints":{"codehealthFindingId/v1":"87dc7ff53e5a81b8b0b0cc864cb6475ceb3aaedc974de575637ac2fcaaaed79c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): d2renderers/d2scenebuild/metadata.go:106-114 | d2renderers/d2scenebuild/metadata.go:132-140 \u2014 both copies are in the same file, so extract the block 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":"d2renderers/d2scenebuild/metadata.go"},"region":{"startLine":106}}}],"partialFingerprints":{"codehealthFindingId/v1":"2c02f3108df848f120ac35b0f9c6ede9389532e12baa78f5a8c2c73fb995f85f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): d2renderers/d2scenebuild/shape_effects.go:261-268 | d2renderers/d2scenebuild/sketch_shapes.go:481-488 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2renderers/d2scenebuild/shape_effects.go:261\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":"d2renderers/d2scenebuild/shape_effects.go"},"region":{"startLine":261}}}],"partialFingerprints":{"codehealthFindingId/v1":"d80f486976917b53d708eb1154b84314180d5cab50db50203db5f0bf1e13a739"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): d2renderers/d2scenebuild/sketch_shapes.go:110-117 | d2renderers/d2scenebuild/sketch_shapes.go:563-570 \u2014 both copies are in the same file, so extract the block 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/d2scenebuild/sketch_shapes.go"},"region":{"startLine":110}}}],"partialFingerprints":{"codehealthFindingId/v1":"8074e81ceae9b79f4c646018429483e5b51a9ec6ce43e994fd9ab2b3d2ea6816"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): d2renderers/d2svg/d2svg.go:1477-1484 | d2renderers/d2svg/d2svg.go:1597-1604 \u2014 both copies are in the same file, so extract the block 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":1477}}}],"partialFingerprints":{"codehealthFindingId/v1":"7ca712c128a8c27f53ba3aff69e3e01c92b2ed4398df009c68dc8b8cdbf30b65"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): d2renderers/d2svgimport/geometry.go:95-102 | d2renderers/d2svgimport/geometry.go:109-116 \u2014 both copies are in the same file, so extract the block 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":"d2renderers/d2svgimport/geometry.go"},"region":{"startLine":95}}}],"partialFingerprints":{"codehealthFindingId/v1":"5c34a1aca2693a101286b47d3bd755a97fe6968cc5fa15a1982bdbe5822bf411"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): d2renderers/d2svgimport/path.go:211-221 | d2renderers/d2svgimport/path.go:226-236 \u2014 both copies are in the same file, so extract the block 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":"d2renderers/d2svgimport/path.go"},"region":{"startLine":211}}}],"partialFingerprints":{"codehealthFindingId/v1":"87d3e66a88b863ba84e886d2d2b834dd84903149c34ffbf60067c61f2557fce5"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): d2renderers/d2svgimport/stylesheet.go:93-100 | d2renderers/d2svgimport/stylesheet.go:117-124 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2renderers/d2svgimport/stylesheet.go:93\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svgimport/stylesheet.go"},"region":{"startLine":93}}}],"partialFingerprints":{"codehealthFindingId/v1":"e0852e77e4e94ed904eba9f71d0e217f8f7fa9914049f10180dfe8f74b6004bf"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): d2renderers/internal/fontface/face.go:197-204 | d2renderers/internal/fontface/face.go:418-425 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. 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/internal/fontface/face.go"},"region":{"startLine":197}}}],"partialFingerprints":{"codehealthFindingId/v1":"94bab75ec3cb4b250a593ec0d0aa52a942471ab44971eb65f3fdfd59f560158b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): lib/shape/shape_circle.go:26-33 | lib/shape/shape_oval.go:28-35 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any \u0060return\u0060 inside it is the body\u0027s own exit and keeps its meaning in the moved unit."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/shape/shape_circle.go"},"region":{"startLine":26}}}],"partialFingerprints":{"codehealthFindingId/v1":"a745fdbc4b9ae10ecf08ef47a0fbbe7c3029e2e53083a3ff593fae53b253f968"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11\u201313 lines \u00D7 2): lib/xgif/xgif.go:949-959 | lib/xgif/xgif.go:1014-1026 \u2014 both copies are in the same file, so extract the block 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":"lib/xgif/xgif.go"},"region":{"startLine":949}}}],"partialFingerprints":{"codehealthFindingId/v1":"d871432a8e1f65baf65512d42a1f1dff005b45a21af4ee4b3a0533bfbec75ba3"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 10): d2renderers/d2raster/image.go:636-642 | d2renderers/d2raster/image.go:667-673 | d2renderers/d2raster/image.go:694-700 | d2renderers/d2raster/image.go:721-727 | d2renderers/d2raster/image.go:756-762 | d2renderers/d2raster/image.go:790-796 | d2renderers/d2raster/image.go:825-831 | d2renderers/d2raster/image.go:853-859 | d2renderers/d2raster/image.go:885-891 | d2renderers/d2raster/image.go:915-921 \u2014 all 10 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/d2raster/image.go:636\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/d2raster/image.go"},"region":{"startLine":636}}}],"partialFingerprints":{"codehealthFindingId/v1":"956b99ad8aefd7181b6884872afcf04d175f4bfd3e31906a0eba21ac428c907c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 9): d2renderers/d2raster/effects.go:1397-1403 | d2renderers/d2raster/effects.go:1468-1474 | d2renderers/d2raster/effects.go:1518-1524 | d2renderers/d2raster/effects.go:1692-1698 | d2renderers/d2raster/effects.go:1772-1778 | d2renderers/d2raster/effects.go:1850-1856 | lib/xgif/xgif.go:1380-1386 | lib/xgif/xgif.go:1404-1410 | lib/xgif/xgif.go:1433-1439 \u2014 there are 9 copies across 2 file(s) \u2014 more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 9 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2renderers/d2raster/effects.go:1397\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. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, \u0060d2renderers/d2raster/effects.go:1516\u0060 calls \u0060compositeBlendLayerOpaquePrefix\u0060, \u0060Bounds\u0060, \u0060Intersect\u0060 and \u0060d2renderers/d2raster/effects.go:1849\u0060 does not \u2014 after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/effects.go"},"region":{"startLine":1397}}}],"partialFingerprints":{"codehealthFindingId/v1":"b6bddab3db1e1065aa02ea1e4a1c09506ff07a25549d12b11bb1d632f14b3eab"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 7): d2layouts/d2talalayout/internal/trees/geometry.go:253-259 | d2layouts/d2talalayout/internal/trees/geometry.go:294-300 | d2layouts/d2talalayout/internal/trees/geometry.go:681-687 | d2layouts/d2talalayout/internal/trees/geometry.go:722-728 | d2layouts/d2talalayout/internal/trees/geometry.go:776-782 | d2layouts/d2talalayout/internal/trees/geometry.go:810-816 | d2layouts/d2talalayout/internal/trees/preprocess_helpers.go:583-589 \u2014 there are 7 copies across 2 file(s) \u2014 more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 7 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2layouts/d2talalayout/internal/trees/geometry.go:253\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/d2talalayout/internal/trees/geometry.go"},"region":{"startLine":253}}}],"partialFingerprints":{"codehealthFindingId/v1":"3d5d11541c9ecaf59780811b43f4d84f285f8acab84a1828d333858d7740836c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 7): d2renderers/d2raster/image.go:592-599 | d2renderers/d2raster/image.go:613-620 | d2renderers/d2raster/image.go:754-761 | d2renderers/d2raster/image.go:788-795 | d2renderers/d2raster/image.go:823-830 | d2renderers/d2raster/image.go:851-858 | d2renderers/d2raster/image.go:883-890 \u2014 all 7 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/d2raster/image.go:592\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/d2raster/image.go"},"region":{"startLine":592}}}],"partialFingerprints":{"codehealthFindingId/v1":"1d430f92864b06fc5e30e09f7c62bfe5a79c4cab49eb00293727e51869f44a81"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 5): d2renderers/d2svgimport/boilerplate.go:128-134 | d2renderers/d2svgimport/clip.go:92-98 | d2renderers/d2svgimport/compile.go:67-73 | d2renderers/d2svgimport/gradient.go:244-250 | d2renderers/d2svgimport/stylesheet.go:17-23 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from all 5 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2renderers/d2svgimport/boilerplate.go:128\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. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, \u0060d2renderers/d2svgimport/clip.go:91\u0060 calls \u0060compileClipPathResources\u0060 and \u0060d2renderers/d2svgimport/boilerplate.go:127\u0060 does not \u2014 after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svgimport/boilerplate.go"},"region":{"startLine":128}}}],"partialFingerprints":{"codehealthFindingId/v1":"e447308533325d835d7746a67e8bcfe615b2dd0f8519c558e4ecfadc53a7d2c5"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6\u20137 lines \u00D7 4): d2layouts/d2talalayout/internal/hierarchy/brandes_kopf.go:377-382 | d2layouts/d2talalayout/internal/hierarchy/brandes_kopf.go:384-389 | d2layouts/d2talalayout/internal/hierarchy/brandes_kopf.go:391-396 | d2layouts/d2talalayout/internal/hierarchy/brandes_kopf.go:398-404 \u2014 all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites \u2014 resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2layouts/d2talalayout/internal/hierarchy/brandes_kopf.go:398\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/d2talalayout/internal/hierarchy/brandes_kopf.go"},"region":{"startLine":377}}}],"partialFingerprints":{"codehealthFindingId/v1":"906678b5ce8c1b18753a295f0d30b9f2460f7653d8b2d1d15b18f08f911cfc6a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 3): d2layouts/d2dagrelayout/layout.go:594-600 | d2layouts/d2elklayout/layout.go:1170-1176 | d2layouts/d2grid/layout.go:208-214 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2layouts/d2dagrelayout/layout.go:594\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2dagrelayout/layout.go"},"region":{"startLine":594}}}],"partialFingerprints":{"codehealthFindingId/v1":"3c6587ac6ca4a7ac504bdfce04547b5e384ab8c167930bbf5d5a4e6d900b18df"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 3): d2layouts/d2talalayout/internal/graphbounds/bounds.go:59-65 | d2layouts/d2talalayout/internal/labeling/guard.go:335-341 | d2layouts/d2talalayout/internal/layoutgraph/node.go:101-107 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2layouts/d2talalayout/internal/graphbounds/bounds.go:59\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/d2talalayout/internal/graphbounds/bounds.go"},"region":{"startLine":59}}}],"partialFingerprints":{"codehealthFindingId/v1":"52b0f23582ed8bd4467edfc039fb9cf2b2daba495339143aeb0329e427d7788e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 3): d2layouts/d2talalayout/internal/nodeshape/shape_c4person.go:83-89 | d2layouts/d2talalayout/internal/nodeshape/shape_package.go:117-123 | d2layouts/d2talalayout/internal/nodeshape/shape_square.go:84-90 \u2014 before extracting anything, compare \u0060d2layouts/d2talalayout/internal/nodeshape/shape_c4person.go\u0060 and \u0060d2layouts/d2talalayout/internal/nodeshape/shape_package.go\u0060 as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 66 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2layouts/d2talalayout/internal/nodeshape/shape_c4person.go:83\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":"d2layouts/d2talalayout/internal/nodeshape/shape_c4person.go"},"region":{"startLine":83}}}],"partialFingerprints":{"codehealthFindingId/v1":"2c8b9d83551f5744aae7a8c02ca3dbeddf854f58890edcf7811fe544a0c2cfbc"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 3): d2layouts/d2talalayout/internal/nodeshape/shape_callout.go:107-113 | d2layouts/d2talalayout/internal/nodeshape/shape_package.go:121-127 | d2layouts/d2talalayout/internal/nodeshape/shape_square.go:88-94 \u2014 before extracting anything, compare \u0060d2layouts/d2talalayout/internal/nodeshape/shape_callout.go\u0060 and \u0060d2layouts/d2talalayout/internal/nodeshape/shape_package.go\u0060 as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 94 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2layouts/d2talalayout/internal/nodeshape/shape_callout.go:107\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. 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":"d2layouts/d2talalayout/internal/nodeshape/shape_callout.go"},"region":{"startLine":107}}}],"partialFingerprints":{"codehealthFindingId/v1":"ccbb50b311070368c044dad570bf5f2050ab60e49dab8ac9904761ab689ce2a5"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (3\u20137 lines \u00D7 4): d2renderers/d2ascii/asciishapes/helpers.go:25-31 | d2renderers/d2ascii/asciishapes/package.go:16-22 | d2renderers/d2ascii/asciishapes/page.go:23-29 | d2renderers/d2ascii/asciishapes/rectangle.go:31-33 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from all 4 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2renderers/d2ascii/asciishapes/helpers.go:25\u0060 it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows \u2014 the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members\u0027 bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run \u2014 a one-line delegation has no helper inside it to lift \u2014 so generate the run from the set it enumerates, or accept it and keep each member\u0027s own documentation with 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. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, \u0060d2renderers/d2ascii/asciishapes/package.go:14\u0060 calls \u0060Sprintf\u0060, \u0060TopRightCorner\u0060, \u0060BottomLeftCorner\u0060 and \u0060d2renderers/d2ascii/asciishapes/helpers.go:24\u0060 does not \u2014 after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2ascii/asciishapes/helpers.go"},"region":{"startLine":25}}}],"partialFingerprints":{"codehealthFindingId/v1":"4b2b70cb5f6bc24e9e99c7f43aa8bc71040604dc575e66da00ca7dea9632d25c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 3): d2renderers/d2raster/image.go:183-195 | d2renderers/d2svgimport/image.go:326-338 | lib/imageasset/probe.go:380-392 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 and call it from each site; until then, every change has to be made 3 times. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any \u0060return\u0060 inside it is the body\u0027s own exit and keeps its meaning in the moved unit."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/image.go"},"region":{"startLine":183}}}],"partialFingerprints":{"codehealthFindingId/v1":"5007beff11db1024b7e5c8ab2621ca61b795eaef721fcf04eeb026f4b3e339a8"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): d2ir/compile.go:293-299 | d2ir/compile.go:333-339 \u2014 both copies are in the same file, so extract the block 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:293\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. 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":293}}}],"partialFingerprints":{"codehealthFindingId/v1":"5df6ae4cd55dab0d7de90bcd35acd250e05efb9d78fd87d79186ec83238b2e3c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): d2ir/compile.go:673-679 | d2ir/compile.go:756-762 \u2014 both copies are in the same file, so extract the block 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:673\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":673}}}],"partialFingerprints":{"codehealthFindingId/v1":"82b43efafd342a4e08cac5bd4a41d7ab6ef57b2892533226275d1cba8bd12496"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): d2ir/import_cache.go:54-60 | d2ir/import_cache.go:99-105 \u2014 both copies are in the same file, so extract the block 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_cache.go:54\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/import_cache.go"},"region":{"startLine":54}}}],"partialFingerprints":{"codehealthFindingId/v1":"7fae77fce1ee924cb2d94f885496995fe557c8bc5db6d431be1660b3065b6777"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): d2js/d2wasm/functions.go:580-586 | d2js/d2wasm/functions.go:640-646 \u2014 both copies are in the same file, so extract the block 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":"d2js/d2wasm/functions.go"},"region":{"startLine":580}}}],"partialFingerprints":{"codehealthFindingId/v1":"7467d04aba6d8620ced73c891bc3c8ab5997d6dadda726919fb5138d87bd00cb"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): d2layouts/d2dagrelayout/layout.go:801-808 | d2layouts/d2elklayout/descendant_shifter.go:38-45 \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:801\u0060 it runs out through the closing brace of the declaration holding it \u2014 the window is that declaration\u0027s tail, not a fragment that begins part-way through something, so those exact 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 \u0060return\u0060 at the foot of the matched lines is the enclosing body\u0027s own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that \u0060return\u0060 occupied \u2014 no decision has to be handed back and re-acted on."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2dagrelayout/layout.go"},"region":{"startLine":801}}}],"partialFingerprints":{"codehealthFindingId/v1":"039a40b79aea54cdf606eeaacd0bdf238b7e6b0d90a14be77ae26f846def3825"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): d2layouts/d2talalayout/internal/graphbounds/bounds.go:146-152 | d2layouts/d2talalayout/internal/routing/ovg_resource.go:401-407 \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/d2talalayout/internal/graphbounds/bounds.go:146\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/d2talalayout/internal/graphbounds/bounds.go"},"region":{"startLine":146}}}],"partialFingerprints":{"codehealthFindingId/v1":"66c3988d40dff05e9f5efd54f3d2e65878b665f6ac50a14d73960b4b0ffb67a9"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): d2layouts/d2talalayout/internal/graphjson/codec.go:156-162 | d2layouts/d2talalayout/internal/graphjson/codec.go:209-215 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/graphjson/codec.go:156\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/d2talalayout/internal/graphjson/codec.go"},"region":{"startLine":156}}}],"partialFingerprints":{"codehealthFindingId/v1":"8b7eb8fbdd0841908efb126fc3cbf877abcae9b1cc99cb2fa75dfe4acbaf1ff1"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): d2layouts/d2talalayout/internal/graphjson/codec.go:1170-1176 | d2layouts/d2talalayout/internal/graphjson/codec.go:1243-1249 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/graphjson/codec.go:1170\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/d2talalayout/internal/graphjson/codec.go"},"region":{"startLine":1170}}}],"partialFingerprints":{"codehealthFindingId/v1":"beeee786e6f7bef830280600f159389a6fbd3a0705e1e24f633398ccac82c5b9"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): d2layouts/d2talalayout/internal/layoutgraph/graph.go:975-981 | d2layouts/d2talalayout/internal/layoutgraph/graph.go:984-990 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/layoutgraph/graph.go:975\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/d2talalayout/internal/layoutgraph/graph.go"},"region":{"startLine":975}}}],"partialFingerprints":{"codehealthFindingId/v1":"62280e9d5c481b610adbe48e5b0b11715f9212f03862c6a7786c9e35dc356da6"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): d2layouts/d2talalayout/internal/packing/binpack.go:108-114 | d2layouts/d2talalayout/internal/packing/binpack.go:200-206 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/packing/binpack.go:108\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. 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":"d2layouts/d2talalayout/internal/packing/binpack.go"},"region":{"startLine":108}}}],"partialFingerprints":{"codehealthFindingId/v1":"dabe2342dce4d6a1f292c62939eed6b7a9ca86543b27f5d8d124fdcea53d2866"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): d2layouts/d2talalayout/internal/placement/sizeless_optimizer.go:513-519 | d2layouts/d2talalayout/internal/placement/sizeless_optimizer.go:522-528 \u2014 both copies are in the same file, so extract the block 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":"d2layouts/d2talalayout/internal/placement/sizeless_optimizer.go"},"region":{"startLine":513}}}],"partialFingerprints":{"codehealthFindingId/v1":"87e1a643f09b1736cffb3fb33d92b4d2de88f70215d11fc00db27c0b98748105"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): d2layouts/d2talalayout/internal/routing/standalone_route_guard.go:305-311 | d2layouts/d2talalayout/internal/routing/standalone_route_guard.go:313-319 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/routing/standalone_route_guard.go:305\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/d2talalayout/internal/routing/standalone_route_guard.go"},"region":{"startLine":305}}}],"partialFingerprints":{"codehealthFindingId/v1":"6711ebbde07c6d91d6f14c70cb1f76bdb36f34da44c5640038d48f5df47e18c6"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): d2layouts/d2talalayout/internal/routing/tunnel.go:302-308 | d2layouts/d2talalayout/internal/routing/tunnel.go:332-338 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/routing/tunnel.go:302\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/d2talalayout/internal/routing/tunnel.go"},"region":{"startLine":302}}}],"partialFingerprints":{"codehealthFindingId/v1":"f22dde48e967a66d56a49e83ce6dfeedd5acc84ae978ba41f21083f64c53b777"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): d2oracle/edit.go:1192-1198 | d2oracle/edit.go:2040-2046 \u2014 both copies are in the same file, so extract the block 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:1192\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":1192}}}],"partialFingerprints":{"codehealthFindingId/v1":"d6acbb3c971f9790b7e4888ceb61adc2606dd9415130f47abc6f2cb762ad0a35"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): d2oracle/edit.go:1237-1244 | d2oracle/edit.go:1256-1262 \u2014 both copies are in the same file, so extract the block 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:1237\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":1237}}}],"partialFingerprints":{"codehealthFindingId/v1":"d7e19c90acc67eea7d7ca36564c635af88918f686f54f63da56dd31b6ec3b06f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): d2renderers/d2fonts/bundled_fallback.go:296-302 | d2renderers/d2scenebuild/font_fallback.go:899-905 \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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any \u0060return\u0060 inside it is the body\u0027s own exit and keeps its meaning in the moved unit."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2fonts/bundled_fallback.go"},"region":{"startLine":296}}}],"partialFingerprints":{"codehealthFindingId/v1":"26a5b24e3069d218e7fd356b182d403531cc5f9459cd7518cac46c8f41842b5b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): d2renderers/d2raster/effects.go:1486-1492 | d2renderers/d2raster/effects.go:1598-1604 \u2014 both copies are in the same file, so extract the block 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/d2raster/effects.go:1486\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/d2raster/effects.go"},"region":{"startLine":1486}}}],"partialFingerprints":{"codehealthFindingId/v1":"4baf0e80ff76139159da63aee37c3a6f79bad1f8c23c4732e30b6e45a6429d81"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): d2renderers/d2raster/filter.go:656-662 | d2renderers/d2raster/filter.go:841-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. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2renderers/d2raster/filter.go:656\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/d2raster/filter.go"},"region":{"startLine":656}}}],"partialFingerprints":{"codehealthFindingId/v1":"97116204daa4aafdfc6203dc827917f23f9732fe1e8131b68fbb889f53d59bcd"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): d2renderers/d2raster/gradient.go:595-607 | d2renderers/d2raster/gradient.go:628-640 \u2014 both copies are in the same file, so extract the block 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/d2raster/gradient.go:595\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/d2raster/gradient.go"},"region":{"startLine":595}}}],"partialFingerprints":{"codehealthFindingId/v1":"23726c8f946d6e356ae3908b477dc82032561feadb3a02dd1a601a73aa1bd21c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): d2renderers/d2raster/raster.go:1633-1640 | d2renderers/d2scene/primitive.go:261-268 \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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any \u0060return\u0060 inside it is the body\u0027s own exit and keeps its meaning in the moved unit."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/raster.go"},"region":{"startLine":1633}}}],"partialFingerprints":{"codehealthFindingId/v1":"caeec7c6efb71865935d3c372ee1d235548abaa6854aa4191ed8b980ef37e108"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): d2renderers/d2raster/vector_validation.go:906-912 | d2renderers/d2raster/vector_validation.go:914-920 \u2014 both copies are in the same file, so extract the block 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/d2raster/vector_validation.go"},"region":{"startLine":906}}}],"partialFingerprints":{"codehealthFindingId/v1":"9020baed8b32c48b5dc4157ddfbae85618adacbab44ffc194447ac154bf8ece5"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): d2renderers/d2sketch/sketch.go:391-397 | d2renderers/d2sketch/sketch.go:400-406 \u2014 both copies are in the same file, so extract the block 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":391}}}],"partialFingerprints":{"codehealthFindingId/v1":"a7c2464dee3530b44beca7e0be3d8b62e619e6dbe8f891e312cefe679db33ecf"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): d2renderers/d2sketch/sketch.go:455-461 | d2renderers/d2svg/table.go:131-137 \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":455}}}],"partialFingerprints":{"codehealthFindingId/v1":"33b02a887c6776154ae442546ed1bf6c65edca535973c74555c7380e4f1e7a88"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): d2renderers/d2svg/class.go:93-99 | d2renderers/d2svg/table.go:116-122 \u2014 before extracting anything, compare \u0060d2renderers/d2svg/class.go\u0060 and \u0060d2renderers/d2svg/table.go\u0060 as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svg/class.go"},"region":{"startLine":93}}}],"partialFingerprints":{"codehealthFindingId/v1":"ba78f76851d6e2d69c119e4534df626c680dbb45b10210715c40718af95e0e96"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): d2renderers/d2svg/d2svg.go:628-634 | d2renderers/d2svg/d2svg.go:750-756 \u2014 both copies are in the same file, so extract the block 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:628\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":628}}}],"partialFingerprints":{"codehealthFindingId/v1":"a7da12c0e6fa77a715c15f8f60f0e1d64daafe502613dedb4e84f6d125991868"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7\u20138 lines \u00D7 2): d2renderers/d2svg/d2svg.go:1081-1088 | d2renderers/d2svg/d2svg.go:1711-1717 \u2014 both copies are in the same file, so extract the block 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":1081}}}],"partialFingerprints":{"codehealthFindingId/v1":"36e15f2fb5a31eaa53d98bf9994ad1c4276f4bd444719afc6745df782ad17a01"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): d2renderers/d2svg/d2svg.go:1843-1849 | d2renderers/d2svg/d2svg.go:1880-1886 \u2014 both copies are in the same file, so extract the block 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:1843\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":1843}}}],"partialFingerprints":{"codehealthFindingId/v1":"a000fab43a24210e16fba8b54a06b0afaf0dd45543ea4f17b812a6b878c3149d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 6): d2renderers/d2raster/gradient.go:693-698 | d2renderers/d2raster/gradient.go:738-743 | d2renderers/d2raster/gradient.go:807-812 | d2renderers/d2raster/gradient.go:851-856 | d2renderers/d2raster/gradient.go:895-900 | d2renderers/d2raster/gradient.go:935-940 \u2014 all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites \u2014 resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2renderers/d2raster/gradient.go:693\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. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, \u0060d2renderers/d2raster/gradient.go:744\u0060 calls \u0060wrapped\u0060 and \u0060d2renderers/d2raster/gradient.go:699\u0060 does not \u2014 after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/gradient.go"},"region":{"startLine":693}}}],"partialFingerprints":{"codehealthFindingId/v1":"a28226f6882369a2dad3802485d81f1bb7e8469eb655eb2f7b58450b8538c60b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 6): d2renderers/d2sketch/sketch.go:73-78 | d2renderers/d2sketch/sketch.go:123-128 | d2renderers/d2sketch/sketch.go:183-188 | d2renderers/d2sketch/sketch.go:239-244 | d2renderers/d2sketch/sketch.go:444-449 | d2renderers/d2sketch/sketch.go:577-582 \u2014 all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites \u2014 resolving only two of them leaves the rest to drift apart the first time one is edited. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, \u0060d2renderers/d2sketch/sketch.go:80\u0060 calls \u0060FromString\u0060, \u0060IsBorder\u0060, \u0060SetMaskID\u0060 and \u0060d2renderers/d2sketch/sketch.go:450\u0060 does not \u2014 after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2sketch/sketch.go"},"region":{"startLine":73}}}],"partialFingerprints":{"codehealthFindingId/v1":"82b3224b79bb260c9966e557dcb1f8cdd38553de3dd673029439a923a5954cb2"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): d2cli/paged.go:303-308 | d2renderers/d2raster/raster.go:697-703 \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 \u0060d2cli/paged.go:303\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/paged.go"},"region":{"startLine":303}}}],"partialFingerprints":{"codehealthFindingId/v1":"4aca70157a7c01ae60f6330e9ee619d8e644f62bd169692ef0580151833f715f"}},{"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. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, \u0060d2exporter/export.go:395\u0060 calls \u0060GetStroke\u0060 and \u0060d2exporter/export.go:159\u0060 does not \u2014 after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2exporter/export.go"},"region":{"startLine":153}}}],"partialFingerprints":{"codehealthFindingId/v1":"68d2695f2877bdd09f63f2b9f8a4be35117960a9e3fcc369ee6aaa48eed12115"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): d2layouts/d2dagrelayout/layout.go:1142-1147 | d2layouts/d2dagrelayout/layout.go:1184-1189 \u2014 both copies are in the same file, so extract the block 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:1142\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":1142}}}],"partialFingerprints":{"codehealthFindingId/v1":"54a0257548909897e34b235130477f74ba127ebd5dddbddd56bf157740282097"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): d2layouts/d2elklayout/layout.go:860-865 | d2layouts/d2elklayout/layout.go:964-969 \u2014 both copies are in the same file, so extract the block 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":860}}}],"partialFingerprints":{"codehealthFindingId/v1":"dddc9ecc8b65aa9546218e38d6de82dec4c541a47cdbf30b633c0a245464dbe2"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): d2layouts/d2elklayout/layout.go:968-973 | d2layouts/d2elklayout/layout.go:975-980 \u2014 both copies are in the same file, so extract the block 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":968}}}],"partialFingerprints":{"codehealthFindingId/v1":"2c153a3e6ee893989f73c3364c6c90f63c07870deee79c72647585a895611c52"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7\u20138 lines \u00D7 2): d2layouts/d2talalayout/internal/layoutgraph/graph.go:520-527 | d2layouts/d2talalayout/internal/routing/route_stage_guard.go:448-454 \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/d2talalayout/internal/layoutgraph/graph.go:520\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/d2talalayout/internal/layoutgraph/graph.go"},"region":{"startLine":520}}}],"partialFingerprints":{"codehealthFindingId/v1":"2fca074db3538cf9e5f1508d28f1932096002ab332e6ebc8dfba09b3467f0e8f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): d2layouts/d2talalayout/internal/placement/dejitter.go:232-237 | d2layouts/d2talalayout/internal/placement/dejitter.go:282-287 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/placement/dejitter.go:232\u0060 it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows \u2014 the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members\u0027 bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run \u2014 a one-line delegation has no helper inside it to lift \u2014 so generate the run from the set it enumerates, or accept it and keep each member\u0027s own documentation with it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/dejitter.go"},"region":{"startLine":232}}}],"partialFingerprints":{"codehealthFindingId/v1":"1a6f0c53cb4975a5f33afe70f36974c600b2e1200f7ff2b6ed66debd254360eb"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): d2layouts/d2talalayout/internal/placement/node_placement.go:317-323 | d2layouts/d2talalayout/internal/placement/node_placement.go:408-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. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2layouts/d2talalayout/internal/placement/node_placement.go:317\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/node_placement.go"},"region":{"startLine":317}}}],"partialFingerprints":{"codehealthFindingId/v1":"5979291cf324669ad33385ac67fa1f0ce9d0c21f690701427ef61f9d63b0157e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11\u201313 lines \u00D7 2): d2layouts/d2talalayout/internal/placement/optimization_guard.go:476-486 | d2layouts/d2talalayout/internal/placement/optimizer_spatial_index.go:333-345 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2layouts/d2talalayout/internal/placement/optimization_guard.go:476\u0060 it runs out through the closing brace of the declaration holding it \u2014 the window is that declaration\u0027s tail, not a fragment that begins part-way through something, so those exact 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/d2talalayout/internal/placement/optimization_guard.go"},"region":{"startLine":476}}}],"partialFingerprints":{"codehealthFindingId/v1":"2247a2cba0e2d24656dc7bb6ca0ad4ee8d1ecbdd1888a9e36a86741e60fc1e7e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): d2layouts/d2talalayout/internal/placement/optimization_guard.go:751-757 | d2layouts/d2talalayout/internal/placement/optimization_guard.go:1064-1070 \u2014 both copies are in the same file, so extract the block 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":"d2layouts/d2talalayout/internal/placement/optimization_guard.go"},"region":{"startLine":751}}}],"partialFingerprints":{"codehealthFindingId/v1":"6fa6304a1d12b8fe33bdfe71808170a6df0594b5ddd371e566234a34d204ca04"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): d2layouts/d2talalayout/internal/placement/sizeless_optimizer.go:481-487 | d2layouts/d2talalayout/internal/placement/sizeless_optimizer.go:502-508 \u2014 both copies are in the same file, so extract the block 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":"d2layouts/d2talalayout/internal/placement/sizeless_optimizer.go"},"region":{"startLine":481}}}],"partialFingerprints":{"codehealthFindingId/v1":"c7650e1e9f161030fcc17c2e28982b97d3372986f72275099a858a440259f744"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): d2oracle/edit.go:1834-1839 | d2oracle/edit.go:2797-2802 \u2014 both copies are in the same file, so extract the block 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":1834}}}],"partialFingerprints":{"codehealthFindingId/v1":"29c47df833108e3d11226a0abfb67afbe7b6ad9521c252a3fa84881004c344a3"}},{"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, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, 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":"39d496551f8edd82efbb98397db9b7640707e9b65a749a6143adc6f0778a1cc4"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (3\u20136 lines \u00D7 4): d2renderers/d2raster/filter.go:593-598 | d2renderers/d2raster/filter.go:636-641 | d2renderers/d2raster/filter.go:693-695 | d2renderers/d2raster/filter.go:746-748 \u2014 all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites \u2014 resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2renderers/d2raster/filter.go:593\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. 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/d2raster/filter.go"},"region":{"startLine":593}}}],"partialFingerprints":{"codehealthFindingId/v1":"a3b1907cea7645dc7bd086013f797f51a353cc28a0594c765fe45a43ee214373"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): d2renderers/d2raster/filter.go:678-684 | d2renderers/d2raster/filter.go:858-864 \u2014 both copies are in the same file, so extract the block 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/d2raster/filter.go:678\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/d2raster/filter.go"},"region":{"startLine":678}}}],"partialFingerprints":{"codehealthFindingId/v1":"06ffb2e08a898da1162a66133ab4f95333a9a7f9df2cfe3de8989018c63b74bb"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): d2renderers/d2raster/filter.go:922-928 | d2renderers/d2raster/filter.go:1080-1086 \u2014 both copies are in the same file, so extract the block 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/d2raster/filter.go:922\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/d2raster/filter.go"},"region":{"startLine":922}}}],"partialFingerprints":{"codehealthFindingId/v1":"c56e804e59309ef6333cf5c2e858905ecb702e83a5929a814681aee1bd7fa168"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): d2renderers/d2scenebuild/build.go:1257-1262 | d2target/render_validation.go:406-411 \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 \u0060d2renderers/d2scenebuild/build.go:1257\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/d2scenebuild/build.go"},"region":{"startLine":1257}}}],"partialFingerprints":{"codehealthFindingId/v1":"fa77436f7819a6d4d748511ecd5b04220c2958d9516bdc7af640b04b749f331a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): d2renderers/d2svg/d2svg.go:2247-2252 | d2renderers/d2svg/table.go:17-22 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, \u0060d2renderers/d2svg/table.go:24\u0060 calls \u0060borderRadiusClipPathID\u0060 and \u0060d2renderers/d2svg/d2svg.go:2254\u0060 does not \u2014 after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svg/d2svg.go"},"region":{"startLine":2247}}}],"partialFingerprints":{"codehealthFindingId/v1":"8cb88060ca52f84fee3a86616dd4440284f2a488529905c6614e0e2b7c43e869"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 10): d2renderers/d2raster/image.go:586-593 | d2renderers/d2raster/image.go:607-614 | d2renderers/d2raster/image.go:660-667 | d2renderers/d2raster/image.go:687-694 | d2renderers/d2raster/image.go:714-721 | d2renderers/d2raster/image.go:748-755 | d2renderers/d2raster/image.go:782-789 | d2renderers/d2raster/image.go:817-824 | d2renderers/d2raster/image.go:845-852 | d2renderers/d2raster/image.go:877-884 \u2014 all 10 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/d2raster/image.go:586\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/d2raster/image.go"},"region":{"startLine":586}}}],"partialFingerprints":{"codehealthFindingId/v1":"cbdab511aff9aeb813d1eae97b0864d2c14c6efe8c24131605ced0b4e189cdfc"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 6): d2renderers/d2raster/filter.go:600-605 | d2renderers/d2raster/filter.go:643-648 | d2renderers/d2raster/filter.go:672-677 | d2renderers/d2raster/filter.go:700-705 | d2renderers/d2raster/filter.go:725-730 | d2renderers/d2raster/filter.go:753-758 \u2014 all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites \u2014 resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2renderers/d2raster/filter.go:600\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/d2raster/filter.go"},"region":{"startLine":600}}}],"partialFingerprints":{"codehealthFindingId/v1":"4089afa3c2a6f0d832b5c6af9447f9f6df3eda156e6b9b625a94c5c2fbc19831"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 4): d2renderers/d2ascii/asciishapes/helpers.go:29-33 | d2renderers/d2ascii/asciishapes/package.go:20-24 | d2renderers/d2ascii/asciishapes/page.go:27-31 | d2renderers/d2ascii/asciishapes/rectangle.go:38-42 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from all 4 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2renderers/d2ascii/asciishapes/helpers.go:29\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. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, \u0060d2renderers/d2ascii/asciishapes/rectangle.go:43\u0060 calls \u0060TrimSpace\u0060, \u0060Set\u0060 and \u0060d2renderers/d2ascii/asciishapes/helpers.go:34\u0060 does not \u2014 after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2ascii/asciishapes/helpers.go"},"region":{"startLine":29}}}],"partialFingerprints":{"codehealthFindingId/v1":"4763fca37ed825e28abe604df8b6525899e7623a76945861daa6144738c6bb0a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10\u201312 lines \u00D7 3): d2layouts/d2talalayout/internal/layoutgraph/node.go:1480-1491 | d2layouts/d2talalayout/internal/quality/labels.go:380-389 | d2layouts/d2talalayout/internal/routing/geometry.go:57-66 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 and call it from each site; until then, every change has to be made 3 times. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any \u0060return\u0060 inside it is the body\u0027s own exit and keeps its meaning in the moved unit."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/node.go"},"region":{"startLine":1480}}}],"partialFingerprints":{"codehealthFindingId/v1":"25cd558829789300947ef774d683edaf561209246a8a481175d2011c4f4b2aca"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): d2graph/d2graph.go:1943-1951 | d2graph/layout.go:341-349 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2graph/d2graph.go:1943\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":1943}}}],"partialFingerprints":{"codehealthFindingId/v1":"5e75d9fd18b39ac3b91448ab3782cfec6649d20320f158de2d38ee53f559a579"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): d2layouts/d2grid/layout.go:155-160 | d2layouts/d2layouts.go:379-384 \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:155\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":155}}}],"partialFingerprints":{"codehealthFindingId/v1":"1df66a299bc8c5c85ad8dbc81d02bbd50e6939b4066e8a5dfe875111e7edc73f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): d2layouts/d2talalayout/internal/graphbounds/bounds.go:125-134 | d2layouts/d2talalayout/internal/labeling/guard.go:393-402 \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/d2talalayout/internal/graphbounds/bounds.go:125\u0060 it runs out through the closing brace of the declaration holding it \u2014 the window is that declaration\u0027s tail, not a fragment that begins part-way through something, so those exact 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 \u0060return\u0060 at the foot of the matched lines is the enclosing body\u0027s own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that \u0060return\u0060 occupied \u2014 no decision has to be handed back and re-acted on."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/graphbounds/bounds.go"},"region":{"startLine":125}}}],"partialFingerprints":{"codehealthFindingId/v1":"5a995762a6ababdc205d52ca98ac8f608a69e9993e9aa68262ee35169da87a9b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): d2layouts/d2talalayout/internal/hierarchy/crossing.go:141-146 | d2layouts/d2talalayout/internal/hierarchy/crossing.go:149-154 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2layouts/d2talalayout/internal/hierarchy/crossing.go:141\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/hierarchy/crossing.go"},"region":{"startLine":141}}}],"partialFingerprints":{"codehealthFindingId/v1":"f66aad94a915652a0818ebb45cb3bcb165aee15587ee847307ed2d29575ab612"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): d2layouts/d2talalayout/internal/layoutgraph/node.go:558-562 | d2layouts/d2talalayout/internal/routing/ovg_resource.go:403-407 \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/d2talalayout/internal/layoutgraph/node.go:558\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/d2talalayout/internal/layoutgraph/node.go"},"region":{"startLine":558}}}],"partialFingerprints":{"codehealthFindingId/v1":"e37309119e875f9d8eb51e12edddb53237c7fbcaa8907d9e6f53bd2991946b35"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): d2layouts/d2talalayout/internal/nodeshape/shape_c4person.go:91-95 | d2layouts/d2talalayout/internal/nodeshape/shape_step.go:97-101 \u2014 before extracting anything, compare \u0060d2layouts/d2talalayout/internal/nodeshape/shape_c4person.go\u0060 and \u0060d2layouts/d2talalayout/internal/nodeshape/shape_step.go\u0060 as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 122 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2layouts/d2talalayout/internal/nodeshape/shape_c4person.go:91\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":"d2layouts/d2talalayout/internal/nodeshape/shape_c4person.go"},"region":{"startLine":91}}}],"partialFingerprints":{"codehealthFindingId/v1":"48de8d6942e34a1b961a6d61f88f30db19174cda1f0c03f94203bf3a2594df01"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): d2layouts/d2talalayout/internal/placement/dejitter.go:181-185 | d2layouts/d2talalayout/internal/placement/dejitter.go:410-415 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2layouts/d2talalayout/internal/placement/dejitter.go:181\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/d2talalayout/internal/placement/dejitter.go"},"region":{"startLine":181}}}],"partialFingerprints":{"codehealthFindingId/v1":"200624c60fa36927de1f391eac0ae4a081b05928b9d4731b0b1b35d733e6eb56"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): d2layouts/d2talalayout/internal/placement/optimization_guard.go:374-378 | d2layouts/d2talalayout/internal/placement/optimization_guard.go:389-393 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/placement/optimization_guard.go:374\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/d2talalayout/internal/placement/optimization_guard.go"},"region":{"startLine":374}}}],"partialFingerprints":{"codehealthFindingId/v1":"288c7076e40d63289168308ed36b2ed2ccf50ac66b2f94e2f0c64ba73a2b0215"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): d2layouts/d2talalayout/internal/placement/optimization_guard.go:440-445 | d2layouts/d2talalayout/internal/placement/optimizer_spatial_index.go:287-292 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/optimization_guard.go"},"region":{"startLine":440}}}],"partialFingerprints":{"codehealthFindingId/v1":"62c4c2afeacfe85671443a14b56434015fe1cf940af709d60fa96e7b8acc451f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): d2layouts/d2talalayout/internal/placement/sizeless_optimizer.go:292-297 | d2layouts/d2talalayout/internal/placement/sizeless_optimizer.go:372-377 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/placement/sizeless_optimizer.go:292\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/d2talalayout/internal/placement/sizeless_optimizer.go"},"region":{"startLine":292}}}],"partialFingerprints":{"codehealthFindingId/v1":"752c9c2581d21a68048fdcbb8849dc9a278f6d677ccc1d34865063e408615fa6"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): d2layouts/d2talalayout/internal/placement/swap.go:200-204 | d2layouts/d2talalayout/internal/placement/swap.go:219-223 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/swap.go"},"region":{"startLine":200}}}],"partialFingerprints":{"codehealthFindingId/v1":"a6f012b13c499265b2e9569cb026c73de21d2e108a23cda43a33ab4e1978cb87"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): d2layouts/d2talalayout/internal/placement/swap.go:206-210 | d2layouts/d2talalayout/internal/placement/swap.go:213-217 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/placement/swap.go"},"region":{"startLine":206}}}],"partialFingerprints":{"codehealthFindingId/v1":"6acd9db85dca216d349487ee69feb4b1871df7287f5f46a95e35a2d26749498f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): d2oracle/edit.go:1575-1580 | d2oracle/edit.go:1582-1587 \u2014 both copies are in the same file, so extract the block 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":1575}}}],"partialFingerprints":{"codehealthFindingId/v1":"b096575b9f1b531b305f83ad69c0c3b038ca08445456fbad7f2419cb970c3adf"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): d2renderers/d2isometric/d2isometricimg/framing.go:138-142 | d2renderers/d2isometric/d2isometricimg/framing.go:165-169 \u2014 both copies are in the same file, so extract the block 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/d2isometric/d2isometricimg/framing.go"},"region":{"startLine":138}}}],"partialFingerprints":{"codehealthFindingId/v1":"c912666dcbfb3494cfbafde4b3d5c3ebdd6c2721902d4840c964f399d0bc50fe"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): d2renderers/d2isometric/d2isometricimg/native_edges.go:381-385 | d2renderers/d2isometric/d2isometricimg/native_ink_joins.go:28-32 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/native_edges.go"},"region":{"startLine":381}}}],"partialFingerprints":{"codehealthFindingId/v1":"d6010190536f21b7ef69cc5716ec8932335778df0ce88a04e8b3ae649ccf2f6f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): d2renderers/d2isometric/d2isometricimg/route_bridges.go:162-168 | d2renderers/d2isometric/d2isometricimg/route_lanes.go:198-204 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/route_bridges.go"},"region":{"startLine":162}}}],"partialFingerprints":{"codehealthFindingId/v1":"33c0b7dfae0f84e61be71d72432f05890efb4af1137df8404c2e412f498cb61a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): d2renderers/d2raster/filter.go:929-934 | d2renderers/d2raster/filter.go:1092-1097 \u2014 both copies are in the same file, so extract the block 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/d2raster/filter.go:929\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/d2raster/filter.go"},"region":{"startLine":929}}}],"partialFingerprints":{"codehealthFindingId/v1":"9c337de2fc7127ea4d3f0df1e49d293ff0a9a840bd2f9a371e9eb99f874feb8d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): d2renderers/d2raster/filter.go:1135-1145 | d2renderers/d2raster/filter.go:1166-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 \u0060d2renderers/d2raster/filter.go:1135\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":"d2renderers/d2raster/filter.go"},"region":{"startLine":1135}}}],"partialFingerprints":{"codehealthFindingId/v1":"bc1ad40607ab74c3b55ed1a791bc7deda17dbd8881c34c9a1317285383be6413"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): d2renderers/d2raster/geometry.go:30-34 | d2renderers/d2raster/image.go:434-438 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2renderers/d2raster/geometry.go:30\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/d2raster/geometry.go"},"region":{"startLine":30}}}],"partialFingerprints":{"codehealthFindingId/v1":"2a2f9b4e8f7625d7d1e5cda5e5c74e91e5a682aed3c55d2122dad204ee40bad6"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): d2renderers/d2raster/geometry.go:235-240 | d2renderers/d2raster/geometry.go:267-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 \u0060d2renderers/d2raster/geometry.go:235\u0060 it runs out through the closing brace of the declaration holding it \u2014 the window is that declaration\u0027s tail, not a fragment that begins part-way through something, so those exact 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/d2raster/geometry.go"},"region":{"startLine":235}}}],"partialFingerprints":{"codehealthFindingId/v1":"152f092e129221a92eb834f49f91d56b9d4c300777983b76ddbc2ef513dfc75a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (3\u20135 lines \u00D7 3): d2renderers/d2raster/geometry.go:520-524 | d2renderers/d2raster/gradient.go:1372-1376 | d2renderers/d2raster/image.go:497-499 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2renderers/d2raster/geometry.go:520\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/d2raster/geometry.go"},"region":{"startLine":520}}}],"partialFingerprints":{"codehealthFindingId/v1":"02a15c8ad426457a09084923584da92e285cd9cbb6ddcfee1017eab0c4557440"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): d2renderers/d2raster/gradient.go:765-771 | d2renderers/d2raster/gradient.go:1065-1071 \u2014 both copies are in the same file, so extract the block 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/d2raster/gradient.go:765\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/d2raster/gradient.go"},"region":{"startLine":765}}}],"partialFingerprints":{"codehealthFindingId/v1":"5540652a7ed63cfe9126b6cd4ace87d19039e0ea6f46db1f939a1050b99419e2"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): d2renderers/d2sketch/sketch.go:175-181 | d2renderers/d2sketch/sketch.go:221-227 \u2014 both copies are in the same file, so extract the block 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":"d2renderers/d2sketch/sketch.go"},"region":{"startLine":175}}}],"partialFingerprints":{"codehealthFindingId/v1":"7b2280e3fc3a76944f84c1b4ec2e392cd799164135f6b568070b85cd489d6402"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): d2renderers/d2sketch/sketch.go:588-592 | d2renderers/d2svg/class.go:107-111 \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":588}}}],"partialFingerprints":{"codehealthFindingId/v1":"8fca19914cfc2cfcb0eab59545f568a647a2bcefc9a7e44160474f07b2c62881"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7\u20138 lines \u00D7 2): d2renderers/d2svg/class.go:131-138 | d2renderers/d2svg/table.go:161-167 \u2014 before extracting anything, compare \u0060d2renderers/d2svg/class.go\u0060 and \u0060d2renderers/d2svg/table.go\u0060 as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2renderers/d2svg/class.go:131\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":131}}}],"partialFingerprints":{"codehealthFindingId/v1":"ec9a7bbf4a893d2009dc29956ceb6f9a12af76388ac72a8e126b9e22c58480e0"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): d2renderers/d2svg/d2svg.go:631-635 | d2renderers/d2svg/d2svg.go:654-658 \u2014 both copies are in the same file, so extract the block 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:631\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":631}}}],"partialFingerprints":{"codehealthFindingId/v1":"14ce7074b24de72b70ebb02f4c487fc54c7d21245342807a0d0d9053123b9f7f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): d2renderers/d2svg/d2svg.go:757-761 | d2renderers/d2svg/d2svg.go:764-769 \u2014 both copies are in the same file, so extract the block 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:757\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":757}}}],"partialFingerprints":{"codehealthFindingId/v1":"706c8e13025b45fb21405fcf8e67f7c802552f6d169f0d48507a93f13a1283ea"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (22 lines \u00D7 2): d2renderers/d2svg/d2svg.go:1487-1508 | d2renderers/d2svg/d2svg.go:1622-1643 \u2014 both copies are in the same file, so extract the block 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":1487}}}],"partialFingerprints":{"codehealthFindingId/v1":"288e7ad269ea8701c8cc5318fbfb1f6e605bf7c3df9561ec700c6c4359a1a770"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): d2renderers/d2svgimport/path.go:239-243 | d2renderers/d2svgimport/path.go:253-257 \u2014 both copies are in the same file, so extract the block 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/d2svgimport/path.go"},"region":{"startLine":239}}}],"partialFingerprints":{"codehealthFindingId/v1":"f7ddd7c8178385c4ca42ff2b95d16adf3f36f3ac916c1c183a9a71dbf4c32b26"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): internal/rasterimage/firstframe.go:657-661 | internal/rasterimage/firstframe.go:678-682 \u2014 both copies are in the same file, so extract the block 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 \u0060internal/rasterimage/firstframe.go:657\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":"internal/rasterimage/firstframe.go"},"region":{"startLine":657}}}],"partialFingerprints":{"codehealthFindingId/v1":"2e2605f899efe680e1bea905a21b72231cacae57835b4b3d4191a2a86751736b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): lib/color/gradient.go:160-165 | lib/color/gradient.go:242-247 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, \u0060lib/color/gradient.go:157\u0060 calls \u0060WriteString\u0060, \u0060Sprintf\u0060, \u0060EscapeString\u0060 and \u0060lib/color/gradient.go:240\u0060 does not \u2014 after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/color/gradient.go"},"region":{"startLine":160}}}],"partialFingerprints":{"codehealthFindingId/v1":"1006f958e80363ea1a1bc560af6706d50bd958625419b76e1b7796b0819dd70a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (29 lines \u00D7 2): d2renderers/d2scenebuild/build.go:1132-1160 | d2target/render_validation.go:278-306 \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/d2scenebuild/build.go"},"region":{"startLine":1132}}}],"partialFingerprints":{"codehealthFindingId/v1":"36adb06d4656a3a25a8de3677f299075b178c9cf7f352a7b6753f9858612b4ec"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (34 lines \u00D7 2): d2renderers/d2scenebuild/build.go:1162-1195 | d2target/render_validation.go:308-341 \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/d2scenebuild/build.go"},"region":{"startLine":1162}}}],"partialFingerprints":{"codehealthFindingId/v1":"9638897d0b37506a66a7468bd10090802627e5326a5ff395f0532dfb05da831b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (26 lines \u00D7 2): d2renderers/d2scenebuild/build.go:1323-1348 | d2renderers/d2svg/d2svg.go:151-176 \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/d2scenebuild/build.go"},"region":{"startLine":1323}}}],"partialFingerprints":{"codehealthFindingId/v1":"9033f5bc45d04c512f4c6a211e54fc5babd9f61791c47c320d7df20d81546e43"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): d2layouts/d2layouts.go:611-620 | d2lib/d2.go:153-162 \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":"d2layouts/d2layouts.go"},"region":{"startLine":611}}}],"partialFingerprints":{"codehealthFindingId/v1":"4e48f3c7d6646fb969e8684ebb26399796b200ef232c328289807072cca7207d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): d2layouts/d2talalayout/adapter.go:538-551 | d2layouts/d2talalayout/internal/graphjson/direction.go:20-33 \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. Check import visibility before settling on that home: \u0060d2layouts/d2talalayout/internal/graphjson/direction.go\u0060 sits under a restricted \u0060internal\u0060 directory, which only code inside its own subtree is permitted to import from \u2014 so it is reachable from some of these sites and not from others, and being able to see the copies is not the same as being allowed to share them. The home has to be somewhere every one of these sites is permitted to import from; if there is no such place, that restriction may be exactly why the copies are separate."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/adapter.go"},"region":{"startLine":538}}}],"partialFingerprints":{"codehealthFindingId/v1":"523aeb22854b6fc7a3fd5fff7b020eefff4d7e1a12f6d7b13cfe2c53b31f12e6"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): d2layouts/d2talalayout/internal/labeling/guard.go:79-84 | d2layouts/d2talalayout/internal/limits/optimization.go:89-94 \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":"d2layouts/d2talalayout/internal/labeling/guard.go"},"region":{"startLine":79}}}],"partialFingerprints":{"codehealthFindingId/v1":"fde29f7ccfcf3db7d697ee96d724f748c5f27ea0b1b2789ba1d42c87bb164d54"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 3): d2layouts/d2talalayout/internal/layoutgraph/node.go:1471-1477 | d2layouts/d2talalayout/internal/quality/crossings.go:77-83 | d2layouts/d2talalayout/internal/routing/geometry.go:48-54 \u2014 before extracting anything, compare \u0060d2layouts/d2talalayout/internal/layoutgraph/node.go\u0060 and \u0060d2layouts/d2talalayout/internal/routing/geometry.go\u0060 as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 59 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/node.go"},"region":{"startLine":1471}}}],"partialFingerprints":{"codehealthFindingId/v1":"63a38868b8eebe097496189850312e3634b208dc6a6b709e80f4affc955d9449"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 3): d2layouts/d2talalayout/internal/layoutgraph/node.go:1497-1501 | d2layouts/d2talalayout/internal/quality/labels.go:395-399 | d2layouts/d2talalayout/internal/routing/geometry.go:72-76 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 and call it from each site; until then, every change has to be made 3 times."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/node.go"},"region":{"startLine":1497}}}],"partialFingerprints":{"codehealthFindingId/v1":"8da017bdb10352947d4fa86d79a1263837c8b3cdb1172d0f784ec13977cba932"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 3): d2layouts/d2talalayout/internal/layoutgraph/transaction_snapshot.go:35-41 | d2layouts/d2talalayout/internal/packing/combine.go:30-36 | d2layouts/d2talalayout/internal/routing/snapshot.go:33-39 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 and call it from each site; until then, every change has to be made 3 times."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/transaction_snapshot.go"},"region":{"startLine":35}}}],"partialFingerprints":{"codehealthFindingId/v1":"1a44da6da7aa9b7ea6d03992982109ce08d6ef1d41f9daa5caa9d14b72274680"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 4): d2layouts/d2talalayout/internal/layoutgraph/transaction_snapshot.go:71-76 | d2layouts/d2talalayout/internal/packing/snapshot.go:8-13 | d2layouts/d2talalayout/internal/placement/types.go:21-26 | d2layouts/d2talalayout/internal/routing/snapshot.go:13-18 \u2014 before extracting anything, compare \u0060d2layouts/d2talalayout/internal/packing/snapshot.go\u0060 and \u0060d2layouts/d2talalayout/internal/placement/types.go\u0060 as WHOLE FILES: 92% of the shorter file\u0027s lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it \u2014 treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/transaction_snapshot.go"},"region":{"startLine":71}}}],"partialFingerprints":{"codehealthFindingId/v1":"93b96baa27fbebb7fff46d4dcaa69f297af88564e143eb8193e4d8ab2f689536"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): d2layouts/d2talalayout/internal/limits/work.go:153-158 | d2layouts/d2talalayout/internal/routing/route_stage_guard.go:119-124 \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":"d2layouts/d2talalayout/internal/limits/work.go"},"region":{"startLine":153}}}],"partialFingerprints":{"codehealthFindingId/v1":"6663c579ecf1f48e183695b85b6af031c40403d208423704d637386a6d083c1a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): d2layouts/d2talalayout/internal/limits/work.go:179-189 | d2layouts/d2talalayout/internal/routing/work.go:8-18 \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":"d2layouts/d2talalayout/internal/limits/work.go"},"region":{"startLine":179}}}],"partialFingerprints":{"codehealthFindingId/v1":"b525c9699decd95c936c339812c21e3d5eeee2e0d18d6dd19edef8b90149dc8d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (18 lines \u00D7 8): d2layouts/d2talalayout/internal/nodeshape/shape_c4person.go:117-134 | d2layouts/d2talalayout/internal/nodeshape/shape_callout.go:130-147 | d2layouts/d2talalayout/internal/nodeshape/shape_cloud.go:114-131 | d2layouts/d2talalayout/internal/nodeshape/shape_diamond.go:111-128 | d2layouts/d2talalayout/internal/nodeshape/shape_package.go:148-166 | d2layouts/d2talalayout/internal/nodeshape/shape_person.go:117-134 | d2layouts/d2talalayout/internal/nodeshape/shape_square.go:118-135 | d2layouts/d2talalayout/internal/nodeshape/shape_step.go:123-140 \u2014 before extracting anything, compare \u0060d2layouts/d2talalayout/internal/nodeshape/shape_c4person.go\u0060 and \u0060d2layouts/d2talalayout/internal/nodeshape/shape_diamond.go\u0060 as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 117 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/nodeshape/shape_c4person.go"},"region":{"startLine":117}}}],"partialFingerprints":{"codehealthFindingId/v1":"97bc67572fdb1601c5c4c51f7bf0f6531bf267594ce206addf5aa1889006456f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): d2layouts/d2talalayout/internal/routing/ovg_resource.go:75-80 | d2layouts/d2talalayout/internal/routing/route_search_guard.go:151-156 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/ovg_resource.go"},"region":{"startLine":75}}}],"partialFingerprints":{"codehealthFindingId/v1":"1cbafcf2a182c8a63eec50cbb4212a76a6a5cc52a3215303e40ba618c45c1064"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): d2layouts/d2talalayout/internal/routing/ovg_resource.go:484-494 | d2layouts/d2talalayout/internal/routing/route_search_guard.go:289-299 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/ovg_resource.go"},"region":{"startLine":484}}}],"partialFingerprints":{"codehealthFindingId/v1":"3839167dcee823baa74b1bc10eb711f50bdb597696bba30312ff735402fb012e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): d2renderers/d2raster/effects.go:217-222 | d2renderers/d2raster/internal/scanline/rasterizer.go:898-903 \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. Check import visibility before settling on that home: \u0060d2renderers/d2raster/internal/scanline/rasterizer.go\u0060 sits under a restricted \u0060internal\u0060 directory, which only code inside its own subtree is permitted to import from \u2014 so it is reachable from some of these sites and not from others, and being able to see the copies is not the same as being allowed to share them. The home has to be somewhere every one of these sites is permitted to import from; if there is no such place, that restriction may be exactly why the copies are separate."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/effects.go"},"region":{"startLine":217}}}],"partialFingerprints":{"codehealthFindingId/v1":"2b39beb679e9cdeb056b0b98782a343f1a034ac3b933be1cf91328ad52555bec"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): d2renderers/d2raster/effects.go:224-229 | d2renderers/d2raster/internal/scanline/rasterizer.go:905-910 \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. Check import visibility before settling on that home: \u0060d2renderers/d2raster/internal/scanline/rasterizer.go\u0060 sits under a restricted \u0060internal\u0060 directory, which only code inside its own subtree is permitted to import from \u2014 so it is reachable from some of these sites and not from others, and being able to see the copies is not the same as being allowed to share them. The home has to be somewhere every one of these sites is permitted to import from; if there is no such place, that restriction may be exactly why the copies are separate."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/effects.go"},"region":{"startLine":224}}}],"partialFingerprints":{"codehealthFindingId/v1":"74494cfb113d5e19dab53de34c7d5c0a95a406f55cd25c93f21c7c4a04e324cd"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 3): d2renderers/d2scenebuild/build.go:1309-1314 | d2renderers/d2svg/d2svg.go:108-113 | d2target/render_validation.go:417-422 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 and call it from each site; until then, every change has to be made 3 times."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/build.go"},"region":{"startLine":1309}}}],"partialFingerprints":{"codehealthFindingId/v1":"88a1d8f178ff8e86409c10e9899bf0fb768478e3171df5d8b3d4146856cc2fcb"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 3): d2renderers/d2scenebuild/build.go:1316-1321 | d2renderers/d2svg/d2svg.go:115-120 | d2target/render_validation.go:424-429 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 and call it from each site; until then, every change has to be made 3 times."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/build.go"},"region":{"startLine":1316}}}],"partialFingerprints":{"codehealthFindingId/v1":"3375b7bdf3873311daa3c2ba2b6b1cfed83119b588077a03974dec41ba9dd053"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): d2renderers/d2scenebuild/metadata.go:257-262 | lib/svg/text.go:44-49 \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/d2scenebuild/metadata.go"},"region":{"startLine":257}}}],"partialFingerprints":{"codehealthFindingId/v1":"2fe8c78fbc4cf9fb60dbc21b5c0f741089faff5dc39bca98950e3e0a3edb573f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): lib/label/label.go:632-640 | lib/svg/path.go:46-54 \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":"lib/label/label.go"},"region":{"startLine":632}}}],"partialFingerprints":{"codehealthFindingId/v1":"7c049b6c05776d25c3b7bee27b5194e0d4a320ea822be84507c08fccdc0d4f44"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): lib/shape/shape_diamond.go:67-71 | lib/shape/shape_hexagon.go:64-68 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/shape/shape_diamond.go"},"region":{"startLine":67}}}],"partialFingerprints":{"codehealthFindingId/v1":"a10565e44c2d51f936312d2f4cacddbb8027212d1feb5076829e37df923b3527"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): d2cli/paged.go:241-253 | d2cli/raster.go:974-986 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2cli/paged.go"},"region":{"startLine":241}}}],"partialFingerprints":{"codehealthFindingId/v1":"ea16c23ae88c8b9029700d172bcafbb26789c95f66e810015d0f411b487268c5"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): d2ir/edge_expansion.go:120-127 | d2ir/glob_expansion.go:67-74 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ir/edge_expansion.go"},"region":{"startLine":120}}}],"partialFingerprints":{"codehealthFindingId/v1":"329cab9cd8848c95e2bd9cec7a73087de2c15d35fd6b5cce39f2e280b40578c1"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): d2ir/expansion.go:48-54 | d2ir/glob_expansion.go:51-57 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ir/expansion.go"},"region":{"startLine":48}}}],"partialFingerprints":{"codehealthFindingId/v1":"9f5948c6887e238debd7041610f08887ccb6b0cf1fa68e47187fea43328d91c3"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 4): d2layouts/d2talalayout/internal/layoutgraph/hub_spoke.go:4-11 | d2layouts/d2talalayout/internal/layoutgraph/layout.go:32-39 | d2layouts/d2talalayout/internal/layoutgraph/layout.go:42-49 | d2layouts/d2talalayout/internal/layoutgraph/layout.go:52-59 \u2014 there are 4 copies across 2 file(s) \u2014 more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/hub_spoke.go"},"region":{"startLine":4}}}],"partialFingerprints":{"codehealthFindingId/v1":"5dcdd22c2888f48847279dbe7d4ba40df0cad21f631813f6176a3e160f640857"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): d2layouts/d2talalayout/internal/placement/edge_abduction_scratch.go:13-22 | d2layouts/d2talalayout/internal/placementcost/symmetry.go:33-42 \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":"d2layouts/d2talalayout/internal/placement/edge_abduction_scratch.go"},"region":{"startLine":13}}}],"partialFingerprints":{"codehealthFindingId/v1":"4f4283bd41fcd361723a4d988944e04a0a01511c79c4aaf337d31c5ab3c1aa75"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 18): lib/shape/shape_c4_person.go:23-32 | lib/shape/shape_callout.go:20-29 | lib/shape/shape_circle.go:14-23 | lib/shape/shape_cylinder.go:19-28 | lib/shape/shape_diamond.go:15-24 | lib/shape/shape_document.go:22-31 | lib/shape/shape_hexagon.go:15-24 | lib/shape/shape_image.go:12-21 | lib/shape/shape_oval.go:16-25 | lib/shape/shape_package.go:24-33 | lib/shape/shape_page.go:21-30 | lib/shape/shape_parallelogram.go:17-26 | lib/shape/shape_person.go:15-24 | lib/shape/shape_queue.go:15-24 | lib/shape/shape_real_square.go:14-23 | lib/shape/shape_square.go:12-21 | lib/shape/shape_step.go:15-24 | lib/shape/shape_stored_data.go:17-26 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from all 18 call sites, so a change lands once. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, \u0060lib/shape/shape_real_square.go:25\u0060 calls \u0060AspectRatio1\u0060 and \u0060lib/shape/shape_image.go:23\u0060 does not \u2014 after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/shape/shape_c4_person.go"},"region":{"startLine":23}}}],"partialFingerprints":{"codehealthFindingId/v1":"fdea8e613de78ab665ffce6f67b23c381f245c50b0a6577022b9b0bd3d519679"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 4): lib/shape/shape_c4_person.go:136-141 | lib/shape/shape_cylinder.go:78-83 | lib/shape/shape_page.go:85-90 | lib/shape/shape_queue.go:74-79 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from all 4 call sites, so a change lands once."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/shape/shape_c4_person.go"},"region":{"startLine":136}}}],"partialFingerprints":{"codehealthFindingId/v1":"701e4ce09a426988f7cfe34d8f9d9bbae3919fab81439fa986de18058f69cbb3"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): lib/shape/shape_class.go:13-24 | lib/shape/shape_table.go:13-24 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/shape/shape_class.go"},"region":{"startLine":13}}}],"partialFingerprints":{"codehealthFindingId/v1":"c3d164fba36c8c2cf53da32e9804f48441946c415788027ae49fb5191265c81e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): lib/shape/shape_code.go:12-23 | lib/shape/shape_text.go:13-24 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/shape/shape_code.go"},"region":{"startLine":12}}}],"partialFingerprints":{"codehealthFindingId/v1":"dae6b9fb6163054f5aea64bffdfb374fa6d415ea16e00224c55b155fc02bcdba"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 5): d2layouts/d2talalayout/internal/layoutgraph/transaction_snapshot.go:427-440 | d2layouts/d2talalayout/internal/layoutgraph/transaction_snapshot.go:447-460 | d2layouts/d2talalayout/internal/layoutgraph/transaction_snapshot.go:467-480 | d2layouts/d2talalayout/internal/layoutgraph/transaction_snapshot.go:507-520 | d2layouts/d2talalayout/internal/layoutgraph/transaction_snapshot.go:527-540 \u2014 all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites \u2014 resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2layouts/d2talalayout/internal/layoutgraph/transaction_snapshot.go:427\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/d2talalayout/internal/layoutgraph/transaction_snapshot.go"},"region":{"startLine":427}}}],"partialFingerprints":{"codehealthFindingId/v1":"875670c4f3131fe3ca3df7df874d9c7d7c9136cbc7ade50339fef8808c8bf08e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): d2layouts/d2talalayout/internal/layoutgraph/transaction_snapshot.go:407-420 | d2layouts/d2talalayout/internal/layoutgraph/transaction_snapshot.go:487-500 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/layoutgraph/transaction_snapshot.go:407\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/d2talalayout/internal/layoutgraph/transaction_snapshot.go"},"region":{"startLine":407}}}],"partialFingerprints":{"codehealthFindingId/v1":"b12d9fb2149a3b487c5f60f176caf3f40e8b18cfbdd58c5cfe68fe07bc4950cd"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): d2layouts/d2talalayout/internal/graphjson/codec.go:1322-1333 | d2layouts/d2talalayout/internal/graphjson/codec.go:1364-1376 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/graphjson/codec.go:1322\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/d2talalayout/internal/graphjson/codec.go"},"region":{"startLine":1322}}}],"partialFingerprints":{"codehealthFindingId/v1":"5c5ddb1768cdab37844cd9eb0e131665d8f72bf9d58e886381fbba321292df8a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): d2layouts/d2talalayout/internal/layoutgraph/topology_preflight.go:144-155 | d2layouts/d2talalayout/internal/layoutgraph/topology_preflight.go:526-534 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/layoutgraph/topology_preflight.go:144\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/d2talalayout/internal/layoutgraph/topology_preflight.go"},"region":{"startLine":144}}}],"partialFingerprints":{"codehealthFindingId/v1":"05b11016605da93f0cb1d4176c00c7893b4a70578e45a05c31304582598d43ba"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): d2layouts/d2talalayout/internal/layoutgraph/topology_preflight.go:159-169 | d2layouts/d2talalayout/internal/layoutgraph/topology_preflight.go:537-545 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/layoutgraph/topology_preflight.go:159\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/d2talalayout/internal/layoutgraph/topology_preflight.go"},"region":{"startLine":159}}}],"partialFingerprints":{"codehealthFindingId/v1":"d381a9335ec8339a59cccbb35cf8799ffdf37082303bb87c701244fe51cb25d0"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): d2renderers/d2svgimport/image.go:399-409 | d2renderers/d2svgimport/image.go:426-436 \u2014 both copies are in the same file, so extract the block 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":"d2renderers/d2svgimport/image.go"},"region":{"startLine":399}}}],"partialFingerprints":{"codehealthFindingId/v1":"57663dfaf31f0b77e5ed07411081d00ad92bff8105a84263bee65f900d8a3f32"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): d2layouts/d2talalayout/internal/placement/sized_optimizer.go:1013-1023 | d2layouts/d2talalayout/internal/placement/sizeless_optimizer.go:465-475 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/sized_optimizer.go"},"region":{"startLine":1013}}}],"partialFingerprints":{"codehealthFindingId/v1":"2fb8756fb22fa2fc57eac8c85d43f0fc9e75d9455f9feb04826372d73547e586"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): d2renderers/d2raster/filter.go:1239-1248 | d2renderers/d2raster/filter.go:1253-1262 \u2014 both copies are in the same file, so extract the block 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":"d2renderers/d2raster/filter.go"},"region":{"startLine":1239}}}],"partialFingerprints":{"codehealthFindingId/v1":"a38f2b4a807b0a9116d078ccabdf3860061bc9ae4fbe748bbca93411757e6d1f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): d2layouts/d2layouts.go:333-342 | d2layouts/d2layouts.go:353-361 \u2014 both copies are in the same file, so extract the block 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/d2layouts.go:333\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/d2layouts.go"},"region":{"startLine":333}}}],"partialFingerprints":{"codehealthFindingId/v1":"65163197e055f34e6973efdf6a072986569fef2afa0d6060cd3bb4885ad3278b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): d2layouts/d2talalayout/internal/placement/optimization_guard.go:613-622 | d2layouts/d2talalayout/internal/placement/optimization_guard.go:844-853 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/placement/optimization_guard.go:613\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/d2talalayout/internal/placement/optimization_guard.go"},"region":{"startLine":613}}}],"partialFingerprints":{"codehealthFindingId/v1":"905116e80d756aed50a527ce91446c34f7afff4b894bfac517a44014bf575427"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): d2renderers/d2raster/text.go:361-370 | d2renderers/d2raster/text.go:378-387 \u2014 both copies are in the same file, so extract the block 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/d2raster/text.go:361\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/d2raster/text.go"},"region":{"startLine":361}}}],"partialFingerprints":{"codehealthFindingId/v1":"6322924d2dfe6b5efd38da15737a2e6bafef3b286b2a54b99a12288dbc13b0b4"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): d2layouts/d2talalayout/internal/layoutgraph/clone.go:374-383 | d2layouts/d2talalayout/internal/layoutgraph/clone.go:435-444 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/layoutgraph/clone.go:374\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/clone.go"},"region":{"startLine":374}}}],"partialFingerprints":{"codehealthFindingId/v1":"5f7f195cdf9c626f11c25c3f60b03190f91e58c794b86aca2d4a782cf11c2d08"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): d2parser/parse.go:1374-1383 | d2parser/parse.go:1440-1449 \u2014 both copies are in the same file, so extract the block 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:1374\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":"d2parser/parse.go"},"region":{"startLine":1374}}}],"partialFingerprints":{"codehealthFindingId/v1":"af4f31c0fc410b30d9846eb24cef9e772f802639d4001cfbabfadfcaad9ab1cb"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): d2layouts/d2talalayout/internal/graphjson/codec.go:360-368 | d2layouts/d2talalayout/internal/graphjson/codec.go:476-484 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/graphjson/codec.go:360\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/d2talalayout/internal/graphjson/codec.go"},"region":{"startLine":360}}}],"partialFingerprints":{"codehealthFindingId/v1":"54a65c5ee775fb254a1e59075ffee05d6160cdb8c67b2a9865e39b8dd2e3e1cc"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): d2renderers/d2scenebuild/special_shapes.go:75-83 | d2renderers/d2scenebuild/special_shapes.go:188-196 \u2014 both copies are in the same file, so extract the block 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/d2scenebuild/special_shapes.go:75\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/d2scenebuild/special_shapes.go"},"region":{"startLine":75}}}],"partialFingerprints":{"codehealthFindingId/v1":"26ffe6efb68d6266d8df771f935b519b0034ddabfe3ca7f559bf4ea77e2ec4e6"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): d2renderers/d2svg/class.go:59-67 | d2renderers/d2svg/table.go:88-96 \u2014 before extracting anything, compare \u0060d2renderers/d2svg/class.go\u0060 and \u0060d2renderers/d2svg/table.go\u0060 as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2renderers/d2svg/class.go:59\u0060 it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows \u2014 the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members\u0027 bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run \u2014 a one-line delegation has no helper inside it to lift \u2014 so generate the run from the set it enumerates, or accept it and keep each member\u0027s own documentation with it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svg/class.go"},"region":{"startLine":59}}}],"partialFingerprints":{"codehealthFindingId/v1":"d86f0b42676572566b05b75cdc4214cd3e3e24d13bcc052104f5f194cf781f48"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): d2renderers/d2scenebuild/special_shapes.go:85-93 | d2renderers/d2scenebuild/special_shapes.go:197-203 \u2014 both copies are in the same file, so extract the block 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":"d2renderers/d2scenebuild/special_shapes.go"},"region":{"startLine":85}}}],"partialFingerprints":{"codehealthFindingId/v1":"66a25568863a20cadb392bb265e950bbdc95678aed7d62e86142fde5a4e169ca"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): d2renderers/d2scenebuild/legend.go:308-316 | d2renderers/d2scenebuild/legend.go:336-344 \u2014 both copies are in the same file, so extract the block 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/d2scenebuild/legend.go"},"region":{"startLine":308}}}],"partialFingerprints":{"codehealthFindingId/v1":"19ed0b1ac1093bdfff1ff27239340dcec19a687a2220e6a2ec09a31722478c43"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): d2renderers/d2svgimport/import.go:479-486 | d2renderers/d2svgimport/import.go:497-504 \u2014 both copies are in the same file, so extract the block 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/d2svgimport/import.go:479\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/d2svgimport/import.go"},"region":{"startLine":479}}}],"partialFingerprints":{"codehealthFindingId/v1":"79aaf3f0229190499d7488a663c03c750db75d41c3256e384baaf05b4370a123"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): d2layouts/d2talalayout/internal/placement/optimization_guard.go:880-887 | d2layouts/d2talalayout/internal/placement/optimization_guard.go:890-897 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/placement/optimization_guard.go:880\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/d2talalayout/internal/placement/optimization_guard.go"},"region":{"startLine":880}}}],"partialFingerprints":{"codehealthFindingId/v1":"6a749150424730744c8a5abd710810e7dbb133a3fd76f7702be31ee405704b34"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): d2renderers/d2scenebuild/metadata.go:67-74 | d2renderers/d2scenebuild/metadata.go:89-96 \u2014 both copies are in the same file, so extract the block 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/d2scenebuild/metadata.go:67\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/d2scenebuild/metadata.go"},"region":{"startLine":67}}}],"partialFingerprints":{"codehealthFindingId/v1":"16e9727e2b5aeb3c3923f27c717e9b19d0795fb076ba5fcf08d90cf74f8bb2ba"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): d2layouts/d2talalayout/internal/graphjson/codec.go:1302-1309 | d2layouts/d2talalayout/internal/graphjson/codec.go:1344-1351 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/graphjson/codec.go:1302\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/d2talalayout/internal/graphjson/codec.go"},"region":{"startLine":1302}}}],"partialFingerprints":{"codehealthFindingId/v1":"86c325da383485e776a0c1aaab7897b92061034f2fbfcbdf543f5673b2989142"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): d2renderers/d2ascii/asciiroute/routing.go:231-238 | d2renderers/d2ascii/asciiroute/routing.go:305-312 \u2014 both copies are in the same file, so extract the block 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:231\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2ascii/asciiroute/routing.go"},"region":{"startLine":231}}}],"partialFingerprints":{"codehealthFindingId/v1":"4cea8418f0ea19a2b7aa90d90e6dc3f23c4243559ef33a17fba14b94d678a37e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): d2renderers/d2svg/d2svg.go:333-340 | d2renderers/d2svg/d2svg.go:344-351 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svg/d2svg.go"},"region":{"startLine":333}}}],"partialFingerprints":{"codehealthFindingId/v1":"5ce4a69a2b3a6b204697df98fe025a9923465a0a8e0ee35160615297837ac0e4"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): d2layouts/d2talalayout/internal/placement/optimization_guard.go:632-639 | d2layouts/d2talalayout/internal/placement/optimization_guard.go:643-650 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/placement/optimization_guard.go:632\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/d2talalayout/internal/placement/optimization_guard.go"},"region":{"startLine":632}}}],"partialFingerprints":{"codehealthFindingId/v1":"4d36cae0ad27d3211cb3935257e28d1f3cc18c084a82a32a2908ebe5e4fdac2d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): d2ir/compile.go:1095-1102 | d2ir/compile.go:1105-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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ir/compile.go"},"region":{"startLine":1095}}}],"partialFingerprints":{"codehealthFindingId/v1":"3a0a8a4fd7fcc10ee06b1c4dbf5dd319e1b8a27ab9718f0664a44a9d68671585"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): d2renderers/d2svg/d2svg.go:543-549 | d2renderers/d2svg/d2svg.go:588-594 \u2014 both copies are in the same file, so extract the block 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:543\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. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, \u0060d2renderers/d2svg/d2svg.go:552\u0060 calls \u0060FormatFloat\u0060 and \u0060d2renderers/d2svg/d2svg.go:597\u0060 does not \u2014 after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svg/d2svg.go"},"region":{"startLine":543}}}],"partialFingerprints":{"codehealthFindingId/v1":"a58dc2d4a350eb74ba0c20f5fa90f87f2faf03b88fec070800f21f803fb6dde9"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): d2layouts/d2talalayout/result_validate.go:68-74 | d2layouts/d2talalayout/result_validate.go:81-87 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/result_validate.go:68\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/d2talalayout/result_validate.go"},"region":{"startLine":68}}}],"partialFingerprints":{"codehealthFindingId/v1":"9e0341404ece46ede262e90645e2b9ae3b3aeb1944a501653d41bdca9d747016"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): d2cli/paged.go:441-447 | d2cli/paged.go:524-530 \u2014 both copies are in the same file, so extract the block 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/paged.go:441\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":"d2cli/paged.go"},"region":{"startLine":441}}}],"partialFingerprints":{"codehealthFindingId/v1":"d8af66e76af00aa730fa62bf567126d6891ac285e6ec94144c99e30eee4c08e4"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): d2renderers/d2svg/d2svg.go:1095-1101 | d2renderers/d2svg/d2svg.go:1109-1115 \u2014 both copies are in the same file, so extract the block 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:1095\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":1095}}}],"partialFingerprints":{"codehealthFindingId/v1":"31d5c295385254ac803ba90a9203607bf8aeb56977c3f2f8126e0aaf33206a69"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): d2renderers/d2scenebuild/assets.go:214-219 | d2renderers/d2scenebuild/assets.go:224-228 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2renderers/d2scenebuild/assets.go:214\u0060 it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows \u2014 the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members\u0027 bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run \u2014 a one-line delegation has no helper inside it to lift \u2014 so generate the run from the set it enumerates, or accept it and keep each member\u0027s own documentation with 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/d2scenebuild/assets.go"},"region":{"startLine":214}}}],"partialFingerprints":{"codehealthFindingId/v1":"66e2e985a98bc07ab049d92462a31f6692fa6ba9336f2017a76814e31943f170"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): d2layouts/d2talalayout/internal/graphjson/codec.go:1312-1317 | d2layouts/d2talalayout/internal/graphjson/codec.go:1354-1359 \u2014 both copies are in the same file, so extract the block 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/d2talalayout/internal/graphjson/codec.go:1312\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/d2talalayout/internal/graphjson/codec.go"},"region":{"startLine":1312}}}],"partialFingerprints":{"codehealthFindingId/v1":"ff836b8a81c14e5f564844fdb969ddfea34c4d0c6dad466acd020032a5d345b5"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): d2renderers/d2raster/vector_validation.go:379-384 | d2renderers/d2raster/vector_validation.go:427-432 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2renderers/d2raster/vector_validation.go:379\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The \u0060return\u0060 at the foot of the matched lines is the enclosing body\u0027s own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that \u0060return\u0060 occupied \u2014 no decision has to be handed back and re-acted on. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, \u0060d2renderers/d2raster/vector_validation.go:378\u0060 calls \u0060Box\u0060 and \u0060d2renderers/d2raster/vector_validation.go:426\u0060 does not \u2014 after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/vector_validation.go"},"region":{"startLine":379}}}],"partialFingerprints":{"codehealthFindingId/v1":"f24cf96997b31998b12c7ec4801220cc00948c92ac78e2466b8573711763bf02"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): d2renderers/d2scenebuild/assets.go:40-45 | d2renderers/d2scenebuild/assets.go:62-67 \u2014 both copies are in the same file, so extract the block 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":"d2renderers/d2scenebuild/assets.go"},"region":{"startLine":40}}}],"partialFingerprints":{"codehealthFindingId/v1":"f7dbee9505b04ea4290b45de5908bcd0027bbf7cad6c5eec6f7336facfed5d75"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 3): d2layouts/d2talalayout/internal/graphjson/codec.go:359-364 | d2layouts/d2talalayout/internal/graphjson/codec.go:380-385 | d2layouts/d2talalayout/internal/graphjson/codec.go:475-480 \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. 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":"d2layouts/d2talalayout/internal/graphjson/codec.go"},"region":{"startLine":359}}}],"partialFingerprints":{"codehealthFindingId/v1":"c523590df68548608047b9f0423cb0dc302f54f2d1d4ad5e988b02213cc4374a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): d2renderers/d2raster/raster.go:1247-1251 | d2renderers/d2raster/raster.go:1270-1274 \u2014 both copies are in the same file, so extract the block 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":"d2renderers/d2raster/raster.go"},"region":{"startLine":1247}}}],"partialFingerprints":{"codehealthFindingId/v1":"4ec2f2247b3590008b8acb73e3cf59752f3dd274fafc18bbc2abf0da61d80646"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): lib/svg/path.go:299-303 | lib/svg/path.go:304-308 \u2014 both copies are in the same file, so extract the block 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":"lib/svg/path.go"},"region":{"startLine":299}}}],"partialFingerprints":{"codehealthFindingId/v1":"c785a643cd071fdb447c766a8c7b97c221aad7352d5e16d4ebc6608794c555d2"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): d2renderers/d2raster/vector_validation.go:386-390 | d2renderers/d2raster/vector_validation.go:434-438 \u2014 both copies are in the same file, so extract the block 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/d2raster/vector_validation.go:386\u0060 it runs out through the closing brace of the declaration holding it \u2014 the window is that declaration\u0027s tail, not a fragment that begins part-way through something, so those exact 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/d2raster/vector_validation.go"},"region":{"startLine":386}}}],"partialFingerprints":{"codehealthFindingId/v1":"0100b490a47d234c25b46cf28c0a80976f44deb88dd4795544cea09ef6bb7cfd"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): lib/svg/path.go:244-248 | lib/svg/path.go:249-253 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, \u0060lib/svg/path.go:247\u0060 calls \u0060EuclideanDistance\u0060 and \u0060lib/svg/path.go:242\u0060 does not \u2014 after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/svg/path.go"},"region":{"startLine":244}}}],"partialFingerprints":{"codehealthFindingId/v1":"aca7904701ce9a37be398e65673d6bbf52d5ccb4caf35aa83afe387b28476530"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): d2renderers/d2raster/vector_validation.go:340-344 | d2renderers/d2raster/vector_validation.go:359-363 \u2014 both copies are in the same file, so extract the block 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/d2raster/vector_validation.go:340\u0060 it runs out through the closing brace of the declaration holding it \u2014 the window is that declaration\u0027s tail, not a fragment that begins part-way through something, so those exact 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/d2raster/vector_validation.go"},"region":{"startLine":340}}}],"partialFingerprints":{"codehealthFindingId/v1":"cc0245cd03f49d2874c93f6ab2e11d2af618c537c4e944607d037d7ec34f9ab9"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): d2renderers/d2scenebuild/patterns.go:58-62 | d2renderers/d2scenebuild/patterns.go:74-78 \u2014 both copies are in the same file, so extract the block 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/d2scenebuild/patterns.go"},"region":{"startLine":58}}}],"partialFingerprints":{"codehealthFindingId/v1":"30c788ff9d900d05f2d7accf743c42ecb655b2c87f6cf6e504fe6d5a419166c3"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 4): d2renderers/d2raster/raster.go:1244-1248 | d2renderers/d2raster/raster.go:1267-1271 | d2renderers/d2raster/raster.go:1291-1295 | d2renderers/d2raster/text.go:414-418 \u2014 there are 4 copies across 2 file(s) \u2014 more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2renderers/d2raster/raster.go:1244\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/d2raster/raster.go"},"region":{"startLine":1244}}}],"partialFingerprints":{"codehealthFindingId/v1":"1d7bf31c150add8eb6de20b9c28bc817b952f4d5c8d37c6ba25e308ced662094"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): d2layouts/d2talalayout/internal/placement/sized_optimizer.go:724-728 | d2layouts/d2talalayout/internal/placement/sizeless_optimizer.go:352-356 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2layouts/d2talalayout/internal/placement/sized_optimizer.go:724\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":"d2layouts/d2talalayout/internal/placement/sized_optimizer.go"},"region":{"startLine":724}}}],"partialFingerprints":{"codehealthFindingId/v1":"f0be044b5ce47f85c32b2571d2786cdb1be113f5d0c2d1196186769c200bf8d3"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): d2graph/d2graph.go:1036-1040 | d2graph/d2graph.go:1044-1048 \u2014 both copies are in the same file, so extract the block 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":"d2graph/d2graph.go"},"region":{"startLine":1036}}}],"partialFingerprints":{"codehealthFindingId/v1":"035ff4d5c8c042e168a0e9291eb4dec6cfbf871796a58808b2412c36f681252d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): d2renderers/d2scenebuild/legend.go:430-439 | d2renderers/d2scenebuild/legend.go:474-483 \u2014 both copies are in the same file, so extract the block 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/d2scenebuild/legend.go"},"region":{"startLine":430}}}],"partialFingerprints":{"codehealthFindingId/v1":"3aa759e4628eb8ff16b2202617407d7f1f5ba4804c34631c87e773bda0a8527f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): d2cli/paged.go:230-235 | d2cli/raster.go:378-383 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2cli/paged.go"},"region":{"startLine":230}}}],"partialFingerprints":{"codehealthFindingId/v1":"b3c7f4e17fe5700f6de64779fdcae4726c7a9f1589b264ff0da0ebd95d5a3496"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): d2graph/d2graph.go:1354-1359 | d2graph/d2graph.go:1368-1373 \u2014 both copies are in the same file, so extract the block 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:1354\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":1354}}}],"partialFingerprints":{"codehealthFindingId/v1":"818e68366e97893e5e7d5fcd6c0c803c8533f8d215d993a6e79373f183bb9e24"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): d2layouts/d2talalayout/internal/routing/coordinator.go:1753-1757 | d2layouts/d2talalayout/internal/routing/standalone_route_guard.go:414-418 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2layouts/d2talalayout/internal/routing/coordinator.go:1753\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. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, \u0060d2layouts/d2talalayout/internal/routing/coordinator.go:1758\u0060 calls \u0060checkCanceled\u0060 and \u0060d2layouts/d2talalayout/internal/routing/standalone_route_guard.go:420\u0060 does not \u2014 after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/coordinator.go"},"region":{"startLine":1753}}}],"partialFingerprints":{"codehealthFindingId/v1":"aede05d139f0ae71d60af382c924abaaa4a5344abbc7b7fb10ca7b9c4800e27a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 3): d2renderers/d2isometric/d2isometricimg/geometry_routes.go:114-118 | d2renderers/d2isometric/d2isometricimg/route_style.go:34-38 | d2renderers/d2isometric/d2isometricimg/route_style.go:58-62 \u2014 there are 3 copies across 2 file(s) \u2014 more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2renderers/d2isometric/d2isometricimg/geometry_routes.go:114\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. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, \u0060d2renderers/d2isometric/d2isometricimg/route_style.go:55\u0060 calls \u0060nativeMaterial\u0060 and \u0060d2renderers/d2isometric/d2isometricimg/route_style.go:32\u0060 does not \u2014 after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/geometry_routes.go"},"region":{"startLine":114}}}],"partialFingerprints":{"codehealthFindingId/v1":"cc3ed4bf51dda131893e778dc6066458500cbb90e9b01c1a4d3b24507ecb3fd5"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): d2renderers/d2isometric/d2isometricimg/lighting.go:39-43 | d2renderers/d2isometric/d2isometricimg/svg_lighting.go:26-30 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060d2renderers/d2isometric/d2isometricimg/lighting.go:39\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/d2isometric/d2isometricimg/lighting.go"},"region":{"startLine":39}}}],"partialFingerprints":{"codehealthFindingId/v1":"f13583a11a1aab0e719ea435dc2de4490784dbe92261f5dec054ee1d32958c1d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): d2renderers/d2isometric/d2isometricimg/route_style.go:42-46 | d2renderers/d2isometric/d2isometricimg/route_style.go:74-78 \u2014 both copies are in the same file, so extract the block 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/d2isometric/d2isometricimg/route_style.go:42\u0060 it runs out through the closing brace of the declaration holding it \u2014 the window is that declaration\u0027s tail, not a fragment that begins part-way through something, so those exact 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/d2isometric/d2isometricimg/route_style.go"},"region":{"startLine":42}}}],"partialFingerprints":{"codehealthFindingId/v1":"5c8be0c22a6f21405f50b2e10e6cd8274b7e98844f0333d0f887087eea81857f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): d2renderers/d2isometric/scene.go:277-281 | d2renderers/d2isometric/scene.go:305-309 \u2014 both copies are in the same file, so extract the block 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/d2isometric/scene.go"},"region":{"startLine":277}}}],"partialFingerprints":{"codehealthFindingId/v1":"45058038ad91c8c1ca29d48ac5649f681a94deb9428329b99ca82819bd522011"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): d2renderers/d2raster/filter.go:686-690 | d2renderers/d2raster/filter.go:739-743 \u2014 both copies are in the same file, so extract the block 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/d2raster/filter.go"},"region":{"startLine":686}}}],"partialFingerprints":{"codehealthFindingId/v1":"7434fe16e1145a59a2a2a25ba9f1d4b5dfe48246dd3f649463939f75d24f0c8d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): d2renderers/d2raster/raster.go:494-501 | d2renderers/d2raster/raster.go:554-561 \u2014 both copies are in the same file, so extract the block 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/d2raster/raster.go:494\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/d2raster/raster.go"},"region":{"startLine":494}}}],"partialFingerprints":{"codehealthFindingId/v1":"f4ad41dd01f5d879788848d3654e7820da81573bcc2c71d0cc0ed14cd0630131"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): d2renderers/d2scenebuild/appendix.go:281-286 | d2renderers/d2svg/d2svg.go:2271-2276 \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/d2scenebuild/appendix.go"},"region":{"startLine":281}}}],"partialFingerprints":{"codehealthFindingId/v1":"7ce12aef5bca76a2b02a0c2ae69832459c03b772f2938efb941498f05f39fdb5"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): d2renderers/d2scenebuild/assets.go:501-505 | d2renderers/d2svgimport/clip.go:237-241 \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/d2scenebuild/assets.go"},"region":{"startLine":501}}}],"partialFingerprints":{"codehealthFindingId/v1":"b944026c2ba18c3f51386fd78b995f125851f6bf3734bf96e842a8a215965762"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): d2renderers/d2scenebuild/connection.go:454-458 | d2renderers/d2scenebuild/connection.go:462-466 \u2014 both copies are in the same file, so extract the block 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/d2scenebuild/connection.go:454\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/d2scenebuild/connection.go"},"region":{"startLine":454}}}],"partialFingerprints":{"codehealthFindingId/v1":"3e03a69a1dff703ed02a4ced8af909837a1c8abe9a38fe633a16a0059560a7f3"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): d2renderers/d2scenebuild/shape_effects.go:371-375 | d2renderers/d2scenebuild/shape_effects.go:378-382 \u2014 both copies are in the same file, so extract the block 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/d2scenebuild/shape_effects.go:371\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/d2scenebuild/shape_effects.go"},"region":{"startLine":371}}}],"partialFingerprints":{"codehealthFindingId/v1":"41257f913250c4bc5e91bc0f347a643837685463f268a60ca4d54b96056bbf40"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): d2renderers/d2svg/d2svg.go:743-748 | d2renderers/d2svg/d2svg.go:845-850 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, \u0060d2renderers/d2svg/d2svg.go:843\u0060 calls \u0060Sprintf\u0060, \u0060FormatFloat\u0060 and \u0060d2renderers/d2svg/d2svg.go:742\u0060 does not \u2014 after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svg/d2svg.go"},"region":{"startLine":743}}}],"partialFingerprints":{"codehealthFindingId/v1":"38921f9d6bb5f3339866fe31099ae837984b36d59025c1e2d00e9097896b8cd6"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): d2renderers/d2svg/d2svg.go:1446-1451 | d2renderers/d2svg/d2svg.go:1553-1558 \u2014 both copies are in the same file, so extract the block 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":1446}}}],"partialFingerprints":{"codehealthFindingId/v1":"c34ae916ed76806138f7d8700b5b3c4e2ba57ab3dc4ab431a7bd8f07bfad005a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 3): d2target/d2target.go:427-432 | d2target/d2target.go:434-439 | d2target/d2target.go:441-446 \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 \u0060d2target/d2target.go:427\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2target/d2target.go"},"region":{"startLine":427}}}],"partialFingerprints":{"codehealthFindingId/v1":"ba87e00d81a9edf4ef82eabcb69ed95a04f761d1c49e655c2415d387e31df6a3"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): d2target/d2target.go:543-547 | d2target/d2target.go:560-564 \u2014 both copies are in the same file, so extract the block 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 \u0060d2target/d2target.go:543\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":"d2target/d2target.go"},"region":{"startLine":543}}}],"partialFingerprints":{"codehealthFindingId/v1":"23495a285781716810ea4395024ceecc8602acacf5d5e3fb01c8fa9889c2ce15"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): lib/xgif/xgif.go:934-938 | lib/xgif/xgif.go:984-988 \u2014 both copies are in the same file, so extract the block 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/xgif/xgif.go:934\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/xgif/xgif.go"},"region":{"startLine":934}}}],"partialFingerprints":{"codehealthFindingId/v1":"51ff629110fa021581690b998ad187057eff4ad50471364d2bcd3efcdb7dd921"}},{"ruleId":"D6","level":"warning","message":{"text":"Low cohesion: Node (LCOM4 13): Node\u0027s methods fall into 13 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable \u2014 your repository\u0027s bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 13 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected \u2014 and which would otherwise dominate this list \u2014 are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/node.go"},"region":{"startLine":610}}}],"partialFingerprints":{"codehealthFindingId/v1":"3e2c379c6dbfd28661ad267acf8dbaa6219d91ac68f0f60b9a03cee0d020a191"}},{"ruleId":"D6","level":"warning","message":{"text":"Low cohesion: Edge (LCOM4 5): Edge\u0027s methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable \u2014 your repository\u0027s bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected \u2014 and which would otherwise dominate this list \u2014 are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2graph/d2graph.go"},"region":{"startLine":1208}}}],"partialFingerprints":{"codehealthFindingId/v1":"c6906b2708c46947a8f7b8b816f82161246827b00aa64b94d8c12ee4b8236965"}},{"ruleId":"D6","level":"warning","message":{"text":"Low cohesion: Edge (LCOM4 4): Edge\u0027s methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable \u2014 your repository\u0027s bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected \u2014 and which would otherwise dominate this list \u2014 are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/edge.go"},"region":{"startLine":15}}}],"partialFingerprints":{"codehealthFindingId/v1":"cb9234100bab9b55a9e7222c5330286413de74439af6d886f9349a3fdaaf4df0"}},{"ruleId":"D6","level":"warning","message":{"text":"Low cohesion: OVGNode (LCOM4 4): OVGNode\u0027s methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable \u2014 your repository\u0027s bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected \u2014 and which would otherwise dominate this list \u2014 are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/ovg_node.go"},"region":{"startLine":8}}}],"partialFingerprints":{"codehealthFindingId/v1":"0dca0c8e05896d17d1ede0e4a4cd383930a36c0f8a3138c2d1480861e4b9ef5a"}},{"ruleId":"D8","level":"warning","message":{"text":"Coverage not measured \u2014 JavaScript/TypeScript suite: Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured \u2014 the bun:test suite in d2js/js/ ran and not one test passed (bun test v1.3.14 (0d9b296a)), so the coverage would describe the failed run, not the code. Coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository\u0027s maintainers can perform; once it passes, the real number is measured on the next scan."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"62e63e619c28f057e129f2997c965d32a457366a9ce18ca019ffb6bdfba85c99"}},{"ruleId":"D11","level":"error","message":{"text":"Test suite aborts before any test executes: d2js/js/: The bun:test suite in d2js/js/ was installed and launched successfully, and then aborted while loading its own test files \u2014 the bun:test suite in d2js/js/ aborted while loading its own test files, before a single case could run (bun test v1.3.14 (0d9b296a)). Not one test case ran, so this suite cannot detect a regression and its presence overstates how much of this repository is tested. The module it asks for is named by a RELATIVE path, so it can only come from this repository: the file is missing from the tree, and committing it (or removing the spec that requires it) is the ask. This is not a report that the tests FAIL \u2014 they never started."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"bc1ae3cf63b0dae81463b4f7a20b479bc5e2ae2861c1dfcacb714463a9d0e824"}},{"ruleId":"D12","level":"warning","message":{"text":"Dependency pinned to a stale untagged commit: github.com/ericpauley/go-quantize: Direct dependency \u0060github.com/ericpauley/go-quantize\u0060 is required at \u0060v0.0.0-20200331213906-ae555eb2afa4\u0060 in go.mod \u2014 a pseudo-version, which pins an UNTAGGED commit from 2020-03-31, 6.6 years ago. The pin itself is exact, so this is not a reproducibility defect, and it is not a claim that the module is unmaintained. What it says is that this repository tracks no RELEASE of \u0060github.com/ericpauley/go-quantize\u0060 and has not moved this requirement in 6.6 years: every fix the module has published since that commit \u2014 including any security fix \u2014 is absent from this build, whether the module went quiet or moved on without you. Check whether \u0060github.com/ericpauley/go-quantize\u0060 now publishes tagged releases and move the requirement to one; if it publishes none, re-pin to a current commit."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"649834b85d46ae017d6127c9a732d04ea47d69bf74f02f2ff7917a78c43a6b36"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: d2cli/main.go: d2cli/main.go changed 23 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 102 in d2cli.Run at line 62. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-13..2026-10-11, the 90 days ending at the analysed commit. Reproduce with \u0060git log --since=\u00272026-07-13 16:37:38 -07:00\u0027 --until=\u00272026-10-11 16:37:38 -07:00\u0027 --full-history --no-merges -- d2cli/main.go\u0060: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each \u2014 a difference of several commits on a file whose history was re-landed or reverted inside the window."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2cli/main.go"},"region":{"startLine":62}}}],"partialFingerprints":{"codehealthFindingId/v1":"314bfa2737e3cd8851bf1af89131f83dcea830feb4c5e75b0b3ab2a14dc24565"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: d2renderers/d2svg/d2svg.go: d2renderers/d2svg/d2svg.go changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 102 in d2svg.drawShape at line 1688. 2 of those changes were fix/bug commits, and the other 16 changed it for other reasons \u2014 this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one \u2014 a file this often edited pays the complexity back every time. Counted over 2026-07-13..2026-10-11, the 90 days ending at the analysed commit. Reproduce with \u0060git log --since=\u00272026-07-13 16:37:38 -07:00\u0027 --until=\u00272026-10-11 16:37:38 -07:00\u0027 --full-history --no-merges -- d2renderers/d2svg/d2svg.go\u0060: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each \u2014 a difference of several commits on a file whose history was re-landed or reverted inside the window."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svg/d2svg.go"},"region":{"startLine":1688}}}],"partialFingerprints":{"codehealthFindingId/v1":"92550aa84d34a937509d00684fb52c0c73c61feed4b9b498994faff7363a7bc0"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: d2compiler/compile.go: d2compiler/compile.go changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 78 in compiler.compileReserved at line 863. 2 of those changes were fix/bug commits, and the other 12 changed it for other reasons \u2014 this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one \u2014 a file this often edited pays the complexity back every time. Counted over 2026-07-13..2026-10-11, the 90 days ending at the analysed commit. Reproduce with \u0060git log --since=\u00272026-07-13 16:37:38 -07:00\u0027 --until=\u00272026-10-11 16:37:38 -07:00\u0027 --full-history --no-merges -- d2compiler/compile.go\u0060: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each \u2014 a difference of several commits on a file whose history was re-landed or reverted inside the window."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2compiler/compile.go"},"region":{"startLine":863}}}],"partialFingerprints":{"codehealthFindingId/v1":"ab1e06f11fc10dbb06dcf8dde41e206cc043aee2359ee51634c8d5d211e19902"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: d2ir/compile.go: d2ir/compile.go changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 69 in compiler.resolveSubstitutions at line 415. 1 of those changes was a fix/bug commit, and the other 13 changed it for other reasons \u2014 this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one \u2014 a file this often edited pays the complexity back every time. Counted over 2026-07-13..2026-10-11, the 90 days ending at the analysed commit. Reproduce with \u0060git log --since=\u00272026-07-13 16:37:38 -07:00\u0027 --until=\u00272026-10-11 16:37:38 -07:00\u0027 --full-history --no-merges -- d2ir/compile.go\u0060: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each \u2014 a difference of several commits on a file whose history was re-landed or reverted inside the window."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ir/compile.go"},"region":{"startLine":415}}}],"partialFingerprints":{"codehealthFindingId/v1":"721240b8d5be8e3e7c43b7680900ac892188231197299a5a938c163019dde9b2"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: d2layouts/d2elklayout/layout.go: d2layouts/d2elklayout/layout.go changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 93 in d2elklayout.Layout at line 257. 1 of those changes was a fix/bug commit, and the other 9 changed it for other reasons \u2014 this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one \u2014 a file this often edited pays the complexity back every time. Counted over 2026-07-13..2026-10-11, the 90 days ending at the analysed commit. Reproduce with \u0060git log --since=\u00272026-07-13 16:37:38 -07:00\u0027 --until=\u00272026-10-11 16:37:38 -07:00\u0027 --full-history --no-merges -- d2layouts/d2elklayout/layout.go\u0060: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each \u2014 a difference of several commits on a file whose history was re-landed or reverted inside the window."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2elklayout/layout.go"},"region":{"startLine":257}}}],"partialFingerprints":{"codehealthFindingId/v1":"317939e50bfbb2680e7ae8ac947af16f301fd101ef672ed682821bcf5d1ff0ba"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: d2ir/d2ir.go: d2ir/d2ir.go changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 87 in Map.ensureField at line 1216. 1 of those changes was a fix/bug commit, and the other 7 changed it for other reasons \u2014 this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one \u2014 a file this often edited pays the complexity back every time. Counted over 2026-07-13..2026-10-11, the 90 days ending at the analysed commit. Reproduce with \u0060git log --since=\u00272026-07-13 16:37:38 -07:00\u0027 --until=\u00272026-10-11 16:37:38 -07:00\u0027 --full-history --no-merges -- d2ir/d2ir.go\u0060: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each \u2014 a difference of several commits on a file whose history was re-landed or reverted inside the window."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ir/d2ir.go"},"region":{"startLine":1216}}}],"partialFingerprints":{"codehealthFindingId/v1":"71c70f20dc61f4566a0cc6e2234350e5f9dae91a1b37905082119f74522d7bbe"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: lib/textmeasure/markdown.go: lib/textmeasure/markdown.go changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 121 in Ruler.measureMarkdownNode at line 330. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-13..2026-10-11, the 90 days ending at the analysed commit. Reproduce with \u0060git log --since=\u00272026-07-13 16:37:38 -07:00\u0027 --until=\u00272026-10-11 16:37:38 -07:00\u0027 --full-history --no-merges -- lib/textmeasure/markdown.go\u0060: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each \u2014 a difference of several commits on a file whose history was re-landed or reverted inside the window."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/textmeasure/markdown.go"},"region":{"startLine":330}}}],"partialFingerprints":{"codehealthFindingId/v1":"a09beace803992a4e035e1c9392ddea9e10747aa2603a677b23d8ead8277ae9c"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: d2js/d2wasm/functions.go: d2js/d2wasm/functions.go changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 68 in d2wasm.Render at line 351. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-13..2026-10-11, the 90 days ending at the analysed commit. Reproduce with \u0060git log --since=\u00272026-07-13 16:37:38 -07:00\u0027 --until=\u00272026-10-11 16:37:38 -07:00\u0027 --full-history --no-merges -- d2js/d2wasm/functions.go\u0060: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each \u2014 a difference of several commits on a file whose history was re-landed or reverted inside the window."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2js/d2wasm/functions.go"},"region":{"startLine":351}}}],"partialFingerprints":{"codehealthFindingId/v1":"57de9b3d9c061793db120bf07cb1fb9c101f6580c646cafddb6779ba4615394e"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: d2layouts/d2dagrelayout/layout.go: d2layouts/d2dagrelayout/layout.go changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 66 in d2dagrelayout.Layout at line 53. 1 of those changes was a fix/bug commit, and the other 6 changed it for other reasons \u2014 this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one \u2014 a file this often edited pays the complexity back every time. Counted over 2026-07-13..2026-10-11, the 90 days ending at the analysed commit. Reproduce with \u0060git log --since=\u00272026-07-13 16:37:38 -07:00\u0027 --until=\u00272026-10-11 16:37:38 -07:00\u0027 --full-history --no-merges -- d2layouts/d2dagrelayout/layout.go\u0060: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each \u2014 a difference of several commits on a file whose history was re-landed or reverted inside the window."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2dagrelayout/layout.go"},"region":{"startLine":53}}}],"partialFingerprints":{"codehealthFindingId/v1":"135e34c33980c7def25163cf6957f8227fab73981aaf0a7065ca882a75fee678"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: d2themes/element.go: d2themes/element.go changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 51 in ThemableElement.Render at line 138. 2 of those changes were fix/bug commits, and the other 4 changed it for other reasons \u2014 this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one \u2014 a file this often edited pays the complexity back every time. Counted over 2026-07-13..2026-10-11, the 90 days ending at the analysed commit. Reproduce with \u0060git log --since=\u00272026-07-13 16:37:38 -07:00\u0027 --until=\u00272026-10-11 16:37:38 -07:00\u0027 --full-history --no-merges -- d2themes/element.go\u0060: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each \u2014 a difference of several commits on a file whose history was re-landed or reverted inside the window."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2themes/element.go"},"region":{"startLine":138}}}],"partialFingerprints":{"codehealthFindingId/v1":"fd48ea05f7990bfbfcb7d36e74c58ceb41570952b904d060b3436c80e3faffcb"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: d2cli/raster.go: d2cli/raster.go changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 31 in d2cli.renderGIFWithSession at line 555. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-13..2026-10-11, the 90 days ending at the analysed commit. Reproduce with \u0060git log --since=\u00272026-07-13 16:37:38 -07:00\u0027 --until=\u00272026-10-11 16:37:38 -07:00\u0027 --full-history --no-merges -- d2cli/raster.go\u0060: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each \u2014 a difference of several commits on a file whose history was re-landed or reverted inside the window."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2cli/raster.go"},"region":{"startLine":555}}}],"partialFingerprints":{"codehealthFindingId/v1":"518637abd980d878833f2d41a1fd08ea8b013dfa425142d22c80e22d95766917"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: d2layouts/d2layouts.go: d2layouts/d2layouts.go changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 53 in d2layouts.LayoutNested at line 78. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-13..2026-10-11, the 90 days ending at the analysed commit. Reproduce with \u0060git log --since=\u00272026-07-13 16:37:38 -07:00\u0027 --until=\u00272026-10-11 16:37:38 -07:00\u0027 --full-history --no-merges -- d2layouts/d2layouts.go\u0060: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each \u2014 a difference of several commits on a file whose history was re-landed or reverted inside the window."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2layouts.go"},"region":{"startLine":78}}}],"partialFingerprints":{"codehealthFindingId/v1":"4d84251e99b0db50d46eb5ebbeba242235cc253b0ddfc7e7db290991b5efd520"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: d2layouts/d2elklayout/wasm.go: d2layouts/d2elklayout/wasm.go changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 40 in d2elklayout.ConvertGraph at line 23. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-13..2026-10-11, the 90 days ending at the analysed commit. Reproduce with \u0060git log --since=\u00272026-07-13 16:37:38 -07:00\u0027 --until=\u00272026-10-11 16:37:38 -07:00\u0027 --full-history --no-merges -- d2layouts/d2elklayout/wasm.go\u0060: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each \u2014 a difference of several commits on a file whose history was re-landed or reverted inside the window."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2elklayout/wasm.go"},"region":{"startLine":23}}}],"partialFingerprints":{"codehealthFindingId/v1":"53eba4ae2505bc5951ba68d97fac7c24ac6090fd9c0bab29bbbcaf36dcccaa1c"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: lib/xgif/xgif.go: lib/xgif/xgif.go changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 34 in xgif.validatePalettedImage at line 1341. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-13..2026-10-11, the 90 days ending at the analysed commit. Reproduce with \u0060git log --since=\u00272026-07-13 16:37:38 -07:00\u0027 --until=\u00272026-10-11 16:37:38 -07:00\u0027 --full-history --no-merges -- lib/xgif/xgif.go\u0060: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each \u2014 a difference of several commits on a file whose history was re-landed or reverted inside the window."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/xgif/xgif.go"},"region":{"startLine":1341}}}],"partialFingerprints":{"codehealthFindingId/v1":"1b8bd043e8b1efedf3c6c8fd7ff37f3e816b04d44115190510c5b982b16b399e"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: d2renderers/d2raster/effects.go: d2renderers/d2raster/effects.go changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 51 in d2raster.planNodeResources at line 322. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-13..2026-10-11, the 90 days ending at the analysed commit. Reproduce with \u0060git log --since=\u00272026-07-13 16:37:38 -07:00\u0027 --until=\u00272026-10-11 16:37:38 -07:00\u0027 --full-history --no-merges -- d2renderers/d2raster/effects.go\u0060: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each \u2014 a difference of several commits on a file whose history was re-landed or reverted inside the window."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/effects.go"},"region":{"startLine":322}}}],"partialFingerprints":{"codehealthFindingId/v1":"d8d95db4647286af953d13195368274b4dff25036a3d285d14c9f762f7dcaa03"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: d2ir/import.go: d2ir/import.go changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in compiler.__import at line 86. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-13..2026-10-11, the 90 days ending at the analysed commit. Reproduce with \u0060git log --since=\u00272026-07-13 16:37:38 -07:00\u0027 --until=\u00272026-10-11 16:37:38 -07:00\u0027 --full-history --no-merges -- d2ir/import.go\u0060: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each \u2014 a difference of several commits on a file whose history was re-landed or reverted inside the window."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ir/import.go"},"region":{"startLine":86}}}],"partialFingerprints":{"codehealthFindingId/v1":"048fcb1ebc47a6b132e7868e1016bbbc7fc6d9e66e7350c0883d89effa11bed2"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: d2renderers/internal/fontface/shaping.go: d2renderers/internal/fontface/shaping.go changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 75 in ShapingWorkspace.ShapeTextTransient at line 111. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-13..2026-10-11, the 90 days ending at the analysed commit. Reproduce with \u0060git log --since=\u00272026-07-13 16:37:38 -07:00\u0027 --until=\u00272026-10-11 16:37:38 -07:00\u0027 --full-history --no-merges -- d2renderers/internal/fontface/shaping.go\u0060: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each \u2014 a difference of several commits on a file whose history was re-landed or reverted inside the window."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/internal/fontface/shaping.go"},"region":{"startLine":111}}}],"partialFingerprints":{"codehealthFindingId/v1":"68d78f30d9ffa1b2af81ed07a968039187fe6a09e5ea7ad8ae21721e670080b5"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: lib/textmeasure/markdown_svg.go: lib/textmeasure/markdown_svg.go changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in MarkdownLayout.SVG at line 219. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-13..2026-10-11, the 90 days ending at the analysed commit. Reproduce with \u0060git log --since=\u00272026-07-13 16:37:38 -07:00\u0027 --until=\u00272026-10-11 16:37:38 -07:00\u0027 --full-history --no-merges -- lib/textmeasure/markdown_svg.go\u0060: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each \u2014 a difference of several commits on a file whose history was re-landed or reverted inside the window."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/textmeasure/markdown_svg.go"},"region":{"startLine":219}}}],"partialFingerprints":{"codehealthFindingId/v1":"ddc4e29221346767301ac699fb1d077792f1e07f34b89151321348e01582fc24"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: d2renderers/d2raster/raster.go: d2renderers/d2raster/raster.go changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 46 in d2raster.prepareWithSessionBands at line 615. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-13..2026-10-11, the 90 days ending at the analysed commit. Reproduce with \u0060git log --since=\u00272026-07-13 16:37:38 -07:00\u0027 --until=\u00272026-10-11 16:37:38 -07:00\u0027 --full-history --no-merges -- d2renderers/d2raster/raster.go\u0060: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each \u2014 a difference of several commits on a file whose history was re-landed or reverted inside the window."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/raster.go"},"region":{"startLine":615}}}],"partialFingerprints":{"codehealthFindingId/v1":"053b35c91d12033f5a705a42a3fa1e85d3b6b45059af9116614fbe55c3f83997"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: d2cli/paged.go: d2cli/paged.go changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in d2cli.renderPPTXWithRenderer at line 509. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-13..2026-10-11, the 90 days ending at the analysed commit. Reproduce with \u0060git log --since=\u00272026-07-13 16:37:38 -07:00\u0027 --until=\u00272026-10-11 16:37:38 -07:00\u0027 --full-history --no-merges -- d2cli/paged.go\u0060: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each \u2014 a difference of several commits on a file whose history was re-landed or reverted inside the window."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2cli/paged.go"},"region":{"startLine":509}}}],"partialFingerprints":{"codehealthFindingId/v1":"45699029d48a568493b07554582e057588a024f6c31b167c9b407b93f32c9c8a"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: lib/textmeasure/textmeasure.go: lib/textmeasure/textmeasure.go changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in Ruler.scaleUnicodeFallback at line 322. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-13..2026-10-11, the 90 days ending at the analysed commit. Reproduce with \u0060git log --since=\u00272026-07-13 16:37:38 -07:00\u0027 --until=\u00272026-10-11 16:37:38 -07:00\u0027 --full-history --no-merges -- lib/textmeasure/textmeasure.go\u0060: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each \u2014 a difference of several commits on a file whose history was re-landed or reverted inside the window."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/textmeasure/textmeasure.go"},"region":{"startLine":322}}}],"partialFingerprints":{"codehealthFindingId/v1":"073631f9b0b73a205dcb471205598fb74f12b8db19bac49e007f153de7153c52"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: lib/pdf/pdf.go: lib/pdf/pdf.go changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in GoFPDF.AddPDFPage at line 71. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-13..2026-10-11, the 90 days ending at the analysed commit. Reproduce with \u0060git log --since=\u00272026-07-13 16:37:38 -07:00\u0027 --until=\u00272026-10-11 16:37:38 -07:00\u0027 --full-history --no-merges -- lib/pdf/pdf.go\u0060: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each \u2014 a difference of several commits on a file whose history was re-landed or reverted inside the window."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/pdf/pdf.go"},"region":{"startLine":71}}}],"partialFingerprints":{"codehealthFindingId/v1":"247162a64eea56e6e2d59641f09a90f459803f7a3174a53a7c7833bfb0074a8d"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: d2renderers/d2isometric/d2isometricimg/svg.go: d2renderers/d2isometric/d2isometricimg/svg.go changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in d2isometricimg.svgPolygonPath at line 119. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-13..2026-10-11, the 90 days ending at the analysed commit. Reproduce with \u0060git log --since=\u00272026-07-13 16:37:38 -07:00\u0027 --until=\u00272026-10-11 16:37:38 -07:00\u0027 --full-history --no-merges -- d2renderers/d2isometric/d2isometricimg/svg.go\u0060: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each \u2014 a difference of several commits on a file whose history was re-landed or reverted inside the window."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/svg.go"},"region":{"startLine":119}}}],"partialFingerprints":{"codehealthFindingId/v1":"18744abaa2efdf66cad1cd0035b13c7f777c8740281f87c0035d96de58d09701"}},{"ruleId":"D16","level":"note","message":{"text":"Off-boarding risk: anonymized user #1: If anonymized user #1 becomes unavailable, 67 significant file(s) lose their only recent owner: d2oracle/edit.go, lib/textmeasure/markdown_svg.go, d2ir/compile.go, d2renderers/d2raster/effects.go, d2renderers/d2raster/raster.go, d2ir/d2ir.go, lib/xgif/xgif.go, d2renderers/d2raster/gradient.go (\u002B59 more). Pair on, review, or document these before any departure."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"be3d31e971c604e46c96929706cf8a0a6af88bf76268cf319130ad5a7207f072"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO probably use math.Big \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/svg/path.go"},"region":{"startLine":45}}}],"partialFingerprints":{"codehealthFindingId/v1":"726c8792020f9c81501dd3df0ef88b3427afba12523337fe08fc65742b2932fa"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO probably use math.Big \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/label/label.go"},"region":{"startLine":631}}}],"partialFingerprints":{"codehealthFindingId/v1":"148e22224d2d5d0fa117ffbe385856cc7f3692ce5b64465393ea52b91fe53947"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: cleanup \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/shape/shape_page.go"},"region":{"startLine":16}}}],"partialFingerprints":{"codehealthFindingId/v1":"70a9736dc20c70490b71253131104509a22f380160c7cfa2ebbe7ef1a2f48838"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: cleanup \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/shape/shape_page.go"},"region":{"startLine":43}}}],"partialFingerprints":{"codehealthFindingId/v1":"63af54b3e0c17578d26d4dc9e413b16776213f64e3c9d545e911f250ca4d72df"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: implement s command with mirroring last control point \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/shape/shape_person.go"},"region":{"startLine":52}}}],"partialFingerprints":{"codehealthFindingId/v1":"8eecdc8d021883ff090588fa3ced48cf9a9f657c21d4a7eb9e0f678a6903d805"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: get actual edge stroke width on edge \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/label/label.go"},"region":{"startLine":578}}}],"partialFingerprints":{"codehealthFindingId/v1":"93af188613f8e542c583397a43014d07e34294a49cde605f2c7445d85913d8e7"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: //lint:ignore SA4008 TODO this returns before looping? \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/geo/bezier.go"},"region":{"startLine":205}}}],"partialFingerprints":{"codehealthFindingId/v1":"fb2f7b5a9c963fd65fd111f8921a22301b52010de9e092a37c1e8e89accc8873"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: //lint:ignore SA4004 TODO this always returns on the first iteration \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/geo/bezier.go"},"region":{"startLine":215}}}],"partialFingerprints":{"codehealthFindingId/v1":"0981692435d62f1ed369289752cf4e8a19e1e2dd3028f0266c4fbaa39aa02677"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO tempdir is random, resulting in different test results each time with the links \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"e2etests-cli/main_test.go"},"region":{"startLine":323}}}],"partialFingerprints":{"codehealthFindingId/v1":"6250af3bd5a8a6bf7f218263c43b57d6e052de6eaa9a3739713e5745c325afa4"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO we can just call el.Copy() to prevent that \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2themes/sketch_overlay.go"},"region":{"startLine":21}}}],"partialFingerprints":{"codehealthFindingId/v1":"8227a4905571441f3c3958895eab928c166f7238099b06d8d248194bc2b6775c"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO remove this function, just set fields on themeable \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2target/d2target.go"},"region":{"startLine":838}}}],"partialFingerprints":{"codehealthFindingId/v1":"873860940532a94eded646edbd1af4e4423cf61b0f203ae8f04edbc83627e189"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO make darker color part of the theme? or just keep this bypass \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svg/d2svg.go"},"region":{"startLine":1673}}}],"partialFingerprints":{"codehealthFindingId/v1":"074e08a39a661c16b4f4e0d475d9969d87797211ffabb87dd68d09daac1ee870"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO should standardize \u0022\u0022 to rectangle \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svg/d2svg.go"},"region":{"startLine":1833}}}],"partialFingerprints":{"codehealthFindingId/v1":"dfb54959c3df8478b154c18f684cb886fd549d62bedbf9a2b6fe58c7e4a2f912"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO need to personalize this per shape like we do in Terrastruct app \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2sketch/sketch.go"},"region":{"startLine":292}}}],"partialFingerprints":{"codehealthFindingId/v1":"9e9e2ad448232178f214b13174e5f540002210d30fda000cf55d7fc83b18a6ac"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO cleanup \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2sketch/sketch.go"},"region":{"startLine":436}}}],"partialFingerprints":{"codehealthFindingId/v1":"dedc002ba837930c5ffd3f44e4a5ddf591358756ab88ebfdbe3bc0bb44e67a7c"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO write a script to do this as part of CI \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2fonts/d2fonts_common.go"},"region":{"startLine":7}}}],"partialFingerprints":{"codehealthFindingId/v1":"f9e11649367614779ea02bb1b9a328e5485d7501d30d26525e7eaf9f762316ae"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO account for stroke width of root border \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2animate/d2animate.go"},"region":{"startLine":52}}}],"partialFingerprints":{"codehealthFindingId/v1":"9d09c5dba4f6b6a072474ad1a5a4cb5fda4e074aab71e610052bf172abe54616"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: update godocs \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2parser/parse.go"},"region":{"startLine":46}}}],"partialFingerprints":{"codehealthFindingId/v1":"128c13532938d5d3e2838dd9388f5e49d7272456ec42ad2e01a3f0e429cdd4bd"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: refactor parser to keep entire file in memory as []rune \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2parser/parse.go"},"region":{"startLine":151}}}],"partialFingerprints":{"codehealthFindingId/v1":"b185e9c081feb52dfacd7b4cd0200a574b1f63b6057fb145e9082d8263ad0185"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: ast struct that combines map \u0026 errors and pass that around \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2parser/parse.go"},"region":{"startLine":158}}}],"partialFingerprints":{"codehealthFindingId/v1":"59ca9461b49235ea3d1748392a3cfc9ea42cbe2cf9abd90e475b9baee7495cae"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: rename to Error and make existing Error a private type errorWithRange \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2parser/parse.go"},"region":{"startLine":186}}}],"partialFingerprints":{"codehealthFindingId/v1":"853431f70f6629faad01f279c9373e2a37b9a7798e1517d3582867725698da6c"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: this can replace multiple peeks i think, just return []rune instead \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2parser/parse.go"},"region":{"startLine":341}}}],"partialFingerprints":{"codehealthFindingId/v1":"6d53136cb231c9ef301af743de6072482529003ecb8967b893f328cc5adfae8e"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: everywhere this is used, we support newline escapes and so can just \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2parser/parse.go"},"region":{"startLine":372}}}],"partialFingerprints":{"codehealthFindingId/v1":"e526a3805b0ed703d62e5e43a19b26e22661f4d3f1e6fe5e9595d441d9431a8a"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2parser/parse.go"},"region":{"startLine":400}}}],"partialFingerprints":{"codehealthFindingId/v1":"741814ec029fc6d6e808b9a1a2f300ffca0a57293e3f677584b3c9f312351079"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: make each parse function read its delimiter and return nil if not as expected \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2parser/parse.go"},"region":{"startLine":407}}}],"partialFingerprints":{"codehealthFindingId/v1":"22adb90e8ec8c2dd4b44654498431fa1e1533673ac485634d65f27af603ab13d"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: lookahead *must* always be empty in between parse calls. you either commit or \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2parser/parse.go"},"region":{"startLine":408}}}],"partialFingerprints":{"codehealthFindingId/v1":"c2e086f4531fdfabdee0c9c41776d899c98b2c35beebf60b2b62438966f3c14d"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: omg we don\u0027t need two buffers, just a single lookahead and an index... \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2parser/parse.go"},"region":{"startLine":412}}}],"partialFingerprints":{"codehealthFindingId/v1":"cef69ccbe44b25672e5ac725fa5d4b78f81488db7e8cf6dd49d5acd0f3c6b32d"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: get rid of lookaheadPos or at least never use directly. maybe rename to beforePeekPos? \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2parser/parse.go"},"region":{"startLine":413}}}],"partialFingerprints":{"codehealthFindingId/v1":"803db86b8ffd03710ac376c81e1a6093fae05bfc9ce6948432451608157bae0e"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: remove isFileMap like in printer. can\u0027t rn as we have to subtract delim \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2parser/parse.go"},"region":{"startLine":442}}}],"partialFingerprints":{"codehealthFindingId/v1":"eed412dd4abbf6df7348ecc7dfaea2f26e9008d2d350a2c2894a1a81b2750240"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: all subsequent not comment characters on the current line (or till ;) \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2parser/parse.go"},"region":{"startLine":485}}}],"partialFingerprints":{"codehealthFindingId/v1":"8e982da2e8ac90fd5b24f15ce5e8973a661fdcdf6f1197d001fe1cef578ea2d7"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: add specific msg for each bad rune type \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2parser/parse.go"},"region":{"startLine":487}}}],"partialFingerprints":{"codehealthFindingId/v1":"c9f626c282ea59f90778b63bafc7242174d4229f5feafad856d4233bfbd7b53b"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: maybe better idea here is to make parseUnquotedString aware of its delimiters \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2parser/parse.go"},"region":{"startLine":505}}}],"partialFingerprints":{"codehealthFindingId/v1":"87a068bd01a5e8a76c211abd8e97a6f00805810a6ad9b7e38e6a7248b5b81788"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: that way broken syntax will be parsed more \u0022intently\u0022. would work better with \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2parser/parse.go"},"region":{"startLine":507}}}],"partialFingerprints":{"codehealthFindingId/v1":"13971c919e84cb23f110701a01f477c0ea1f625daec4afbb640fac781af5ed1b"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: skip to ], maybe add a p.skipTo to skip to certain characters \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2parser/parse.go"},"region":{"startLine":932}}}],"partialFingerprints":{"codehealthFindingId/v1":"8a1167521bf0e6ab138325d1c481e08aaacc059e4d305e6c0aa5ee18980ad8cc"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: error if begin, but see below too \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2parser/parse.go"},"region":{"startLine":1068}}}],"partialFingerprints":{"codehealthFindingId/v1":"ad3442b958e9f5f5288a2b8e878c0a49792818d0f96f3379b323684ae72c1e14"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: error if not string or ( after, see above too \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2parser/parse.go"},"region":{"startLine":1096}}}],"partialFingerprints":{"codehealthFindingId/v1":"ee2be8fa7bf2ed0effbb9224dc0bc57f3b0a21412cd2aa218fd232b1885c83ec"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: inKey -\u003E p.inKey (means I have to restore though) \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2parser/parse.go"},"region":{"startLine":1101}}}],"partialFingerprints":{"codehealthFindingId/v1":"9fe434f6904c44ebb7272840fc68f0e42e0c9f095566c6ef3707da1762ce8a8f"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: fix unquoted end whitespace handling to peekNotSpace \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2parser/parse.go"},"region":{"startLine":1136}}}],"partialFingerprints":{"codehealthFindingId/v1":"ff0a8a3f35f04a9d530603baf7afa997a2071ec08d47230a47810e05b16d71ef"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: this should be in the parent and instead they check the delimiters first \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2parser/parse.go"},"region":{"startLine":1160}}}],"partialFingerprints":{"codehealthFindingId/v1":"26d0df95332837e8f914860568d033b67b0f54d6dbd5a62fd64886565d4a52b9"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: give specific descriptions for each kind of special character that could have caused this. \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2parser/parse.go"},"region":{"startLine":1162}}}],"partialFingerprints":{"codehealthFindingId/v1":"b4762780e7eceac4134b5c22e6cf9e087d65a52791a22eb17f3855cdff20f4be"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: need a peekNotSpace across escaped newlines \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2parser/parse.go"},"region":{"startLine":1193}}}],"partialFingerprints":{"codehealthFindingId/v1":"fe88afe28e6a6894b3157f2d3cbdbcd8d87a77dd64bb40419d91c2176bb1b28a"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: need a peekNotSpace across escaped newlines \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2parser/parse.go"},"region":{"startLine":1230}}}],"partialFingerprints":{"codehealthFindingId/v1":"a5af94272870d2192d1fab31428196069d8ada73156fe7c4c72af9314f1df85a"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: implement all Go escapes like the unicode ones \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2parser/parse.go"},"region":{"startLine":1331}}}],"partialFingerprints":{"codehealthFindingId/v1":"6939f97b386217c03934f5c7bcfef65294aa3bfa6425a5e7fb4d172c117a22f4"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: deindent \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2parser/parse.go"},"region":{"startLine":1419}}}],"partialFingerprints":{"codehealthFindingId/v1":"73616d0dabe756b4c6d6160a89f15f0835b99c5adfaf735e6b8ebf03e0b5a9d9"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: no and fix compiler to not set text/markdown shape always. \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2parser/parse.go"},"region":{"startLine":1541}}}],"partialFingerprints":{"codehealthFindingId/v1":"8f73a5c823cfde08d6a86309d1fa722742b4d41012ff1d2941861f2bab76e894"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: only if matches regex \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2parser/parse.go"},"region":{"startLine":1807}}}],"partialFingerprints":{"codehealthFindingId/v1":"c1596d67a009ba210cc1418b62ccb4eee8512f4bee06561718d2f66a4d31a2b4"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // \t\t// TODO: Need to encode specials and quotes. \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2parser/parse.go"},"region":{"startLine":1915}}}],"partialFingerprints":{"codehealthFindingId/v1":"5ab24a82e527bd96770e09c00b691a8973797b3733b0cd6a73e869653cf22e3a"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: next step for parser is writing as many tests and grouping them nicely \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2parser/parse_test.go"},"region":{"startLine":61}}}],"partialFingerprints":{"codehealthFindingId/v1":"a30d7aa2b4e3cb4ebfaaad5bfcbd9ca188d3826316fa4dca775f53a05f921f26"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: add assertions \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2parser/parse_test.go"},"region":{"startLine":62}}}],"partialFingerprints":{"codehealthFindingId/v1":"b072f99c66ac15449196662fb1e8314048028433df866f5761f660176798add7"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO beter name \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2oracle/edit.go"},"region":{"startLine":43}}}],"partialFingerprints":{"codehealthFindingId/v1":"d8e511907859e5d3343298f75781b7191025e8b3f62f415ad9e327e726a8f7f0"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO beter name \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2oracle/edit.go"},"region":{"startLine":102}}}],"partialFingerprints":{"codehealthFindingId/v1":"dc42b08e1109fde2bf3f5999c462c8f322a40060417a114408e44324ab54ab1a"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO beter name \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2oracle/edit.go"},"region":{"startLine":149}}}],"partialFingerprints":{"codehealthFindingId/v1":"fc649f173a77cadafa2c8f8c139b0f35dd2bb0560838b9d253fe7a8b5de8d9ff"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO beter name \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2oracle/edit.go"},"region":{"startLine":962}}}],"partialFingerprints":{"codehealthFindingId/v1":"d0a044a45d96a78de74444c64a51a40ba9a0bbbe3e542a826e7d5f2d98cdc172"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO beter name \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2oracle/edit.go"},"region":{"startLine":1779}}}],"partialFingerprints":{"codehealthFindingId/v1":"2563263dd240fb8854c9776478b65406943c983a5112903dd0b36f2bb605e6d8"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: update graph in place when compiler can accept single modifications \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2oracle/edit.go"},"region":{"startLine":78}}}],"partialFingerprints":{"codehealthFindingId/v1":"f3f00849f0019dbb7018c3ca3a7e0cefd27a1d061914317226d4d37c547996a9"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: go through all references to decide best spot to insert something \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2oracle/edit.go"},"region":{"startLine":79}}}],"partialFingerprints":{"codehealthFindingId/v1":"56bf769fe82abbfde39003e060c7cccf410bc477e10f034bf4307d90a843995b"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO null \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2oracle/edit.go"},"region":{"startLine":213}}}],"partialFingerprints":{"codehealthFindingId/v1":"b809203e7e22f02b64e58a8b6a55fd8d5b8ba59d05d9e5f2ae15882aff36f0cd"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO merge flat styles \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2oracle/edit.go"},"region":{"startLine":326}}}],"partialFingerprints":{"codehealthFindingId/v1":"cff5cee030f828a0584921c0ffdc5f0d833efe064516c8d02354052feeff6189"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO merge flat edgekeys \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2oracle/edit.go"},"region":{"startLine":567}}}],"partialFingerprints":{"codehealthFindingId/v1":"fc9391063fc3a099bd0b6e6a1c0196eeae2a5cb484caa8ad898458d6c2879ad6"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO get the most nested one \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2oracle/edit.go"},"region":{"startLine":622}}}],"partialFingerprints":{"codehealthFindingId/v1":"278aeed6b25e9048227e3f329c8a37572e80e1b3da7dec8494d548ea00d14b51"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: This needs to be smarter as certain keys are only reserved in context. \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2oracle/edit.go"},"region":{"startLine":923}}}],"partialFingerprints":{"codehealthFindingId/v1":"fea2af750c757b56840b8aadcbde2bf3df1da59291472c023af7d7a248e14a40"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO boardPath \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2oracle/edit.go"},"region":{"startLine":1303}}}],"partialFingerprints":{"codehealthFindingId/v1":"e82b5730dabb3b0347e7bcca580cce755208d1515f6c2fa6b9781a863b7e48bc"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: Not a fan of this dual interpretation depending on mk.Edges. \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2oracle/edit.go"},"region":{"startLine":1717}}}],"partialFingerprints":{"codehealthFindingId/v1":"3b2d5e03e6d358fd90baf4ce4d9d1b1f43d58c21108ebb2b3294365bb3e6451f"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: Handle mk.EdgeKey \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2oracle/edit.go"},"region":{"startLine":1742}}}],"partialFingerprints":{"codehealthFindingId/v1":"e6f169ec9c086557678f79463293d0e5382e4990f0f5ecd1aa22150ab4f90b86"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO just prevent moving edges at all \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2oracle/edit.go"},"region":{"startLine":1805}}}],"partialFingerprints":{"codehealthFindingId/v1":"ca3763f0676c9d65159068b13ccc9eaf54889abc477a3274694438bd4b632fa4"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO get rid of repetition \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2oracle/edit.go"},"region":{"startLine":2340}}}],"partialFingerprints":{"codehealthFindingId/v1":"6dc1c801ad646db139ed75c8b9e7d6e433f6e977d6f07a5f6344fb89c19fc194"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: make assertions less specific \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2oracle/edit_test.go"},"region":{"startLine":23}}}],"partialFingerprints":{"codehealthFindingId/v1":"5fa65ee8c54148b64d012cf9e20187d86ef839a5e6b49f94d7072d576046ec18"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: move n objects and n edges assertions as fields on test instead of as callback \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2oracle/edit_test.go"},"region":{"startLine":24}}}],"partialFingerprints":{"codehealthFindingId/v1":"5468d068e4f6a894a42dc4412fd230abf81cc3d35bbeebdaabdda79021382998"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: pass \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2oracle/edit_test.go"},"region":{"startLine":1982}}}],"partialFingerprints":{"codehealthFindingId/v1":"bb0ef35d3b222d0e264e579b5cf2c5c3781bf7b1d57421e2497175c2b1fe4b87"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: pass \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2oracle/edit_test.go"},"region":{"startLine":2002}}}],"partialFingerprints":{"codehealthFindingId/v1":"e80ce1d7f835990f43c69b0dca0be2366bf146c0a60ad7e31cca92e301e1f708"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2oracle/edit_test.go"},"region":{"startLine":4530}}}],"partialFingerprints":{"codehealthFindingId/v1":"a0846b4ec11577331e60fb35824a684e6a53e3dad7a7a0f6807ad76d1d9671dd"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO the heuristic for splitting open new maps should be only if the key has no existing maps and it also has either zero or one children. if it has two children or more then we should not be opening a map and just append the key at the most nested map. \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2oracle/edit_test.go"},"region":{"startLine":5298}}}],"partialFingerprints":{"codehealthFindingId/v1":"7cb7fa4073d4175d9d4d40e52f86f7f0b3c008fcdc0234864cbceca8506f7c17"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: delete disks.id as it\u0027s redundant \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2oracle/edit_test.go"},"region":{"startLine":7541}}}],"partialFingerprints":{"codehealthFindingId/v1":"2096a7fc36a3bee1320178fa75061d3d21967c2aa43415708956a5ee82fc6a41"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO Probably rename later \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2oracle/get.go"},"region":{"startLine":141}}}],"partialFingerprints":{"codehealthFindingId/v1":"5e799d9d999cc386033723b98507a6157b80f5d6a45e461a026933ac6f16921e"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO maybe some will want to configure code font too, but that\u0027s much lower priority \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2lib/d2.go"},"region":{"startLine":63}}}],"partialFingerprints":{"codehealthFindingId/v1":"deaeb3a8cc4b890f52263455ece889d197c699c85e9e4fd65f0304315554a347"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO replace simple straight line edge routing \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2layouts.go"},"region":{"startLine":378}}}],"partialFingerprints":{"codehealthFindingId/v1":"75f6d245b5e1eddb3e5ce3ce3803a9c5f6da2a89135f6f17759aac5c6ea1aa99"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO update minWidth/minHeight logic \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/adapter.go"},"region":{"startLine":444}}}],"partialFingerprints":{"codehealthFindingId/v1":"9e84f3687c99939642c5364c96c2076e72e44e7e7faca61abd7f82e13a0adac5"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: Compare this adjacency matrix with repeated ConnectionTo lookups. \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/trees/layout.go"},"region":{"startLine":29}}}],"partialFingerprints":{"codehealthFindingId/v1":"dc7c140aea1836f9c56c9dc5e50c0ca7f5e8faf1a6254a1bcf4dff32ee860067"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: place trees early enough that they are restored before Near placement. \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/trees/layout.go"},"region":{"startLine":55}}}],"partialFingerprints":{"codehealthFindingId/v1":"48276f370b1cee4d93b804a6f588c08666ccccd81a6055772c7a8ffa5ae9d59b"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: investigate why this has to be in RDFSOrder \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/trees/layout.go"},"region":{"startLine":223}}}],"partialFingerprints":{"codehealthFindingId/v1":"52c1891c3288739051c6df16c33f6a2bc9f51843cdbaa3e0235002e55e5afe0d"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO find a better solution for edge routing with labels. Shared edges with \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/coordinator.go"},"region":{"startLine":1254}}}],"partialFingerprints":{"codehealthFindingId/v1":"c1277d4def976edb88dd324ad75b32575751935b9f297a80bb9f7e7d10a01f46"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO support overlapping bidirectional edges with different source/target arrowheads. \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/coordinator.go"},"region":{"startLine":1281}}}],"partialFingerprints":{"codehealthFindingId/v1":"f56c14867e7c4cfb69f6a8d60ac2e18aa0cb0d55756ec9966478025005142adb"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO if any OVG nodes are too close to container edge, split them \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/ovg.go"},"region":{"startLine":206}}}],"partialFingerprints":{"codehealthFindingId/v1":"c27a7acf777a43056e966efea9e178857df5bf70394efaec632a77688e8fde7d"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO don\u0027t have cross section of port nodes from container to descendants \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/ovg.go"},"region":{"startLine":385}}}],"partialFingerprints":{"codehealthFindingId/v1":"fb3ec442aa588ee4d5d99cef99a4ed6bd21353b326ef3211e14204705a01e2b4"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO move to d2 as Equals, rename existing to NilEquals \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/ovg_edge.go"},"region":{"startLine":37}}}],"partialFingerprints":{"codehealthFindingId/v1":"064e15cfbce2bd6ef58eb7d083a7fa9078a2318cf134b00568a756c3d8aa7f78"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: allow bidirectional edges with different arrowheads to overlap in the \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/route.go"},"region":{"startLine":85}}}],"partialFingerprints":{"codehealthFindingId/v1":"47caf9d78027ac24205413f5db2b2e33bb88d683470f4316ed173f606eba11cd"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: //   - TODO can iterate on this to allow some instances \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/route.go"},"region":{"startLine":196}}}],"partialFingerprints":{"codehealthFindingId/v1":"c47a6135b9e279e7faa54157a7f0fae6009c6834c95b73b233b9e9625761b1d8"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO consider min distance for labels \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/route.go"},"region":{"startLine":200}}}],"partialFingerprints":{"codehealthFindingId/v1":"5f95e970057bce904653b32e73c39577a136ee6ac55b28407589e8f10e992e6d"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: remove \u0060len(e.Points) \u003C 3\u0060 and handle straight edges \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/swap_ports.go"},"region":{"startLine":40}}}],"partialFingerprints":{"codehealthFindingId/v1":"6eea9a22f70660d8d776e1a5997ec22615394be7bda295b96fc7e77d2a4f9be3"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: some ideas to improve later on \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/swap_ports.go"},"region":{"startLine":272}}}],"partialFingerprints":{"codehealthFindingId/v1":"2af766200810c3feec51269257709af0f83888f4176186b34f703277ff628c78"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: see the straight line strategy above that could also be applied here \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/swap_ports.go"},"region":{"startLine":289}}}],"partialFingerprints":{"codehealthFindingId/v1":"016000d5db786c16543e1c50cc1ac54d1dc00e8e013ce1575e935df30082b00a"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: specific improvements for U-shaped routes \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/swap_ports.go"},"region":{"startLine":291}}}],"partialFingerprints":{"codehealthFindingId/v1":"0f3f12025b6b2039fd541d75fa4b8b20618d1c3caea0f79da217d57fd5b5d831"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: try improvements along the edge \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/swap_ports.go"},"region":{"startLine":320}}}],"partialFingerprints":{"codehealthFindingId/v1":"0187d53c8d76ffd651ec2648ff5eb35d85a3bb620bc9001c5423a38d4c12ab20"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO reconsider this \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/compaction.go"},"region":{"startLine":337}}}],"partialFingerprints":{"codehealthFindingId/v1":"c6768c0ec7b1f956ab294255996f42f3840307bd028b2c8f9f90f9f24188de61"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: support correcting U-turns. \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/dejitter.go"},"region":{"startLine":89}}}],"partialFingerprints":{"codehealthFindingId/v1":"302f74d51152bcf2eab4940a45ac2fadd0688a5464a4ab843ed7a6dc04018372"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO 150 seems a bit large for ideal gap size \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/gapreduction.go"},"region":{"startLine":417}}}],"partialFingerprints":{"codehealthFindingId/v1":"6d9298b7130f4597c6403f3587ead18b5cd140d04ae17dc6ed118bd27076fd92"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: add bidirectional gap-normalization coverage proving both outer nodes \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/gapreduction_test.go"},"region":{"startLine":194}}}],"partialFingerprints":{"codehealthFindingId/v1":"062902eeb6459b92628a7725c359553dd22c7de24674d6a27f55d21827d726ed"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO improve by computing minimum width/height (width \u003E= widest child \u002B padding, width \u003E= rightmost fixed child) \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/node_placement.go"},"region":{"startLine":73}}}],"partialFingerprints":{"codehealthFindingId/v1":"53d1e97749da6c76b4292dd4879b477de5ce0d23fdc8a86a5a9cb143d9f64a3f"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: this must be a better check, like only select the nodes that must be placed \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/node_placement.go"},"region":{"startLine":169}}}],"partialFingerprints":{"codehealthFindingId/v1":"3727de418f74496235de22dd727ea062df8545551cfb83e8cb616df425e9e6dc"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO (Mon Sep 20 10:57:17 2021) These maybe should be true on enforcing gap size, since when we swap, we don\u0027t want resulting swap to be too squished \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/sized_optimizer.go"},"region":{"startLine":1030}}}],"partialFingerprints":{"codehealthFindingId/v1":"53e1a7548941d04bf20bc894930d50f599a4eda3ff6807b393c33b2e77e9e498"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO (Mon Sep 20 10:57:17 2021) These maybe should be true on enforcing gap size, since when we swap, we don\u0027t want resulting swap to be too squished \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/sizeless_optimizer.go"},"region":{"startLine":480}}}],"partialFingerprints":{"codehealthFindingId/v1":"b301613617e5c68cccd6aee3409aae91906d285053e35eea87c529dcbc0fc64b"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: some tests that are worth considering in the future \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/sized_optimizer_test.go"},"region":{"startLine":69}}}],"partialFingerprints":{"codehealthFindingId/v1":"139c7aa0b77e15e287cd24aa5a9c85dd38d7d960ba9e6f550e973a62cf858529"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: fix. We should get (d \u002B 1)^2 = 4 points \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/sized_optimizer_test.go"},"region":{"startLine":397}}}],"partialFingerprints":{"codehealthFindingId/v1":"c881e5436893bce492f3981d9b54674963197e1d158f1e07c4d4522f30c695e1"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: once fixed, test the coordinates too \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/sized_optimizer_test.go"},"region":{"startLine":400}}}],"partialFingerprints":{"codehealthFindingId/v1":"bb1a9651898032a7a85b0874a0abe52bed9d9b8735111b59e1835b5f859cf763"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO perhaps there\u0027s better algorithms here \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/packing/binpack.go"},"region":{"startLine":498}}}],"partialFingerprints":{"codehealthFindingId/v1":"b9c911c69b53a61683e50d445f702d1a5cca25b6ba9330468303b932a70c6222"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO ideally the placement candidates should also take into account which direction it can move \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/packing/binpack.go"},"region":{"startLine":564}}}],"partialFingerprints":{"codehealthFindingId/v1":"a0823028b633b005ff09cdf40ef90454cd3b10c1a5d30d1933c839f5182f4280"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO handle candidate overlap with the root before committing. \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/packing/binpack.go"},"region":{"startLine":637}}}],"partialFingerprints":{"codehealthFindingId/v1":"a82a040823171dea8c27173c5f6adcc0b840458d97b1955c3cb25a8b09a82e84"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: if top-right and bottom-left are available, it can overlap with one of them as it would be able \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/packing/binpack.go"},"region":{"startLine":1122}}}],"partialFingerprints":{"codehealthFindingId/v1":"e6faad5c90c492702f18271b0e5ea101d9e509929b3175c00c2705b167583923"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO maybe not \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/graph.go"},"region":{"startLine":1083}}}],"partialFingerprints":{"codehealthFindingId/v1":"e152625507b15a1436412c0373cbf659a74cf27974131a628576c9b72b667db3"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO (Mon Mar 28 21:06:30 2022) The ideal is perhaps having it prefer the outer borders, but that\u0027s a lot of work for a dubious use case \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/layout.go"},"region":{"startLine":202}}}],"partialFingerprints":{"codehealthFindingId/v1":"6f05466eaaceca7bdfdb7ca764b1f67127c28f0284a4f4e6dc3af1f11ded8f6a"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO move type Spacing to d2 and update GetDimensionsToFit for all shapes \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/node.go"},"region":{"startLine":70}}}],"partialFingerprints":{"codehealthFindingId/v1":"1610d753350c805eb2e502808947590b71fc8909e65a87adefc4490db38a05df"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: verify whether this correctly finds all overlapping ports. \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/node.go"},"region":{"startLine":180}}}],"partialFingerprints":{"codehealthFindingId/v1":"bf2dd4cc5eb48da8dcca1dffe452bf4100acae2e6e9ce843e0912c039cafcd1c"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: consider caching this distance \u0026 comparison as it\u0027s the same computed a few lines above \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/node.go"},"region":{"startLine":398}}}],"partialFingerprints":{"codehealthFindingId/v1":"0ec32fd397fb0f7e5f618ce4202a56f0d586851b2f0230862aba9607967f745b"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO (Sun Apr 10 16:07:25 2022) this doesn\u0027t take edge abductions into consideration, so it may not find a minWidth to a child \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/node.go"},"region":{"startLine":805}}}],"partialFingerprints":{"codehealthFindingId/v1":"1caec010a5a9c954127e5fcd0d80f6b1e5098684fa6ef20b897014799e17141e"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO move to d2 geo.Box \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/node.go"},"region":{"startLine":991}}}],"partialFingerprints":{"codehealthFindingId/v1":"198426188128685f47a3795c2de0d8f0bae682f180e43c6dbc95bc38d032dca0"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: extract to \u0060geo\u0060 package \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/node.go"},"region":{"startLine":1407}}}],"partialFingerprints":{"codehealthFindingId/v1":"703671c9005da4c6de217c831107388acb66cdab243f5e422a2bb6f61e3c6f0a"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO for some reason e.From.Graph isn\u0027t populated with containers, so we pass mainGraph instead \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/node.go"},"region":{"startLine":1846}}}],"partialFingerprints":{"codehealthFindingId/v1":"a50d7fa53667533e1d40cbd9ab45aba2999470c00422d1836c29637f095409f6"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO update d2\u0027s GetInsidePlacement to take Spacing \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/node.go"},"region":{"startLine":2214}}}],"partialFingerprints":{"codehealthFindingId/v1":"51c138208bd59c2cdf35e0d087842a14c5c6b7e5aa16d39aa20551313936dbd6"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: restore symmetry coverage for differently sized and mirrored nodes \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/node_test.go"},"region":{"startLine":532}}}],"partialFingerprints":{"codehealthFindingId/v1":"97e98413400e3b9ece3dcc4c57598008480176bf5387d596b8c559825a16e5e2"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO by this logic I think we need to run reposition containers again after syncCluster, but can\u0027t find a scenario where it matter \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/transaction.go"},"region":{"startLine":1207}}}],"partialFingerprints":{"codehealthFindingId/v1":"53898d0d0c1f43f354eacbb7e9153d35f4b795942aaeebdd14dabc5db9b372f0"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO account for nearby nodes and cascading nested-container expansion \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/engine/pipeline.go"},"region":{"startLine":343}}}],"partialFingerprints":{"codehealthFindingId/v1":"0d40e1bf7c37513f702a45d49f08b5f2983136c604efbe26f426e8cac26a32bc"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO lower \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2sequence/constants.go"},"region":{"startLine":8}}}],"partialFingerprints":{"codehealthFindingId/v1":"e9cf5d1170cd1d16aa95fa1be4ab76a291778b54cd174869decbfb5922b0c72c"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO why not? Spans should be able to \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2sequence/sequence_diagram.go"},"region":{"startLine":161}}}],"partialFingerprints":{"codehealthFindingId/v1":"0b477751e170e0618e6b4cfcc39d96c3228e7ea45d2da3477e8d1ad9d5a56c84"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO if object is a nested grid, consider growing descendants according to the inner grid layout \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2grid/layout.go"},"region":{"startLine":389}}}],"partialFingerprints":{"codehealthFindingId/v1":"083cb58fe749f78d4fb13982a6208398d2879ab38a53f8808dbacefc41de330e"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO there might be value in repeating this. removal of an S shape introducing another S shape that can still be removed \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2elklayout/layout.go"},"region":{"startLine":784}}}],"partialFingerprints":{"codehealthFindingId/v1":"2a11d3d687baeb9a15936c3e223b7fbcf338a4a1581c8e4198fb617466ccad29"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO consider having different Scalar types \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2graph/d2graph.go"},"region":{"startLine":155}}}],"partialFingerprints":{"codehealthFindingId/v1":"9ef1b9d44394d88cb6c69e00015623fe65855bcd6a1177ff4af5eb9fd1e453ff"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO maybe rename to Shape \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2graph/d2graph.go"},"region":{"startLine":162}}}],"partialFingerprints":{"codehealthFindingId/v1":"7d3bc8b1a92dc00f899c8aa9b88ebd63f80d8a2d34da166f025e95f2302d2f3e"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO consider separate Attributes struct for shape-specific and edge-specific \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2graph/d2graph.go"},"region":{"startLine":210}}}],"partialFingerprints":{"codehealthFindingId/v1":"e279a663f6000ca8c45ea2648641f7fedf2e3f7c5c43dfd461910ad6776c1f3d"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: default to ShapeRectangle instead of empty string \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2graph/d2graph.go"},"region":{"startLine":214}}}],"partialFingerprints":{"codehealthFindingId/v1":"631818bafc7b04e35cae709438b48197057480f4922b70b713913178bdcbdf3a"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: remove once not used anywhere \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2graph/d2graph.go"},"region":{"startLine":774}}}],"partialFingerprints":{"codehealthFindingId/v1":"924ede9ea420a0f88c254457892915d28c7e2485ca4eddaf8a5c1c0017a489f4"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: remove edges []edge and scope each edge inside Object. \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2graph/d2graph.go"},"region":{"startLine":815}}}],"partialFingerprints":{"codehealthFindingId/v1":"7dadc4822dbb8986eedbae9adc06bb8009c74275bcf209e6476eeb0894267735"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO alixander (Mon Sep 12 2022): deprecate SrcArrow and DstArrow and just use SrcArrowhead and DstArrowhead \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2graph/d2graph.go"},"region":{"startLine":1224}}}],"partialFingerprints":{"codehealthFindingId/v1":"a4ed243dd60a7f862de2ec5be65d4dcb28551b96471a08cd711b7115cb40b23f"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: Unified string syntax. \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2format/escape.go"},"region":{"startLine":16}}}],"partialFingerprints":{"codehealthFindingId/v1":"45aa8d53b25cfe2f85bedba91eaba78f86d70ab1dcf270a9467a2cfa60bd18c3"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: chaos test each \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2format/escape_test.go"},"region":{"startLine":294}}}],"partialFingerprints":{"codehealthFindingId/v1":"8a76981811028126c1ff4a850e7bd4c6b137de5678ece1fa2537a3b95cd69980"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: edges with shared path should be fmted as \u003Crel\u003E.(x -\u003E y) \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2format/format.go"},"region":{"startLine":11}}}],"partialFingerprints":{"codehealthFindingId/v1":"f6d46c18d826d283fee2db1e057871ba4897b127772d9310b4d5f0213eadf7d0"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO add more, e.g. C, bash \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2compiler/compile.go"},"region":{"startLine":1373}}}],"partialFingerprints":{"codehealthFindingId/v1":"97c364dd8cc1737bcdf3230af94394051901544bde00b4bfbf958e1959987d9a"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: Not great, AST should easily allow specifying alternate primary field \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2compiler/compile.go"},"region":{"startLine":1423}}}],"partialFingerprints":{"codehealthFindingId/v1":"315f6d06f5fcaa88e4fe9c321e9ffa11313924f49777eab815f3443362393998"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO this is a temporary solution: https://github.com/d2lang/util-go/issues/7"},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2cli/main.go"},"region":{"startLine":353}}}],"partialFingerprints":{"codehealthFindingId/v1":"45b654a9d8384331a7baef04ed1dee77e09913d08834bb36ce4ac6ec932c3018"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO it can if composed into one \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2cli/main.go"},"region":{"startLine":901}}}],"partialFingerprints":{"codehealthFindingId/v1":"f35ed3d3fc3fc0d90e0b48085a112753818ee14c43c16b8a0c01bc1aafa3fc64"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: Use virtual file system with fs.FS in xmain.State when fs.FS supports writes. \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2cli/main_test.go"},"region":{"startLine":5}}}],"partialFingerprints":{"codehealthFindingId/v1":"fe35f8bd0c8dafb078c1d3ad919fdd8c902b0f5513aa8c63ca3f14b9a933c3ab"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: Add cmdlog logging and error reporting middleware \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2cli/watch.go"},"region":{"startLine":512}}}],"partialFingerprints":{"codehealthFindingId/v1":"33b111aadddbfb8fa28098568ca7f529545877e30dfeb9285301576c2eda17fd"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: Add standard debug/profiling routes \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2cli/watch.go"},"region":{"startLine":513}}}],"partialFingerprints":{"codehealthFindingId/v1":"8ebc9fd2cd56d8589a702b195b1ac3ee2cd054f773cda238c60cf35c9700ff4f"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO go back to using xrand.String, currently some incompatibility with \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2chaos/d2chaos.go"},"region":{"startLine":209}}}],"partialFingerprints":{"codehealthFindingId/v1":"dcbc6835750a5b596b2554b0fa32b8b79a2cb2f10a848c892917bb2e34dbd7f2"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: Remove boxes and cleanup like d2ir \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ast/d2ast.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"6a7dfe9f1bde05fac0b396569571531d4cbb8c64d112bfacdc752152fbaca445"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: add error node for autofmt of incomplete AST \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ast/d2ast.go"},"region":{"startLine":42}}}],"partialFingerprints":{"codehealthFindingId/v1":"6ed81c35f13d17b37e71a5f41254b3ad55de43f3a5e996d5d55467a31e5bdc35"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: mistake, move into parse.go \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ast/d2ast.go"},"region":{"startLine":584}}}],"partialFingerprints":{"codehealthFindingId/v1":"4d75a91a789393fecc5f5e0059de6dd328a7f5126da2090b7fc1eae600d49e4a"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: require @ on import values for readability \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ast/d2ast.go"},"region":{"startLine":778}}}],"partialFingerprints":{"codehealthFindingId/v1":"5af9ffff8cd045f137f47deb24b9ed7c42675fd71f50712e429a6850ac4ac71d"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO probably should be checking the values, but will wait until something breaks to change \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ast/d2ast.go"},"region":{"startLine":1221}}}],"partialFingerprints":{"codehealthFindingId/v1":"92c91bc703d3d9a157afcb3bef7805b452ac457f0acb46f69b9b094b6bdc979b"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: implement ScalarString() \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ast/d2ast.go"},"region":{"startLine":1480}}}],"partialFingerprints":{"codehealthFindingId/v1":"c0440f28fe513d1ab3af6749caf0b831b8ae3645714588fa7404743eed7cae36"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO: Right now this is here to be available in both the Parser and Compiler but \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ast/error.go"},"region":{"startLine":3}}}],"partialFingerprints":{"codehealthFindingId/v1":"404f060d43e9fd449da9a2004f24d14a265003c26f1ba95587a92d31ca3995e9"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: // TODO maybe autofmt should allow other values, and transform them to conform \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060// REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ast/keywords.go"},"region":{"startLine":79}}}],"partialFingerprints":{"codehealthFindingId/v1":"0c9e9548b88ac10052cddf5e3fc58d54c7c433bf8e701aaf6a6089a8e883bc60"}},{"ruleId":"D20","level":"note","message":{"text":"No ADRs found: No ADRs found. No recognised ADR directory (\u0060docs/adr/\u0060, \u0060docs/decisions/\u0060, \u0060adr/\u0060, \u0060docs/rfcs/\u0060, an \u0060ADR0001/\u0060 folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (\u0060docs/adr/use-postgres.md\u0060, \u0060docs/adr/2024/0001-x.md\u0060); or a file anywhere whose name is ADR-shaped (\u00600001-use-postgres.md\u0060, \u0060adr-012-caching.md\u0060); or, when neither turned anything up, a document carrying the decision-record signature (an \u0022Architecture Decision Record\u0022 heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these \u2014 unnumbered files outside any recognised directory, without those headings \u2014 is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in \u0060docs/adr/\u0060. ADRs are expected here because \u0060main.go\u0060 makes this repository a deployable product (line 1)."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"main.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"d6a3e98f9a3db0a104ca87a623a16ba8fc33487b53a279d445cb50087c399a8a"}},{"ruleId":"D28","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"0a02407d369ded3965d0ec51f7717803affc2215bbad3d48df6eac885612c44e"},"properties":{"commitSha":"7fe4c6df837f221043f14507662461d153d7482d"},"taxa":[{"id":"CICD-SEC-6","toolComponent":{"name":"OWASP Top 10 CI/CD Security Risks","guid":"3c9b2a6e-5d14-4f7b-8e02-6a1d9c4b7f35"}}]},{"ruleId":"D28","level":"note","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"3cdfd7beb31b791ae18dcb425e21eb157c842e7bbcd522cc330573c1a6538db1"}},{"ruleId":"D29","level":"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"}},{"id":"A04:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"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":"80cbf89f21bbe193e8c318fa93f9c13860a62789c3f351f57206b50aea50b368"},"taxa":[{"id":"CWE-319","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A04:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"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":"3c96524379bf785f9a5580dbe07e54134e0563022c00c834a2f805d1ad1fc35a"},"taxa":[{"id":"CWE-248","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-704","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A10:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"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":"6af82f54f3c75108391490d00f7cbed39db75345ca721494eab79c32010f74b3"},"taxa":[{"id":"CWE-391","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A10:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"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":"408d2cffc9f82316750446006bee3bd8e91e8f52f3957548d133505896b23be7"},"taxa":[{"id":"CWE-391","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-703","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A10:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"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":"4ccb0521b11e54e4b36fc8a6093aee5eaeb08b3155e1789c2fa18655f36c2e48"},"taxa":[{"id":"CWE-338","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A04:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"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":"9f75b2a96e95929d6ce6338f425e6ffba0e0c6031e29874c221be779734dfdb3"},"taxa":[{"id":"CWE-338","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A04:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"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":"ceacd22135f74047c6fa6dfb7cc75ab8419f455fe82ef3910a28d8c6be3f5de5"},"taxa":[{"id":"CWE-252","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-476","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A10:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"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":"a5cd966b9a9d27f164e0fbb3a05bc445b2108618b7eebcd5d26b0028709fdd92"},"taxa":[{"id":"CWE-252","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-476","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A10:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"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":"fef5d851d606804134e200327d4621320b8033aee88f0d93bf10a92fe32a2807"},"taxa":[{"id":"CWE-252","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-476","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A10:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"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":"68cd14a39b7b9bdcc925594534ee8e073de02cd3a909d67f8229b15b2f68dce7"},"taxa":[{"id":"CWE-252","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-476","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A10:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"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":"4e0c5bbeea4b2873a1d3f4fcc9f862fd2e308a1b223ed0a101505d932b82cf9b"},"taxa":[{"id":"CWE-338","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A04:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"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":"7b136636eb4e1f585f21ead7d539a142b4edc305f9d7e50803df8041658e7bee"},"taxa":[{"id":"CWE-252","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-476","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A10:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"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":"7cd09e95de7e1b27cb935562883ef34efc2d4c479e827aa90880e9014bce8cad"},"taxa":[{"id":"CWE-338","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A04:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"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":"c6504cb71da36909dee8b128ce281fbd294ebce6b0a8e393a5396d4929779ab7"},"taxa":[{"id":"CWE-338","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A04:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"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":"b69ccb425c938bcf50daa8bcafacb5fbebe22090e4ffa843105dd2980875ee1d"},"taxa":[{"id":"CWE-338","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A04:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"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":"8bd2e00b2aeb47d0e9d3b3f19f4137ff615ead39f434609956d1caf4e95af2ca"},"taxa":[{"id":"CWE-252","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-476","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A10:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"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":"4c5ec9d66a3e1167d100318a0fa4cd01a5697f1ca6865ed14c6440295f05abb8"},"taxa":[{"id":"CWE-252","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-476","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A10:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"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":"0106f888819b1e8e88f548e39b2a5ce3d5ed7d8cde3bca17701e05bfbbc2d9c6"},"taxa":[{"id":"CWE-338","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A04:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"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":"002b43e0f571aba772b91671f67d224e47d9e0cd1ed9a4c49e1771c9303211ed"},"taxa":[{"id":"CWE-338","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A04:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"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":"0f15f179ca815265567d2f741f2131ff5984bdaf7d6cb36dc2b44fdd0e9c74b8"},"taxa":[{"id":"CWE-338","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A04:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"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":"e249dd5c70e48cf56f829ce190994dd5c7a4f0a826c00f248224a5177f069e37"},"taxa":[{"id":"CWE-338","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A04:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"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":"e2359f0bd106056cef518864f6690fb30bd0a62fed44f7ae8a55dfc9cd47c659"},"taxa":[{"id":"CWE-665","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-908","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A06:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"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":"531f124461e05116a5fb33b8135180fe7ee3b951e297ad370cd66c4424eb7bb2"},"taxa":[{"id":"CWE-252","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-476","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A10:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"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":"66ef9cc1452c966c0f80976c8499aa63ec6167c21af8d24980dfe41b134fde8b"},"taxa":[{"id":"CWE-665","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-908","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A06:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"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":"a5de78e4bf7ade119dd403a1f4320a5e841212d5111f086d695f8bdd9b2f730d"},"taxa":[{"id":"CWE-665","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-908","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A06:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"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":"a9a873f6cef1c3815f9b3218f36b2e42cf7701e9eb9ea5a98bbf20e29864bbe3"},"taxa":[{"id":"CWE-665","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-908","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A06:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"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":"eb3246a375a1c8807c233c7da397390d1b8aaf4a5f261e1e55f7c076ada019b9"},"taxa":[{"id":"CWE-79","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A05:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"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"}},{"id":"A04:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"ruleId":"D29","level":"note","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"e4496ab78bfa422ca989990e57f044ba270f878f31f5575dc8fe98bda979eba8"},"taxa":[{"id":"CWE-614","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A02:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"ruleId":"D29","level":"note","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"b4cc50533904e88f6005d7a430b6ba820ff55161388748a81ea6d6b501f7dd40"},"taxa":[{"id":"CWE-242","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"note","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"b127db3535f00b70c426ac6290804621365365b5a850d2425c126d13709143da"},"taxa":[{"id":"CWE-242","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"note","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"a7ab5e5d4be9147a66024e32244a427d3d74ac4a36e2447492e10f0347354635"},"taxa":[{"id":"CWE-242","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"note","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"2843934de66227f68c90ba8b7720fbc7dac0960bdccaf2a728ec61de8c4a63fc"},"taxa":[{"id":"CWE-242","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"note","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"2b56957e41de7b09cbc27992c07e3d71324127c4e65a26168b49b957c1a04b94"},"taxa":[{"id":"CWE-242","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D30","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":"176baf7cbcdcdb4b7d8f763bb176cff4ae1647da83cfec8eefd8856f0632746e"},"properties":{"dependency":{"package":"stdlib","version":"1.27.0","advisory":"GO-2026-6599","aliases":["BIT-golang-2026-111943","BIT-golang-2026-56857","BIT-golang-2026-56866","BIT-golang-2026-78659","BIT-golang-2026-78660","BIT-golang-2026-78663","BIT-golang-2026-78667","BIT-golang-2026-78669","BIT-golang-2026-94439","BIT-golang-2026-94440","BIT-golang-2026-94448","BIT-golang-2026-97030","BIT-golang-2026-97031","BIT-golang-2026-97032","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","GO-2026-6600","GO-2026-6603","GO-2026-6604","GO-2026-6605","GO-2026-6607","GO-2026-6608","GO-2026-6609","GO-2026-6610","GO-2026-6611","GO-2026-6612","GO-2026-6613","GO-2026-6617","GO-2026-6809","GO-2026-6859","RUSTSEC-2026-0381","RUSTSEC-2026-0382","RUSTSEC-2026-0383"],"reachability":{"kind":"production","file":"d2cli/watch.go","line":536,"symbol":"http.Error"}}}},{"ruleId":"D30","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":"d03f2a180b6c44b09157108557612e48c9e72436d9219e099dc51e18f53d4553"},"properties":{"dependency":{"package":"golang.org/x/net","version":"0.57.0","advisory":"GO-2026-6603","aliases":["BIT-golang-2026-78659","BIT-golang-2026-78660","BIT-golang-2026-78663","BIT-golang-2026-78669","BIT-golang-2026-97032","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","GO-2026-6610","GO-2026-6611","GO-2026-6612","GO-2026-6617","GO-2026-6860","GO-2026-6866"],"reachability":{"kind":"production","file":"lib/textmeasure/markdown.go","line":12}}}},{"ruleId":"D30","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":"b66958d36105d659606ca462f50269679a3c1d5e550039e14bf9ce51cddaaddb"},"properties":{"dependency":{"package":"github.com/andybalholm/brotli","version":"1.2.2","advisory":"GO-2026-6888","aliases":["BIT-brotli-2026-111497","BIT-dotnet-2026-111497","BIT-dotnet-sdk-2026-111497","BIT-node-2026-111497","BIT-node-min-2026-111497","BIT-powershell-2026-111497","[CVE redacted]","[GHSA redacted]","[GHSA redacted]","PYSEC-2026-4322","PYSEC-2026-4323"],"reachability":{"kind":"production","file":"d2renderers/d2fonts/noto_color_emoji_native.go","line":14}}}},{"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":"f75bd81073be731c3a55f57eea04b35e45b5ccca9919ee8b4c836420fbdd5876"}},{"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":"002a4b755a3b029d73611555544b6d75b21ba9786562fd8d3851423646ea5f57"},"taxa":[{"id":"CWE-250","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-732","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"A01:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}}]},{"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":"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":"D34","level":"note","message":{"text":"Orphaned files with no living knowledge: 1 of 394 analysed file(s) have no living knowledge left \u2014 their last meaningful change has decayed away, so if one breaks, no one currently understands it (counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 394 of the 596 production source files in this repository met that bar). None is large enough to earn a read-through of its own, so this row stands in for the per-file rows rather than raising one each \u2014 most significant first: d2graph/layout.go. Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"ce861fd78f6935114d3a342cb90ad25870f984e1042954fcbbe27c0e23be3658"}},{"ruleId":"D34","level":"note","message":{"text":"Orphaned file: No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2graph/layout.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"be166d8f8186b8d1bea608758db39324b994fe8a25dbbccd7deef5711f701c2d"}},{"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":"ace515990e7ee0f17b5c17e44dd168a5bdecf90804a3a3dd845cf05540978013"},"taxa":[{"id":"CICD-SEC-3","toolComponent":{"name":"OWASP Top 10 CI/CD Security Risks","guid":"3c9b2a6e-5d14-4f7b-8e02-6a1d9c4b7f35"}}]},{"ruleId":"AC6","level":"warning","message":{"text":"Focus outline removed in CSS without a :focus replacement: \u0060.md .anchor:focus\u0060 sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svg/github-markdown.css"},"region":{"startLine":358}}}],"partialFingerprints":{"codehealthFindingId/v1":"5d371ab91fde82120be33514c6ec4fff2d54c1bba6695e5623617d09e4a89880"}},{"ruleId":"M2","level":"note","message":{"text":"No ADRs: No Architecture Decision Records found \u2014 no conventional ADR directory, no numbered \u0060NNNN-title\u0060 documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"670b3d6e36a756d63097d0dfbf90afd5fc761308800b9354894a07c3f4e4aa14"}},{"ruleId":"M4","level":"note","message":{"text":"README/code drift: README.md links to \u0060./CHANGELOG.md\u0060, but \u0060CHANGELOG.md\u0060 does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents\u0027 own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"README.md"},"region":{"startLine":12}}}],"partialFingerprints":{"codehealthFindingId/v1":"b85864071a30ab325207b0475304e4f6aa1b79c8e2996b50e4173a6d35a328ea"}},{"ruleId":"P3","level":"note","message":{"text":"No SAST: No static application security testing detected. For this repository\u0027s stack, add gosec / govulncheck (or golangci-lint) (or \u0060semgrep --config=auto\u0060, which runs on any language) as a CI step. What was searched, so you can tell an absence from a miss: the 8 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge\u0027s web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen \u2014 if that is your case the row is wrong, and saying so is more useful than adding a second scanner."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":".github/workflows/ci.yml"},"region":{"startLine":3}}}],"partialFingerprints":{"codehealthFindingId/v1":"6e54424179c892f03ef2fd003130ac4bd43f39bbf3b1ca0a0143e25acb80ec87"}},{"ruleId":"P3","level":"note","message":{"text":"No dependency-update automation: \u0060d2js/js/package.json\u0060 declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices \u2014 including after an advisory is published against it. Add a \u0060.github/dependabot.yml\u0060 with one \u0060package-ecosystem\u0060 entry per ecosystem the tree uses (or an enabled \u0060renovate.json\u0060), and gate pull requests with \u0060actions/dependency-review-action\u0060."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2js/js/package.json"},"region":{"startLine":60}}}],"partialFingerprints":{"codehealthFindingId/v1":"45a2edf1c744659e0b4892c8d68c7c1606b69b8f3a537363a1928be85aa43880"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060!bridgeFinite(p.X) || !bridgeFinite(p.Y) || !bridgeFinite(p.Z)\u0060 appears character-identically in 2 files \u2014 d2renderers/d2isometric/d2isometricimg/route_bridges.go, d2renderers/d2isometric/d2isometricimg/route_lanes.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/route_bridges.go"},"region":{"startLine":88}}}],"partialFingerprints":{"codehealthFindingId/v1":"799430fe067e17423157ca88bc2e920c54614dba76afac456504d035d4639768"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060!captionFinite(dash, gap) || dash \u003C= 0 || gap \u003C= 0\u0060 appears character-identically in 2 files \u2014 d2renderers/d2isometric/d2isometricimg/native_edges.go, d2renderers/d2isometric/d2isometricimg/sequence_routes.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/native_edges.go"},"region":{"startLine":482}}}],"partialFingerprints":{"codehealthFindingId/v1":"458214725f165a365088b142b5e3c2af75064ff8d5ece136adcae410127f5114"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060!finite(box.X) || !finite(box.Y) || !finite(box.Width) || !finite(box.Height)\u0060 appears character-identically in 2 files \u2014 d2renderers/d2raster/raster.go, d2renderers/d2scene/primitive.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/raster.go"},"region":{"startLine":1633}}}],"partialFingerprints":{"codehealthFindingId/v1":"2c5ba84069ee7819f74e442a77c1fd46e72b6fdd4f56208d5030f902d6b4c611"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060!finite(pattern.Tile.X\u002Bpattern.Tile.Width) || !finite(pattern.Tile.Y\u002Bpattern.Tile.Height)\u0060 appears character-identically in 2 files \u2014 d2renderers/d2raster/pattern.go, d2renderers/d2raster/vector_validation.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/pattern.go"},"region":{"startLine":60}}}],"partialFingerprints":{"codehealthFindingId/v1":"3b01191a32f25ba6a9b29755debae609c6975ecf04dbfcf46db7237a88aaae01"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060!finite(rect.RadiusX) || !finite(rect.RadiusY) || rect.RadiusX \u003C 0 || rect.RadiusY \u003C 0\u0060 appears character-identically in 2 files \u2014 d2renderers/d2raster/raster.go, d2renderers/d2raster/vector_validation.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/raster.go"},"region":{"startLine":1235}}}],"partialFingerprints":{"codehealthFindingId/v1":"393c7a9ba2115ea1ce8a91a3e958bb6ba9fcc66af76537533a81eff2f87bec34"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060!finite(stroke.Width) || stroke.Width \u003C 0 || !finite(stroke.MiterLimit) || !finite(stroke.DashOffset)\u0060 appears character-identically in 2 files \u2014 d2renderers/d2raster/raster.go, d2renderers/d2raster/vector_validation.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/raster.go"},"region":{"startLine":1482}}}],"partialFingerprints":{"codehealthFindingId/v1":"ac25077e14af47ed039b668c57162ef7671039a6c5f0ad3ecd1bf29382f57399"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060!finitePoint(ellipse.Center) || !finite(ellipse.RadiusX) || !finite(ellipse.RadiusY) || ellipse.RadiusX \u003C 0 || ellipse.RadiusY \u003C 0\u0060 appears character-identically in 3 files \u2014 d2renderers/d2raster/raster.go, d2renderers/d2raster/vector_validation.go, d2renderers/d2scene/primitive.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/raster.go"},"region":{"startLine":1255}}}],"partialFingerprints":{"codehealthFindingId/v1":"605a6575034fa1ae5f554c8d498360c75cf2e42177a33ff627bba9896a949ab0"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060!finitePoint(glyph.Position) || !finite(glyph.Advance) || !glyph.Ink.IsFinite()\u0060 appears character-identically in 2 files \u2014 d2renderers/d2raster/text.go, d2renderers/d2scene/primitive.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/text.go"},"region":{"startLine":482}}}],"partialFingerprints":{"codehealthFindingId/v1":"ded0830537064799288887ec4d460c2d0fdafb87081f350c7d4809e465eeb7cd"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060!finitePoint(gradient.Center) || !finitePoint(gradient.Focal) || !finite(gradient.Radius) || !finite(gradient.FocalRadius)\u0060 appears character-identically in 2 files \u2014 d2renderers/d2raster/gradient.go, d2renderers/d2raster/vector_validation.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/gradient.go"},"region":{"startLine":201}}}],"partialFingerprints":{"codehealthFindingId/v1":"ba28278c8ae28ba3851f9607c7d435b951af948795c3562c292f3da7af905e14"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060!finitePoint(gradient.Start) || !finitePoint(gradient.End)\u0060 appears character-identically in 2 files \u2014 d2renderers/d2raster/gradient.go, d2renderers/d2raster/vector_validation.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/gradient.go"},"region":{"startLine":122}}}],"partialFingerprints":{"codehealthFindingId/v1":"a09e3b2dbc28fa4860f3e59a705d4982a3e0a82afe0253a93ba6d47efa0dfe78"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060!finitePoint(text.Origin) || !finite(text.Font.Size) || text.Font.Size \u003C= 0 || text.Font.Size \u003E float64(math.MaxInt32)/64\u0060 appears character-identically in 2 files \u2014 d2renderers/d2raster/text.go, d2renderers/d2raster/vector_validation.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/text.go"},"region":{"startLine":184}}}],"partialFingerprints":{"codehealthFindingId/v1":"a89fcbc9461aae8db44e3f4f11daeb962e0d99f990a9381ad2f9528323db7728"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060!isASCIIAlpha(character) \u0026\u0026 character != \u0027_\u0027\u0060 appears character-identically in 2 files \u2014 d2renderers/d2svgimport/gradient.go, d2renderers/d2svgimport/stylesheet.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svgimport/gradient.go"},"region":{"startLine":377}}}],"partialFingerprints":{"codehealthFindingId/v1":"a6a5ff2c4d40baea1910ba31679d2c6fda19edf04034b8f68cee7354964bd940"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060!math.IsInf(leastDistance, 1) \u0026\u0026 geo.PrecisionCompare(edgeLength-symmetryCost, leastDistance, geo.PRECISION) == 1\u0060 appears character-identically in 2 files \u2014 d2layouts/d2talalayout/internal/placement/moves.go, d2layouts/d2talalayout/internal/placement/sized_optimizer.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/moves.go"},"region":{"startLine":70}}}],"partialFingerprints":{"codehealthFindingId/v1":"4b1f711b7c97926f582b7768a45dd65dc7c7e8a59d0ad597aa41bd148a1088ee"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060!math.IsNaN(value) \u0026\u0026 !math.IsInf(value, 0)\u0060 appears character-identically in 9 files \u2014 d2layouts/d2talalayout/internal/layoutgraph/transaction.go, d2layouts/d2talalayout/internal/packing/routed_container.go, d2layouts/d2talalayout/internal/placement/optimizer_spatial_index.go, d2layouts/d2talalayout/internal/quality/score.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/transaction.go"},"region":{"startLine":489}}}],"partialFingerprints":{"codehealthFindingId/v1":"1110fc9e89e38b69f07eae36c9a10a05948f315e15d8e0b037a921699f207234"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060!node.Mask.Transform.IsFinite() || node.Mask.Type \u003E d2scene.MaskLuminance || node.Mask.Root == nil\u0060 appears character-identically in 2 files \u2014 d2renderers/d2raster/raster.go, d2renderers/d2raster/vector_validation.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/raster.go"},"region":{"startLine":1082}}}],"partialFingerprints":{"codehealthFindingId/v1":"940dfdff9084e128ed6089314025c9437fc81421113dfc4edffe770fc3ea0842"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060!node.Transform.IsFinite() || !finite(node.Opacity) || node.Opacity \u003C 0 || node.Opacity \u003E 1\u0060 appears character-identically in 2 files \u2014 d2renderers/d2raster/raster.go, d2renderers/d2raster/vector_validation.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/raster.go"},"region":{"startLine":993}}}],"partialFingerprints":{"codehealthFindingId/v1":"f5783a6c035c9484c6bd08de046698972f0839a8843f626695e21065dddf0ebe"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060!strings.HasPrefix(value, \u0022url(#\u0022) || !strings.HasSuffix(value, \u0022)\u0022)\u0060 appears character-identically in 2 files \u2014 d2renderers/d2svgimport/gradient.go, lib/svg/markup.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svgimport/gradient.go"},"region":{"startLine":328}}}],"partialFingerprints":{"codehealthFindingId/v1":"2ba6f228e114a0bc2a17d66472ce0c3d541b774f58fd02b57a90b005962ec91d"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060!validCSSPropertyName(property) || value == \u0022\u0022\u0060 appears character-identically in 2 files \u2014 d2renderers/d2svgimport/style.go, d2renderers/d2svgimport/stylesheet.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svgimport/style.go"},"region":{"startLine":154}}}],"partialFingerprints":{"codehealthFindingId/v1":"509f4f4398f38af23f54855c4520e8ba8420fc6a21fbffd3c3edd8e601704f1d"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060(edgeAbduction.CurrentFrom == adjacentNode) \u0026\u0026 (edgeAbduction.CurrentTo == node)\u0060 appears character-identically in 2 files \u2014 d2layouts/d2talalayout/internal/placementcost/edge_length.go, d2layouts/d2talalayout/internal/placementcost/symmetry.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placementcost/edge_length.go"},"region":{"startLine":224}}}],"partialFingerprints":{"codehealthFindingId/v1":"ed84c3c02b3b5902faa204d5344f23c90617aded0ee50d38ce17cc0feb5350c7"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060(edgeAbduction.CurrentFrom == node) \u0026\u0026 (edgeAbduction.CurrentTo == adjacentNode)\u0060 appears character-identically in 2 files \u2014 d2layouts/d2talalayout/internal/placementcost/edge_length.go, d2layouts/d2talalayout/internal/placementcost/symmetry.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placementcost/edge_length.go"},"region":{"startLine":214}}}],"partialFingerprints":{"codehealthFindingId/v1":"54c6c3631a80e210a5f67848f3cfc01f748098e44f729e4923e25ccb1528b988"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060(node.TopLeft.X != currentNodeX) || (node.TopLeft.Y != currentNodeY)\u0060 appears character-identically in 2 files \u2014 d2layouts/d2talalayout/internal/placement/sized_optimizer.go, d2layouts/d2talalayout/internal/placement/sizeless_optimizer.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/sized_optimizer.go"},"region":{"startLine":1024}}}],"partialFingerprints":{"codehealthFindingId/v1":"d79833bdcf0d8997490b1ca13b1787f3f42d31925c3bf37599e31cc6fa8a7630"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060(text.Underline || text.Strike) \u0026\u0026 advance \u003E 0\u0060 appears character-identically in 2 files \u2014 d2renderers/d2raster/text.go, d2renderers/d2raster/vector_validation.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/text.go"},"region":{"startLine":345}}}],"partialFingerprints":{"codehealthFindingId/v1":"8a30d1038c58bd08279b94a2fc59e25bd86bcf4d7a04e39fa09fb366150e0fb4"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060abduction == nil || abduction.Edge == nil\u0060 appears character-identically in 2 files \u2014 d2layouts/d2talalayout/internal/grouping/cluster_discovery.go, d2layouts/d2talalayout/internal/grouping/lifecycle.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/grouping/cluster_discovery.go"},"region":{"startLine":112}}}],"partialFingerprints":{"codehealthFindingId/v1":"cbbd0fe465b16467af9e65d1df955c0357bcecb1518e1edfbbc8b6b1b50bac25"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060animation.fillColor != nil || animation.strokeColor != nil || animation.dashOffset != nil\u0060 appears character-identically in 2 files \u2014 d2renderers/d2raster/image.go, d2renderers/d2raster/vector_validation.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/image.go"},"region":{"startLine":220}}}],"partialFingerprints":{"codehealthFindingId/v1":"86be418598d928c99e9d6feab1a5509ad0e987ac0a6775ae77e952955323db6f"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060arrowhead == d2target.CfMany || arrowhead == d2target.CfManyRequired\u0060 appears character-identically in 2 files \u2014 d2renderers/d2scenebuild/connection.go, d2renderers/d2svg/d2svg.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/connection.go"},"region":{"startLine":624}}}],"partialFingerprints":{"codehealthFindingId/v1":"ef6fd24a291a7ab7ee16acb4a7366c3bc3b64cd83693c823468c0f8356c6392a"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060arrowhead == d2target.CfOneRequired || arrowhead == d2target.CfManyRequired\u0060 appears character-identically in 2 files \u2014 d2renderers/d2scenebuild/connection.go, d2renderers/d2svg/d2svg.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/connection.go"},"region":{"startLine":607}}}],"partialFingerprints":{"codehealthFindingId/v1":"40d75a2a6b97bf27977a48d42bb82fafa945c5e9e50059d3b92cac892fb70a76"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060b.options.Assets == nil || b.options.Assets.Resolver == nil\u0060 appears character-identically in 2 files \u2014 d2renderers/d2scenebuild/assets.go, d2renderers/d2scenebuild/build.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/assets.go"},"region":{"startLine":107}}}],"partialFingerprints":{"codehealthFindingId/v1":"a7cb6583538c987528a9a1dd14309c07a748e50cf118bd66d7e48439387ca6d4"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060bounds.Dx() \u003E width || bounds.Dy() \u003E height\u0060 appears character-identically in 2 files \u2014 lib/xgif/encode.go, lib/xgif/xgif.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/xgif/encode.go"},"region":{"startLine":64}}}],"partialFingerprints":{"codehealthFindingId/v1":"6418f848352619d2b41a214fb2facd3636570407117ff9f1aab3d85b4fd6c91e"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060budget.MaxRegions \u003C= 0 || budget.MaxStringBytes \u003C= 0\u0060 appears character-identically in 2 files \u2014 d2renderers/d2scenebuild/appendix.go, d2renderers/d2scenebuild/metadata.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/appendix.go"},"region":{"startLine":58}}}],"partialFingerprints":{"codehealthFindingId/v1":"b4bef87171a789718563ebe85781627dfd9471479555a1508d67f7c3567c9db1"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060budget.MaxSourceBytes \u003C= 0 || budget.MaxElements \u003C= 0 || budget.MaxAttributes \u003C= 0 || budget.MaxAttributeBytes \u003C= 0 || budget.MaxPathCommand\u2026\u0060 appears character-identically in 2 files \u2014 d2renderers/d2scenebuild/assets.go, d2renderers/d2scenebuild/latex.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/assets.go"},"region":{"startLine":327}}}],"partialFingerprints":{"codehealthFindingId/v1":"7e1de795469c3fd567ae3591120b9958230fe031a5fd501cc322bbb45595fe80"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060bytes \u003E maxRichSourceBytes-p.sourceBytes || rows \u003E maxRichTotalRows-p.rows\u0060 appears character-identically in 2 files \u2014 d2renderers/d2isometric/d2isometricimg/native_structured.go, d2renderers/d2isometric/d2isometricimg/rich_labels.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/native_structured.go"},"region":{"startLine":113}}}],"partialFingerprints":{"codehealthFindingId/v1":"e2015778e72e1c6a8e98c308abfc54dcc07dd0ca6de4096ef18434056b4069a8"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060c \u003E= \u0027a\u0027 \u0026\u0026 c \u003C= \u0027z\u0027 || c \u003E= \u0027A\u0027 \u0026\u0026 c \u003C= \u0027Z\u0027\u0060 appears character-identically in 2 files \u2014 lib/svg/markup.go, lib/textmeasure/markdown_svg.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/svg/markup.go"},"region":{"startLine":211}}}],"partialFingerprints":{"codehealthFindingId/v1":"e2f8c0750e316014bdb85c79feaefc12d72107d915e7b2a7ba420cd0f4195b1b"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060c \u003E= \u0027a\u0027 \u0026\u0026 c \u003C= \u0027z\u0027 || c \u003E= \u0027A\u0027 \u0026\u0026 c \u003C= \u0027Z\u0027 || c \u003E= \u00270\u0027 \u0026\u0026 c \u003C= \u00279\u0027 || c == \u0027_\u0027 || c == \u0027-\u0027\u0060 appears character-identically in 2 files \u2014 d2renderers/d2isometric/d2isometricimg/vector_surface_svg.go, d2renderers/d2svg/theme.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/vector_surface_svg.go"},"region":{"startLine":41}}}],"partialFingerprints":{"codehealthFindingId/v1":"8ae936b19bd788ad3c5513ec40e86fab4f8a9d79cf26f6a3e7b69e10d4915e6d"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060child == first \u0026\u0026 n.Data == \u0022blockquote\u0022\u0060 appears character-identically in 2 files \u2014 lib/textmeasure/markdown.go, lib/textmeasure/markdown_svg.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/textmeasure/markdown.go"},"region":{"startLine":508}}}],"partialFingerprints":{"codehealthFindingId/v1":"deb59db93a7feced1d7d3ba06ece5bf1f0c691e6e8495330f4e404790a7e20f3"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060child.Type == html.ElementNode \u0026\u0026 (child.Data == \u0022td\u0022 || child.Data == \u0022th\u0022)\u0060 appears character-identically in 2 files \u2014 lib/textmeasure/markdown.go, lib/textmeasure/markdown_svg.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/textmeasure/markdown.go"},"region":{"startLine":749}}}],"partialFingerprints":{"codehealthFindingId/v1":"01e1dea508047c55223dbd9bc3b70feb2573b00b559a0a68e76eb805e06e7815"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060child.Type == html.ElementNode \u0026\u0026 child.Data == \u0022br\u0022\u0060 appears character-identically in 2 files \u2014 lib/textmeasure/markdown.go, lib/textmeasure/markdown_svg.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/textmeasure/markdown.go"},"region":{"startLine":520}}}],"partialFingerprints":{"codehealthFindingId/v1":"09841e96c3da350a906043707a23c54812495b4da69b8a7c0d71d3336f10305d"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060child.Type == html.ElementNode \u0026\u0026 child.Data == \u0022tr\u0022\u0060 appears character-identically in 2 files \u2014 lib/textmeasure/markdown.go, lib/textmeasure/markdown_svg.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/textmeasure/markdown.go"},"region":{"startLine":658}}}],"partialFingerprints":{"codehealthFindingId/v1":"a5bcd1658366106c5bf785d9e8f00bd952607652f193ac6b3b2849ec88f9ab79"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060child.Type == html.ElementNode \u0026\u0026 isBlockElement(child.Data)\u0060 appears character-identically in 2 files \u2014 lib/textmeasure/markdown.go, lib/textmeasure/markdown_svg.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/textmeasure/markdown.go"},"region":{"startLine":501}}}],"partialFingerprints":{"codehealthFindingId/v1":"68dd12a89a76582900869e5d5586ca2af8e9154e85269178d085fd72034fab53"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060closedIntervalsOverlap(firstStart.X, firstEnd.X, secondStart.X, secondEnd.X) \u0026\u0026 closedIntervalsOverlap(firstStart.Y, firstEnd.Y, secondStart\u2026\u0060 appears character-identically in 2 files \u2014 d2layouts/d2talalayout/internal/quality/labels.go, d2layouts/d2talalayout/internal/routing/geometry.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/quality/labels.go"},"region":{"startLine":385}}}],"partialFingerprints":{"codehealthFindingId/v1":"171f4c06a5d2f6d173aa161e6df4574d7a37345708f3c9629f00d28385f15998"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060connection.DstLabel != nil \u0026\u0026 connection.DstLabel.Label != \u0022\u0022\u0060 appears character-identically in 2 files \u2014 d2renderers/d2svg/d2svg.go, d2target/d2target.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svg/d2svg.go"},"region":{"startLine":1366}}}],"partialFingerprints":{"codehealthFindingId/v1":"71769f8749865fe7e252b2e86194dc5add0f09ed0f93c91cd23d6c422b1ea8fa"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060connection.IsCurve \u0026\u0026 (len(connection.Route)-1)%3 != 0\u0060 appears character-identically in 2 files \u2014 d2renderers/d2scenebuild/build.go, d2target/render_validation.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/build.go"},"region":{"startLine":415}}}],"partialFingerprints":{"codehealthFindingId/v1":"75d71747c125ec09f082c143cedad75a5ba099acf4195a93d602f167d9b84fba"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060connection.SrcLabel != nil \u0026\u0026 connection.SrcLabel.Label != \u0022\u0022\u0060 appears character-identically in 2 files \u2014 d2renderers/d2svg/d2svg.go, d2target/d2target.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svg/d2svg.go"},"region":{"startLine":1363}}}],"partialFingerprints":{"codehealthFindingId/v1":"2aa98f3c5dea52a393e8468e80eadf0014ab6331d2a0c1e8d2276a0264c50ad0"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060copyIndex == 1 \u0026\u0026 !n.Metadata.Original.Multiple\u0060 appears character-identically in 2 files \u2014 d2renderers/d2isometric/d2isometricimg/arrow_visibility.go, d2renderers/d2isometric/d2isometricimg/native_shapes.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/arrow_visibility.go"},"region":{"startLine":134}}}],"partialFingerprints":{"codehealthFindingId/v1":"5793fe83bf80e92b0952e0b7fed3d664133726cb68878ead0da2d3196c0edc1a"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060currentIndex == 0 || currentIndex == len(sourceOrder)-1\u0060 appears character-identically in 2 files \u2014 d2layouts/d2talalayout/internal/routing/coordinator.go, d2layouts/d2talalayout/internal/routing/standalone_route_guard.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/coordinator.go"},"region":{"startLine":1779}}}],"partialFingerprints":{"codehealthFindingId/v1":"2923cfdc5dc979c60c4892e7461ca4af8a100e7d0c82803e9c03fd1ec390f2db"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060declaredEnd != uint64(len(data)) || declaredEnd \u003C 12\u0060 appears character-identically in 2 files \u2014 d2renderers/d2svgimport/image.go, internal/rasterimage/firstframe.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svgimport/image.go"},"region":{"startLine":588}}}],"partialFingerprints":{"codehealthFindingId/v1":"247b48a78c5a24111a41e97def5c51f7a171cb7631eb44d78540a75f2388d748"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060descendant.Cluster != nil \u0026\u0026 descendant.Cluster.Vessel != nil\u0060 appears character-identically in 2 files \u2014 d2layouts/d2talalayout/internal/grouping/cluster_discovery.go, d2layouts/d2talalayout/internal/packing/guard.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/grouping/cluster_discovery.go"},"region":{"startLine":226}}}],"partialFingerprints":{"codehealthFindingId/v1":"2de46274522d8d24e26f3d345d267d3c6cfbfd77285d02002494a827a5aa6f3d"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060descendant.Sequence != nil \u0026\u0026 descendant.Sequence.Vessel != nil\u0060 appears character-identically in 2 files \u2014 d2layouts/d2talalayout/internal/grouping/cluster_discovery.go, d2layouts/d2talalayout/internal/packing/guard.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/grouping/cluster_discovery.go"},"region":{"startLine":228}}}],"partialFingerprints":{"codehealthFindingId/v1":"f37338f351a5445842f998e2daab116481d30a7d7b0cabc3307dc1e84add6ee4"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060dimensions == nil || dimensions.Width \u003C 0 || dimensions.Height \u003C 0\u0060 appears character-identically in 2 files \u2014 d2renderers/d2scenebuild/appendix.go, d2renderers/d2scenebuild/legend.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/appendix.go"},"region":{"startLine":167}}}],"partialFingerprints":{"codehealthFindingId/v1":"5e4465221b5064a60a44aecf1b4632a2cb03977e88bb1afb4532e8eab020d5a8"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060direction.X \u003C -1e-6 || math.Abs(direction.X) \u003C 1e-6 \u0026\u0026 direction.Z \u003C 0\u0060 appears character-identically in 2 files \u2014 d2renderers/d2isometric/d2isometricimg/geometry_routes.go, d2renderers/d2isometric/d2isometricimg/route_caption_style.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/geometry_routes.go"},"region":{"startLine":318}}}],"partialFingerprints":{"codehealthFindingId/v1":"b1be0dcaa90f044feb7377e93637e0dbb60af9a43b3f92e09ef8bf4facfca156"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060e.From.Cluster != nil || e.To.Cluster != nil\u0060 appears character-identically in 2 files \u2014 d2layouts/d2talalayout/internal/layoutgraph/edge.go, d2layouts/d2talalayout/internal/quality/scoring.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/edge.go"},"region":{"startLine":220}}}],"partialFingerprints":{"codehealthFindingId/v1":"adb849156b74577bbd1b68d6b40c111c4e8142176ea8349f46adede24dc655f6"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060edge == nil || (edge.From != node \u0026\u0026 edge.To != node)\u0060 appears character-identically in 4 files \u2014 d2layouts/d2talalayout/internal/hierarchy/rank_graph.go, d2layouts/d2talalayout/internal/placement/optimization_guard.go, d2layouts/d2talalayout/internal/placement/sized_optimizer.go, d2layouts/d2talalayout/internal/trees/preprocess_helpers.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/hierarchy/rank_graph.go"},"region":{"startLine":130}}}],"partialFingerprints":{"codehealthFindingId/v1":"bbe134e219595ddc77678e76e9d53c66e8118408b19cc7a5b5050b7671a6f392"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060edge == nil || edge.From == nil || edge.To == nil\u0060 appears character-identically in 5 files \u2014 d2layouts/d2talalayout/internal/hierarchy/rank_graph.go, d2layouts/d2talalayout/internal/packing/routed_container.go, d2layouts/d2talalayout/internal/routing/ovg_edge_router.go, d2layouts/d2talalayout/internal/trees/preprocess_helpers.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/hierarchy/rank_graph.go"},"region":{"startLine":71}}}],"partialFingerprints":{"codehealthFindingId/v1":"789b966f51add6f11eb2ecda6dcf7e94f60ce8cb9b966cbbf46142870be7fd77"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060edge == nil || edge.From == nil || edge.To == nil || len(edge.Points) \u003C 2\u0060 appears character-identically in 2 files \u2014 d2layouts/d2talalayout/internal/routing/standalone_route_guard.go, d2layouts/d2talalayout/internal/routing/trace.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/standalone_route_guard.go"},"region":{"startLine":494}}}],"partialFingerprints":{"codehealthFindingId/v1":"76ef09ef1b9f195008f96e92131e1f5d54e0177fbf3c54665e49f9542bc4023a"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060edge.From == nil || edge.To == nil || edge.From.TopLeft == nil || edge.To.TopLeft == nil\u0060 appears character-identically in 2 files \u2014 d2layouts/d2talalayout/internal/placementcost/graph.go, d2layouts/d2talalayout/internal/routing/standalone_router.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placementcost/graph.go"},"region":{"startLine":319}}}],"partialFingerprints":{"codehealthFindingId/v1":"92abc6e0b60d0bd9c8c8abf1f8e81024e13ad76d53251581075c3bd6afdabe2b"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060edge.SourceArrow != \u0022\u0022 \u0026\u0026 edge.SourceArrow != \u0022none\u0022\u0060 appears character-identically in 2 files \u2014 d2renderers/d2isometric/d2isometricimg/geometry_routes.go, d2renderers/d2isometric/d2isometricimg/sequence_routes.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/geometry_routes.go"},"region":{"startLine":448}}}],"partialFingerprints":{"codehealthFindingId/v1":"83411a894ab373f08769e70d634ff26af0d2d4ed7d0259e4338d6059dd600877"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060edge.TargetArrow != \u0022\u0022 \u0026\u0026 edge.TargetArrow != \u0022none\u0022\u0060 appears character-identically in 2 files \u2014 d2renderers/d2isometric/d2isometricimg/geometry_routes.go, d2renderers/d2isometric/d2isometricimg/sequence_routes.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/geometry_routes.go"},"region":{"startLine":448}}}],"partialFingerprints":{"codehealthFindingId/v1":"cf3f14b9bd4c7de687185593d103d71e9ef8de357beed7a46693a77a6cd5ad8c"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060edgeAbduction.CurrentFrom.TopLeft != nil \u0026\u0026 edgeAbduction.CurrentFrom.Graph == currentGraph\u0060 appears character-identically in 2 files \u2014 d2layouts/d2talalayout/internal/placement/cluster_connections.go, d2layouts/d2talalayout/internal/placementcost/cluster.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/cluster_connections.go"},"region":{"startLine":16}}}],"partialFingerprints":{"codehealthFindingId/v1":"4801be876f923b93c6697cdf99a9d04cd567343b42e83e43aaad35e9b86ffcc6"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060edgeAbduction.CurrentTo.TopLeft != nil \u0026\u0026 edgeAbduction.CurrentTo.Graph == currentGraph\u0060 appears character-identically in 2 files \u2014 d2layouts/d2talalayout/internal/placement/cluster_connections.go, d2layouts/d2talalayout/internal/placementcost/cluster.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/cluster_connections.go"},"region":{"startLine":23}}}],"partialFingerprints":{"codehealthFindingId/v1":"6f55083414a966309d4c0dde8b1253771dbfa7fed2e41f2e6ae0c649fe818fc3"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060edgeAbduction.OriginallyFrom == nil \u0026\u0026 edgeAbduction.OriginallyTo != nil\u0060 appears character-identically in 2 files \u2014 d2layouts/d2talalayout/internal/placement/cluster_connections.go, d2layouts/d2talalayout/internal/placementcost/cluster.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/cluster_connections.go"},"region":{"startLine":15}}}],"partialFingerprints":{"codehealthFindingId/v1":"1386f01b6e08392e8fcca28d2ba3b4412d05afd906670dcd2754b74287dee36b"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060edgeAbduction.OriginallyTo == nil \u0026\u0026 edgeAbduction.OriginallyFrom != nil\u0060 appears character-identically in 2 files \u2014 d2layouts/d2talalayout/internal/placement/cluster_connections.go, d2layouts/d2talalayout/internal/placementcost/cluster.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/cluster_connections.go"},"region":{"startLine":22}}}],"partialFingerprints":{"codehealthFindingId/v1":"cd1b5e8688ccea43936570f30462147aa5e3fd2a82c53cb4b1692cf5a93c4492"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060end.X \u003E edge.Dst.TopLeft.X\u002BdstDx \u0026\u0026 end.Y \u003C edge.Dst.TopLeft.Y\u002Bedge.Dst.Height-dstDy\u0060 appears character-identically in 2 files \u2014 d2layouts/d2dagrelayout/layout.go, d2layouts/d2elklayout/layout.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2dagrelayout/layout.go"},"region":{"startLine":350}}}],"partialFingerprints":{"codehealthFindingId/v1":"55e700993a2a10ca9281bc979b73cfaf0d152f3297a1fab6dd4699a75ce4386c"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060endpoint.text == nil || endpoint.text.Label == \u0022\u0022\u0060 appears character-identically in 2 files \u2014 d2renderers/d2isometric/d2isometricimg/sequence_routes.go, d2renderers/d2scenebuild/labels.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/sequence_routes.go"},"region":{"startLine":141}}}],"partialFingerprints":{"codehealthFindingId/v1":"262ed5f7bf35490b3c10421998f9dbd25537be6b82fbf0ab566c3501573529ab"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060err != nil \u0026\u0026 !errors.Is(err, sfnt.ErrNotFound)\u0060 appears character-identically in 2 files \u2014 d2renderers/d2scenebuild/code_shape.go, d2renderers/d2scenebuild/markdown.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/code_shape.go"},"region":{"startLine":382}}}],"partialFingerprints":{"codehealthFindingId/v1":"34913838da906985d2952c5176280f0c53ae26fe0433e33c0e8b1bff94e2feab"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060err != nil || math.IsNaN(value) || math.IsInf(value, 0)\u0060 appears character-identically in 4 files \u2014 d2renderers/d2svgimport/path.go, d2renderers/d2svgimport/transform.go, d2renderers/internal/scenepaint/gradient.go, lib/color/gradient.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svgimport/path.go"},"region":{"startLine":391}}}],"partialFingerprints":{"codehealthFindingId/v1":"2cdd18d415038bac8f1eca2954a0a711e845461675e0be20f98912e7a0518ba6"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060err == nil \u0026\u0026 (u.Scheme != \u0022\u0022 || strings.HasPrefix(u.Path, \u0022/\u0022))\u0060 appears character-identically in 2 files \u2014 d2compiler/compile.go, d2ir/compile.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2compiler/compile.go"},"region":{"startLine":1741}}}],"partialFingerprints":{"codehealthFindingId/v1":"1d72c53d8ef9944087acb40f64ebcd61ee206e1c39b777f8f5503cf7d3bfc621"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded)\u0060 appears character-identically in 4 files \u2014 d2ir/compile.go, d2ir/expansion.go, d2layouts/d2talalayout/internal/routing/ovg_edge_router.go, lib/imageasset/probe.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ir/compile.go"},"region":{"startLine":607}}}],"partialFingerprints":{"codehealthFindingId/v1":"6a184d4c8ae4a40d28d6bd5ba9cae7c6bc3ada8774f4f6bcf36587f514505294"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060f == nil || f.Outline == nil || f.Shaping == nil\u0060 appears character-identically in 2 files \u2014 d2renderers/internal/fontface/colrv1.go, d2renderers/internal/fontface/face.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/internal/fontface/colrv1.go"},"region":{"startLine":169}}}],"partialFingerprints":{"codehealthFindingId/v1":"aeb5742510086d29ce5659f6486bf628545a9b72067f6bff36e5371b49f37efe"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060first == 0 || second == 0 || (first \u003C 0) != (second \u003C 0)\u0060 appears character-identically in 2 files \u2014 d2layouts/d2talalayout/internal/quality/labels.go, d2layouts/d2talalayout/internal/routing/geometry.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/quality/labels.go"},"region":{"startLine":392}}}],"partialFingerprints":{"codehealthFindingId/v1":"aa47f765f820c29771fa07e5f41e8d67fc6c574ea8721ef72a48a3a61bd2c4db"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060firstMin \u003C= secondMax \u0026\u0026 secondMin \u003C= firstMax\u0060 appears character-identically in 2 files \u2014 d2layouts/d2talalayout/internal/quality/labels.go, d2layouts/d2talalayout/internal/routing/geometry.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/quality/labels.go"},"region":{"startLine":398}}}],"partialFingerprints":{"codehealthFindingId/v1":"f71ee92ef9857f158018656f6d05209f4409eeaf30b4c3d9d580bd14f39f0801"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060fixedOrigin != nil \u0026\u0026 (x \u003C fixedOrigin.X || y \u003C fixedOrigin.Y)\u0060 appears character-identically in 3 files \u2014 d2layouts/d2talalayout/internal/grouping/join.go, d2layouts/d2talalayout/internal/placement/moves.go, d2layouts/d2talalayout/internal/placement/sizeless_optimizer.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/grouping/join.go"},"region":{"startLine":306}}}],"partialFingerprints":{"codehealthFindingId/v1":"012b7c0cf90dd0317883619c17aa99fe3f513633277c13127b7859641420b67d"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060float64(obj.LabelDimensions.Width) \u003E obj.Width || float64(obj.LabelDimensions.Height) \u003E obj.Height\u0060 appears character-identically in 2 files \u2014 d2layouts/d2dagrelayout/layout.go, d2layouts/d2elklayout/layout.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2dagrelayout/layout.go"},"region":{"startLine":601}}}],"partialFingerprints":{"codehealthFindingId/v1":"0a0e8be379d1ac687de7c138ab24fc72d460b30b3f0e24383e94470bc494b803"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060fontName != \u0022\u0022 \u0026\u0026 !strings.EqualFold(fontName, \u0022default\u0022)\u0060 appears character-identically in 2 files \u2014 d2renderers/d2scenebuild/markdown.go, d2renderers/d2svg/markdown.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/markdown.go"},"region":{"startLine":207}}}],"partialFingerprints":{"codehealthFindingId/v1":"6661dad5b4679cfbae0cf4ee8b044b6a612956115a651534068a32d214caca84"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060g.CellSize \u003C 1 || math.IsNaN(g.CellSize) || math.IsInf(g.CellSize, 0) || math.Trunc(g.CellSize) != g.CellSize\u0060 appears character-identically in 2 files \u2014 d2layouts/d2talalayout/internal/placement/node_placement.go, d2layouts/d2talalayout/internal/placement/sized_optimizer.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/node_placement.go"},"region":{"startLine":456}}}],"partialFingerprints":{"codehealthFindingId/v1":"ada51a60df05b9ea6fb6e07739debaac5ae94b76d41e2535cd042521695f5242"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060g.Root.Direction.Value == \u0022down\u0022 || g.Root.Direction.Value == \u0022\u0022 || g.Root.Direction.Value == \u0022up\u0022\u0060 appears character-identically in 2 files \u2014 d2layouts/d2elklayout/layout.go, d2layouts/d2elklayout/wasm.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2elklayout/layout.go"},"region":{"startLine":276}}}],"partialFingerprints":{"codehealthFindingId/v1":"bd860cd367750f5267d6a55c3e9d18a2247a775df3c1ef14bd98d442a7365d56"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060g.Theme != nil \u0026\u0026 g.Theme.SpecialRules.Mono\u0060 appears character-identically in 2 files \u2014 d2exporter/export.go, d2graph/d2graph.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2exporter/export.go"},"region":{"startLine":35}}}],"partialFingerprints":{"codehealthFindingId/v1":"6fe6a845d19e6811cdfcaa4e008f43e26a580b73476d171364759dfaade88947"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060glyphID == 0 || glyphID \u003E math.MaxUint16 || int(glyphID) \u003E= f.Outline.NumGlyphs()\u0060 appears character-identically in 2 files \u2014 d2renderers/internal/fontface/colrv1.go, d2renderers/internal/fontface/face.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/internal/fontface/colrv1.go"},"region":{"startLine":195}}}],"partialFingerprints":{"codehealthFindingId/v1":"20b395d0cb0824a495ebc5ce7f66f6e029c67adb845909b1d78efbee476f8fad"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060gradient.Radius \u003C 0 || gradient.FocalRadius \u003C 0\u0060 appears character-identically in 2 files \u2014 d2renderers/d2raster/gradient.go, d2renderers/d2raster/vector_validation.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/gradient.go"},"region":{"startLine":204}}}],"partialFingerprints":{"codehealthFindingId/v1":"97b559a0915b30b3d1eb06dece220b8e196a50dec873256eac6545a1432f0d46"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060guard.used \u003E guard.limit || units \u003E guard.limit-guard.used\u0060 appears character-identically in 2 files \u2014 d2layouts/d2talalayout/internal/routing/route_search_guard.go, d2layouts/d2talalayout/internal/routing/route_stage_guard.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/route_search_guard.go"},"region":{"startLine":125}}}],"partialFingerprints":{"codehealthFindingId/v1":"cb8b13a9a590f5931208ed1a317f70812d2a5379a9e1d56c7f00977dbc6e8324"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060id.ScalarString() == \u0022_\u0022 \u0026\u0026 id.IsUnquoted()\u0060 appears character-identically in 2 files \u2014 d2graph/d2graph.go, d2ir/compile.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2graph/d2graph.go"},"region":{"startLine":912}}}],"partialFingerprints":{"codehealthFindingId/v1":"5e197cd6d0f617c55321c0a585930f10ebad80989ab3dfc90d26417acf5f5f31"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060left \u003C 0 || right \u003C 0 || left != 0 \u0026\u0026 right \u003E math.MaxInt64/left\u0060 appears character-identically in 2 files \u2014 d2renderers/d2raster/effects.go, d2renderers/d2raster/internal/scanline/rasterizer.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/effects.go"},"region":{"startLine":218}}}],"partialFingerprints":{"codehealthFindingId/v1":"9892b17ceb9ba1db61238340daec955771fea4672eba065fc58b9e7248df973c"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060left \u003C 0 || right \u003C 0 || right \u003E math.MaxInt64-left\u0060 appears character-identically in 2 files \u2014 d2renderers/d2raster/effects.go, d2renderers/d2raster/internal/scanline/rasterizer.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/effects.go"},"region":{"startLine":225}}}],"partialFingerprints":{"codehealthFindingId/v1":"e87b79dd8256ea0710b95691403b2d88b0d82f8c3fa8e7c2f8cc1b42631ed5e3"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060len(data) \u003E= 12 \u0026\u0026 bytes.Equal(data[:4], []byte(\u0022RIFF\u0022)) \u0026\u0026 bytes.Equal(data[8:12], []byte(\u0022WEBP\u0022))\u0060 appears character-identically in 3 files \u2014 d2renderers/d2raster/image.go, d2renderers/d2svgimport/image.go, lib/imageasset/probe.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/image.go"},"region":{"startLine":190}}}],"partialFingerprints":{"codehealthFindingId/v1":"997429cfb2ddd49550a21738cefe0e3cc36ca63664045235a3ad0fde8c727681"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060len(data) \u003E= 3 \u0026\u0026 data[0] == 0xff \u0026\u0026 data[1] == 0xd8 \u0026\u0026 data[2] == 0xff\u0060 appears character-identically in 3 files \u2014 d2renderers/d2raster/image.go, d2renderers/d2svgimport/image.go, lib/imageasset/probe.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/image.go"},"region":{"startLine":186}}}],"partialFingerprints":{"codehealthFindingId/v1":"cc68a18c1d6bb06c9f528fa5f029410e20f8e3007ceb0d5b28b450e7e2452913"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060len(data) \u003E= 6 \u0026\u0026 (bytes.Equal(data[:6], []byte(\u0022GIF87a\u0022)) || bytes.Equal(data[:6], []byte(\u0022GIF89a\u0022)))\u0060 appears character-identically in 3 files \u2014 d2renderers/d2raster/image.go, d2renderers/d2svgimport/image.go, lib/imageasset/probe.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/image.go"},"region":{"startLine":188}}}],"partialFingerprints":{"codehealthFindingId/v1":"6c6901e1361face416a40fa8ccba782677d5a216a540ec9379993f70db19a0c1"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060len(data) \u003E= 8 \u0026\u0026 bytes.Equal(data[:8], []byte(\u0022\\x89PNG\\r\\n\\x1a\\n\u0022))\u0060 appears character-identically in 3 files \u2014 d2renderers/d2raster/image.go, d2renderers/d2svgimport/image.go, lib/imageasset/probe.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/image.go"},"region":{"startLine":184}}}],"partialFingerprints":{"codehealthFindingId/v1":"b2b6111a5a6139e982a7247afc1ef8903f70437632f9e9bb5455cc0cf9e7ed8c"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060len(diagram.Layers) \u003E 0 || len(diagram.Scenarios) \u003E 0 || len(diagram.Steps) \u003E 0\u0060 appears character-identically in 2 files \u2014 d2cli/board_output.go, d2cli/main.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2cli/board_output.go"},"region":{"startLine":176}}}],"partialFingerprints":{"codehealthFindingId/v1":"415d94895b38c13afe75dd6480e53b7f762d5a1a719987769d72e55a6b1d0853"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060len(node.Edges) \u003E limits.MaxEngineEdges || len(node.Nears) \u003E limits.MaxEngineNodes\u0060 appears character-identically in 2 files \u2014 d2layouts/d2talalayout/internal/placement/sized_optimizer.go, d2layouts/d2talalayout/internal/placement/sizeless_optimizer.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/sized_optimizer.go"},"region":{"startLine":136}}}],"partialFingerprints":{"codehealthFindingId/v1":"69de28eb7c9c8d16104255fbc6d44036dfdb77c65e146fb9cde30c65b088eb18"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060len(node.Graph.Nodes) \u003E limits.MaxEngineNodes || len(exceptions) \u003E limits.MaxEngineNodes\u0060 appears character-identically in 2 files \u2014 d2layouts/d2talalayout/internal/placement/optimization_guard.go, d2layouts/d2talalayout/internal/placement/optimizer_spatial_index.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/optimization_guard.go"},"region":{"startLine":443}}}],"partialFingerprints":{"codehealthFindingId/v1":"f6ff2f4edfc2ff8279d771789a7d68121d83167297e9226de94733106bec1cd2"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060len(overlappingEdges) \u003E 0 \u0026\u0026 !canOverlap\u0060 appears character-identically in 2 files \u2014 d2layouts/d2talalayout/internal/routing/ovg_edge_router.go, d2layouts/d2talalayout/internal/routing/slingshot.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/ovg_edge_router.go"},"region":{"startLine":1126}}}],"partialFingerprints":{"codehealthFindingId/v1":"9805eb18a62f6ac3353180d642eba36120788236d201c0f7b6145f772a4eb7d7"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060limits.MaxBytes \u003C= 0 || limits.MaxDepth \u003C= 0 || limits.MaxElements \u003C= 0 || limits.MaxAttributes \u003C= 0 || limits.MaxAttributeBytes \u003C= 0 || lim\u2026\u0060 appears character-identically in 2 files \u2014 d2renderers/d2scenebuild/latex.go, d2renderers/d2svgimport/import.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/latex.go"},"region":{"startLine":102}}}],"partialFingerprints":{"codehealthFindingId/v1":"199604e447fb2bc1f3884f055eb27841b87c7b84f50131cd68161562e40a5985"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060limits.MaxSets \u003C= 0 || limits.MaxOps \u003C= 0\u0060 appears character-identically in 2 files \u2014 d2renderers/d2sketch/scene.go, d2renderers/d2sketch/scene_connection.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2sketch/scene.go"},"region":{"startLine":38}}}],"partialFingerprints":{"codehealthFindingId/v1":"c5bad71854e94c76769f7957197ff8a952032e44918008fd253bc5062e35bfea"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060math.Floor(coordinate)-halfStroke \u003C= float64(minInt) || math.Ceil(coordinate)\u002BhalfStroke \u003E= float64(maxInt)\u0060 appears character-identically in 2 files \u2014 d2renderers/d2scenebuild/build.go, d2target/render_validation.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/build.go"},"region":{"startLine":1262}}}],"partialFingerprints":{"codehealthFindingId/v1":"1ef8373ad964a91715f6b63266ae29dc31ceb5fd52d7713754a4de8b0d5ce618"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060math.IsNaN(value) || math.IsInf(value, 0)\u0060 appears character-identically in 3 files \u2014 d2renderers/d2sketch/scene.go, d2renderers/d2svgimport/gradient.go, lib/svg/markup.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2sketch/scene.go"},"region":{"startLine":164}}}],"partialFingerprints":{"codehealthFindingId/v1":"4864085e722e7f45d836bbe249aaac9a94354c31eb307f6bcf8fefc11f2ab827"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060maxX \u003C float64(canvas.Min.X) || maxY \u003C float64(canvas.Min.Y) || minX \u003E float64(canvas.Max.X) || minY \u003E float64(canvas.Max.Y)\u0060 appears character-identically in 2 files \u2014 d2renderers/d2raster/geometry.go, d2renderers/d2raster/gradient.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/geometry.go"},"region":{"startLine":519}}}],"partialFingerprints":{"codehealthFindingId/v1":"b51d66efee4cbcc48dd317984cf38980bf0167831683b918c13ec69061a1346a"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060n.Type == d2target.ShapeClass || n.Type == d2target.ShapeSQLTable\u0060 appears character-identically in 3 files \u2014 d2renderers/d2isometric/d2isometricimg/native_shapes.go, d2renderers/d2isometric/d2isometricimg/native_structured.go, d2renderers/d2isometric/d2isometricimg/native_style.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/native_shapes.go"},"region":{"startLine":90}}}],"partialFingerprints":{"codehealthFindingId/v1":"0ed595ec958df8f468d9e0c16df360b2ac858740aa6fc25456d6923ea50419a2"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060nativeToken(n.Metadata.Original.Fill) \u0026\u0026 !n.FillExplicit\u0060 appears character-identically in 2 files \u2014 d2renderers/d2isometric/d2isometricimg/native_shapes.go, d2renderers/d2isometric/d2isometricimg/native_solids.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/native_shapes.go"},"region":{"startLine":319}}}],"partialFingerprints":{"codehealthFindingId/v1":"0f27caf9deaffc6341d84ad1f091304cc683720e8390fedb2574a0226630fbfa"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060node != edge.From \u0026\u0026 node != edge.To \u0026\u0026 (edge.From.IsDescendantOf(node) || edge.To.IsDescendantOf(node))\u0060 appears character-identically in 3 files \u2014 d2layouts/d2talalayout/internal/routing/edge_simplify.go, d2layouts/d2talalayout/internal/routing/filter.go, d2layouts/d2talalayout/internal/routing/standalone_route_guard.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/edge_simplify.go"},"region":{"startLine":216}}}],"partialFingerprints":{"codehealthFindingId/v1":"809b82d1e2577d8d163f6a7ecb42aea88d5f505bc24259b16e6ba589aa08ef1a"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060node == nil || node.Graph == nil || point == nil\u0060 appears character-identically in 2 files \u2014 d2layouts/d2talalayout/internal/placement/optimization_guard.go, d2layouts/d2talalayout/internal/placement/optimizer_spatial_index.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/optimization_guard.go"},"region":{"startLine":440}}}],"partialFingerprints":{"codehealthFindingId/v1":"7bf570906a946f1dc5bb8eacecab54bce8f12bce3f9b03c28e55661c1b9a23ed"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060node == other || nodeBelowOther || otherBelowNode\u0060 appears character-identically in 2 files \u2014 d2layouts/d2talalayout/internal/routing/ovg_resource.go, d2layouts/d2talalayout/internal/routing/route_search_guard.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/ovg_resource.go"},"region":{"startLine":655}}}],"partialFingerprints":{"codehealthFindingId/v1":"4ca057bbb85c4bb7419a196372710ed265684e7d27c487a060d17df50fa7d9ca"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060node.Container != nil || node.Cluster != nil || node.Sequence != nil\u0060 appears character-identically in 2 files \u2014 d2layouts/d2talalayout/internal/layoutgraph/graph.go, d2layouts/d2talalayout/internal/layoutgraph/transaction.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/graph.go"},"region":{"startLine":209}}}],"partialFingerprints":{"codehealthFindingId/v1":"ec10aa2b775fdf72e9401d2c6b050b358808a23b49cd66aaf03c926c926ccf79"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060node.IsInvisible || !node.IsRectangular()\u0060 appears character-identically in 2 files \u2014 d2layouts/d2talalayout/internal/quality/inspection_geometry.go, d2layouts/d2talalayout/internal/quality/inspection_labels.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/quality/inspection_geometry.go"},"region":{"startLine":20}}}],"partialFingerprints":{"codehealthFindingId/v1":"90089135a294f92253ce562905c70924c025c81430e66fa6277506acd4a692d9"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060node.Label != nil \u0026\u0026 node.Label.Position.IsOutside()\u0060 appears character-identically in 3 files \u2014 d2layouts/d2talalayout/internal/labeling/guard.go, d2layouts/d2talalayout/internal/layoutgraph/node.go, d2layouts/d2talalayout/internal/quality/evaluation_guard.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/labeling/guard.go"},"region":{"startLine":343}}}],"partialFingerprints":{"codehealthFindingId/v1":"9e344c85c2cbc5f551a14585a5fd24f4754f2e2a241f9da65cb376ba21dc2b8a"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060node.Label != nil \u0026\u0026 node.Label.Position.IsOutside() \u0026\u0026 allNodes != nil\u0060 appears character-identically in 2 files \u2014 d2layouts/d2talalayout/internal/graphbounds/bounds.go, d2layouts/d2talalayout/internal/layoutgraph/node.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/graphbounds/bounds.go"},"region":{"startLine":67}}}],"partialFingerprints":{"codehealthFindingId/v1":"58be5094d6b1accddad411b885cbbd54ddfb57a20817b9b21df6326270cf31a9"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060node.TopLeft.X == x \u0026\u0026 node.TopLeft.Y == y\u0060 appears character-identically in 3 files \u2014 d2layouts/d2talalayout/internal/placement/candidate_movement.go, d2layouts/d2talalayout/internal/placement/optimization_guard.go, d2layouts/d2talalayout/internal/trees/geometry.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/candidate_movement.go"},"region":{"startLine":40}}}],"partialFingerprints":{"codehealthFindingId/v1":"c337a9f7f6b1f905f9ad1b62a9890c4653323e27ae8dc02cd63abfe3f4c1a44e"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060node.primitive != nil \u0026\u0026 !node.primitive.bounds.Intersect(paintBounds).Empty()\u0060 appears character-identically in 2 files \u2014 d2renderers/d2raster/effects.go, d2renderers/d2raster/pattern.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/effects.go"},"region":{"startLine":380}}}],"partialFingerprints":{"codehealthFindingId/v1":"158798e09662edbc2381d171840634fbdaa70221064d56524e004cf9be799c4c"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060nodeA.IsNodeCenter \u0026\u0026 !nodeB.isPort() || nodeB.IsNodeCenter \u0026\u0026 !nodeA.isPort()\u0060 appears character-identically in 2 files \u2014 d2layouts/d2talalayout/internal/routing/ovg.go, d2layouts/d2talalayout/internal/routing/ovg_resource.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/ovg.go"},"region":{"startLine":54}}}],"partialFingerprints":{"codehealthFindingId/v1":"27f9ea4347780260267db937c38ea57a1ec2ab8e9c58ee28dcbd96dcc32f50ec"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060nodeIndex \u003C len(nodeQueue) || edgeIndex \u003C len(edgeQueue) || clusterIndex \u003C len(clusterQueue) || sequenceIndex \u003C len(sequenceQueue) || treeIn\u2026\u0060 appears character-identically in 2 files \u2014 d2layouts/d2talalayout/internal/layoutgraph/topology_preflight.go, d2layouts/d2talalayout/internal/layoutgraph/transaction_snapshot.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/topology_preflight.go"},"region":{"startLine":810}}}],"partialFingerprints":{"codehealthFindingId/v1":"fb3a9a422c97f9aa6aec1d5fe413a2ec2a96809cb1d44320ea0d53594cd29061"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060o.TopLeft.X == -layoutgraph.ContainerPadding \u0026\u0026 o.TopLeft.Y == -layoutgraph.ContainerPadding\u0060 appears character-identically in 2 files \u2014 d2layouts/d2talalayout/internal/packing/combine.go, d2layouts/d2talalayout/internal/placement/sized_optimizer.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/packing/combine.go"},"region":{"startLine":333}}}],"partialFingerprints":{"codehealthFindingId/v1":"21b2256757f86b430a6e8326fbb298c6e8eca419c061b6af2ca60ebfb8c80816"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060obj.HasIcon() \u0026\u0026 obj.IconPosition != nil\u0060 appears character-identically in 3 files \u2014 d2graph/layout.go, d2layouts/d2dagrelayout/layout.go, d2layouts/d2elklayout/layout.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2graph/layout.go"},"region":{"startLine":337}}}],"partialFingerprints":{"codehealthFindingId/v1":"0d0958cf3b0e8879aabd3195734c008a9ce8cef32a0a646729e43cbb820dfff9"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060obj.HasLabel() \u0026\u0026 obj.LabelPosition != nil\u0060 appears character-identically in 3 files \u2014 d2graph/layout.go, d2layouts/d2dagrelayout/layout.go, d2layouts/d2elklayout/layout.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2graph/layout.go"},"region":{"startLine":292}}}],"partialFingerprints":{"codehealthFindingId/v1":"a86fe9da9b87987d73993c8a66dd7e8cc4d9d0931c5f2cd5271ab1cdeae01974"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060obj.HasLabel() \u0026\u0026 obj.LabelPosition == nil\u0060 appears character-identically in 3 files \u2014 d2layouts/d2dagrelayout/layout.go, d2layouts/d2elklayout/layout.go, d2layouts/d2grid/layout.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2dagrelayout/layout.go"},"region":{"startLine":591}}}],"partialFingerprints":{"codehealthFindingId/v1":"3f1186c5a193661286474431f8cb2bd42db40f5ea0d7261445bce0155db8843f"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060obj.Icon != nil \u0026\u0026 obj.IconPosition == nil\u0060 appears character-identically in 3 files \u2014 d2layouts/d2dagrelayout/layout.go, d2layouts/d2elklayout/layout.go, d2layouts/d2grid/layout.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2dagrelayout/layout.go"},"region":{"startLine":578}}}],"partialFingerprints":{"codehealthFindingId/v1":"f7cbcc122b371841a9f0e08e62268a6e3c4c42ebe8298ad64f02bed96c3cf7e2"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060obj.SQLTable != nil || obj.Class != nil || obj.Language != \u0022\u0022\u0060 appears character-identically in 3 files \u2014 d2graph/d2graph.go, d2layouts/d2dagrelayout/layout.go, d2layouts/d2elklayout/layout.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2graph/d2graph.go"},"region":{"startLine":1160}}}],"partialFingerprints":{"codehealthFindingId/v1":"5e86f55e65bcd8e9e70a40231276346230a3adc4815a0641c3e3c055ad80b148"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060obj.Shape.Value == d2target.ShapeSQLTable || obj.Shape.Value == d2target.ShapeClass\u0060 appears character-identically in 2 files \u2014 d2exporter/export.go, d2oracle/edit.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2exporter/export.go"},"region":{"startLine":86}}}],"partialFingerprints":{"codehealthFindingId/v1":"b133f2200c52c2dc448789bc3424869e91c3cdab16b43b7f96af91198f401603"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060objectBounds.Width == 0 || objectBounds.Height == 0\u0060 appears character-identically in 3 files \u2014 d2renderers/d2raster/gradient.go, d2renderers/d2raster/pattern.go, d2renderers/d2raster/vector_validation.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/gradient.go"},"region":{"startLine":265}}}],"partialFingerprints":{"codehealthFindingId/v1":"076e810f6b23e4d7739026e4f119afede5485734cfd4fe79bbe73ee86a7e4efb"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060opts.OmitVersion == nil || !*opts.OmitVersion\u0060 appears character-identically in 2 files \u2014 d2renderers/d2svg/d2svg.go, d2renderers/d2svg/isometric.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svg/d2svg.go"},"region":{"startLine":3263}}}],"partialFingerprints":{"codehealthFindingId/v1":"c49f0fcaf5d34f50aa4ed1aa8e3570a6dce04559ebd9582b5e0576aa5fc7372a"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060orientation == geo.Left || orientation == geo.Right\u0060 appears character-identically in 3 files \u2014 d2layouts/d2talalayout/internal/placementcost/geometry.go, d2layouts/d2talalayout/internal/routing/coordinator.go, d2layouts/d2talalayout/internal/trees/layout.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placementcost/geometry.go"},"region":{"startLine":173}}}],"partialFingerprints":{"codehealthFindingId/v1":"9b75016108abecbbef91af52c178382818846731d298326985cdbf5d22e074af"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060orientation == geo.Top || orientation == geo.Bottom\u0060 appears character-identically in 2 files \u2014 d2layouts/d2talalayout/internal/routing/coordinator.go, d2layouts/d2talalayout/internal/trees/layout.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/coordinator.go"},"region":{"startLine":1396}}}],"partialFingerprints":{"codehealthFindingId/v1":"751f0ca19b6f10a5831b8a6909ab4f624bfb1b3d10efc26605b542e652d1d14e"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060other.TargetArrowhead == targetArrow \u0026\u0026 other.SourceArrowhead == sourceArrow\u0060 appears character-identically in 2 files \u2014 d2layouts/d2talalayout/internal/routing/coordinator.go, d2layouts/d2talalayout/internal/routing/standalone_route_guard.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/coordinator.go"},"region":{"startLine":1705}}}],"partialFingerprints":{"codehealthFindingId/v1":"005279e591b232af73c061030ab7e0b6b9969abd55ceb8089108fe30177f380d"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060pattern.Tile.Width == 0 || pattern.Tile.Height == 0\u0060 appears character-identically in 2 files \u2014 d2renderers/d2raster/pattern.go, d2renderers/d2raster/vector_validation.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/pattern.go"},"region":{"startLine":57}}}],"partialFingerprints":{"codehealthFindingId/v1":"c468506d5b1da047b1552c8ce7cd7732c33c2d0f6d14eb9505fe28929bcf0dcf"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060point.X \u003C otherNode.TopLeft.X\u002BotherNode.Width\u002Bdelta \u0026\u0026 right\u002Bdelta \u003E otherNode.TopLeft.X \u0026\u0026 point.Y \u003C otherNode.TopLeft.Y\u002BotherNode.Height\u002Bd\u2026\u0060 appears character-identically in 2 files \u2014 d2layouts/d2talalayout/internal/placement/optimization_guard.go, d2layouts/d2talalayout/internal/placement/optimizer_spatial_index.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/optimization_guard.go"},"region":{"startLine":482}}}],"partialFingerprints":{"codehealthFindingId/v1":"a54a063d4c8336ae5393b7435581839b77a695cd19b8e91109bb02a631b86245"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060point.X == currentNodeX \u0026\u0026 point.Y == currentNodeY\u0060 appears character-identically in 2 files \u2014 d2layouts/d2talalayout/internal/placement/sized_optimizer.go, d2layouts/d2talalayout/internal/placement/sizeless_optimizer.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/placement/sized_optimizer.go"},"region":{"startLine":1001}}}],"partialFingerprints":{"codehealthFindingId/v1":"0c6bba69bc5b898cd64637148e956058773a1e3e65f618ebf04b593aa88fa9f1"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060position.IsOutside() || position.IsBorder()\u0060 appears character-identically in 3 files \u2014 d2renderers/d2isometric/d2isometricimg/native_shapes.go, d2renderers/d2scenebuild/labels.go, d2renderers/d2scenebuild/markdown.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/native_shapes.go"},"region":{"startLine":483}}}],"partialFingerprints":{"codehealthFindingId/v1":"cd7e017ab9580e60a10de6182a5c8bec085fdd8dd303626b81e33dcfe3791d62"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060prepared.background != nil \u0026\u0026 prepared.background.A != 0\u0060 appears character-identically in 2 files \u2014 d2renderers/d2raster/bands.go, d2renderers/d2raster/raster.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/bands.go"},"region":{"startLine":86}}}],"partialFingerprints":{"codehealthFindingId/v1":"c2784b4368309f9a195dcff716bacb01e5cc7e47f63c67f2ab8e805bc64cacae"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060prepared.background != nil \u0026\u0026 prepared.background.A == 0xff\u0060 appears character-identically in 2 files \u2014 d2renderers/d2raster/bands.go, d2renderers/d2raster/raster.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/bands.go"},"region":{"startLine":84}}}],"partialFingerprints":{"codehealthFindingId/v1":"ca46c2fa681d1fdc50bbb857fe492d0ac0493aac38ab8f3df2ffc917294dfb05"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060prepared.background == nil || prepared.background.A == 0\u0060 appears character-identically in 2 files \u2014 d2renderers/d2raster/bands.go, d2renderers/d2raster/raster.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/bands.go"},"region":{"startLine":102}}}],"partialFingerprints":{"codehealthFindingId/v1":"4747de28f1e44a010956056592921e2ef4b4ffc89dc939f8535046a8396fc482"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060r == \u0027\\t\u0027 || r == \u0027\\n\u0027 || r == \u0027\\r\u0027 || r \u003E= 0x20 \u0026\u0026 r \u003C= 0xd7ff || r \u003E= 0xe000 \u0026\u0026 r \u003C= 0xfffd || r \u003E= 0x10000 \u0026\u0026 r \u003C= 0x10ffff\u0060 appears character-identically in 2 files \u2014 d2renderers/d2isometric/d2isometricimg/page.go, d2renderers/d2scenebuild/metadata.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/page.go"},"region":{"startLine":167}}}],"partialFingerprints":{"codehealthFindingId/v1":"521166dc7c403fbf2b789a9861644077a159ae4340e2598a91bc52385b67e95c"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060secondStartSide == 0 \u0026\u0026 secondEndSide == 0 \u0026\u0026 firstStartSide == 0 \u0026\u0026 firstEndSide == 0\u0060 appears character-identically in 2 files \u2014 d2layouts/d2talalayout/internal/quality/labels.go, d2layouts/d2talalayout/internal/routing/geometry.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/quality/labels.go"},"region":{"startLine":384}}}],"partialFingerprints":{"codehealthFindingId/v1":"38d1c4c955d4610975e02972bb635215f5a427ab2e1580c35d1d7ec0c12f7be1"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060segment.Start.X == segment.End.X \u0026\u0026 segment.Start.Y == segment.End.Y\u0060 appears character-identically in 3 files \u2014 d2layouts/d2talalayout/internal/labeling/placement.go, d2layouts/d2talalayout/internal/routing/balance_route_guard.go, lib/geo/segment.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/labeling/placement.go"},"region":{"startLine":1047}}}],"partialFingerprints":{"codehealthFindingId/v1":"1540b1b8db583b0abd4f5e18a2f77370397b010c885ffb9437f343734752fb18"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060start.X \u003E edge.Src.TopLeft.X\u002BsrcDx \u0026\u0026 start.Y \u003C edge.Src.TopLeft.Y\u002Bedge.Src.Height-srcDy\u0060 appears character-identically in 2 files \u2014 d2layouts/d2dagrelayout/layout.go, d2layouts/d2elklayout/layout.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2dagrelayout/layout.go"},"region":{"startLine":342}}}],"partialFingerprints":{"codehealthFindingId/v1":"7367e5a0d564d48b12f570faaaa300ad7ad436b105237af8f8913cef7a2bffa3"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060straddlesLine(secondStartSide, secondEndSide) \u0026\u0026 straddlesLine(firstStartSide, firstEndSide)\u0060 appears character-identically in 2 files \u2014 d2layouts/d2talalayout/internal/quality/labels.go, d2layouts/d2talalayout/internal/routing/geometry.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/quality/labels.go"},"region":{"startLine":388}}}],"partialFingerprints":{"codehealthFindingId/v1":"47bc4cb4883b7a547eec22426ca1f1389fa7b0c6cf33ee776768e48ec87c1a48"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060strings.HasPrefix(name, \u0022on\u0022) || name == \u0022attributename\u0022 \u0026\u0026 strings.EqualFold(strings.TrimSpace(attr.Value), \u0022class\u0022)\u0060 appears character-identically in 2 files \u2014 d2renderers/d2svg/font_corpus.go, d2renderers/d2svg/theme.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svg/font_corpus.go"},"region":{"startLine":137}}}],"partialFingerprints":{"codehealthFindingId/v1":"35284cf8496add86d978d401008ba62eb2f7680042238c7d24fdc5f5eb5e7863"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060stroke.join == d2scene.JoinMiter \u0026\u0026 stroke.miterLimit \u003E factor\u0060 appears character-identically in 2 files \u2014 d2renderers/d2raster/geometry.go, d2renderers/d2raster/raster.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/geometry.go"},"region":{"startLine":494}}}],"partialFingerprints":{"codehealthFindingId/v1":"133000096443380c893a599541b3064462a90b71df7306e0363e6b8df002e45c"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060targetShape.Icon != nil \u0026\u0026 targetShape.Type != d2target.ShapeImage\u0060 appears character-identically in 3 files \u2014 d2renderers/d2scenebuild/build.go, d2renderers/d2svg/class.go, d2renderers/d2svg/table.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/build.go"},"region":{"startLine":355}}}],"partialFingerprints":{"codehealthFindingId/v1":"5be5d0346aa0fbdf83f102047be197170acfe9631ab7519da7ca6ad5f541dbe2"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060targetShape.Tooltip != \u0022\u0022 \u0026\u0026 targetShape.Link != \u0022\u0022\u0060 appears character-identically in 2 files \u2014 d2renderers/d2scenebuild/appendix.go, d2renderers/d2svg/d2svg.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/appendix.go"},"region":{"startLine":281}}}],"partialFingerprints":{"codehealthFindingId/v1":"094a74d63fdac662bb75898ff73cce6f90ba11a41bee00e3eaa38c175026b357"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060targetShape.Tooltip != \u0022\u0022 \u0026\u0026 targetShape.TooltipPosition == \u0022\u0022\u0060 appears character-identically in 2 files \u2014 d2renderers/d2scenebuild/appendix.go, d2renderers/d2svg/d2svg.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/appendix.go"},"region":{"startLine":259}}}],"partialFingerprints":{"codehealthFindingId/v1":"62e3683348adfb432aa9fdde709c1c14c08f05f5e161c6f0775480d905874949"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060targetShape.Tooltip != \u0022\u0022 || targetShape.Link != \u0022\u0022\u0060 appears character-identically in 2 files \u2014 d2renderers/d2svg/d2svg.go, d2target/d2target.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svg/d2svg.go"},"region":{"startLine":2270}}}],"partialFingerprints":{"codehealthFindingId/v1":"bad2f85c73f7176a63bba91e4e671e54c9fe473f2eddc16ed07b2c0df16236ff"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060targetShape.Tooltip == \u0022\u0022 || targetShape.TooltipPosition == \u0022\u0022\u0060 appears character-identically in 2 files \u2014 d2renderers/d2scenebuild/tooltip.go, d2target/d2target.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/tooltip.go"},"region":{"startLine":23}}}],"partialFingerprints":{"codehealthFindingId/v1":"aa6d4be9b851f7ac97d28662273035264b04317e8831d8dcb52e9cc89a4b4727"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060targetShape.Type == d2target.ShapeClass || targetShape.Type == d2target.ShapeSQLTable\u0060 appears character-identically in 2 files \u2014 d2renderers/d2scenebuild/build.go, d2renderers/d2scenebuild/labels.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/build.go"},"region":{"startLine":393}}}],"partialFingerprints":{"codehealthFindingId/v1":"9069b02ae1ac0d0d704c138fd1e41499bad4e4f107e2fa3e5cb6c8a86a51795c"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060targetShape.Type == d2target.ShapeOval || targetShape.Type == d2target.ShapeCircle\u0060 appears character-identically in 2 files \u2014 d2renderers/d2scenebuild/shape_effects.go, d2renderers/d2scenebuild/sketch_shapes.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/shape_effects.go"},"region":{"startLine":348}}}],"partialFingerprints":{"codehealthFindingId/v1":"7aef0b6c8e4bf1bf04a91bf936f82d9ae556260f571d8a56d6de227f4a1d9826"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060token.Name.Space != \u0022\u0022 \u0026\u0026 token.Name.Space != \u0022http://www.w3.org/2000/svg\u0022\u0060 appears character-identically in 2 files \u2014 d2renderers/d2svg/font_corpus.go, lib/imageasset/probe.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svg/font_corpus.go"},"region":{"startLine":109}}}],"partialFingerprints":{"codehealthFindingId/v1":"08f5a80adeeca6545290a5155fb617237f150517c5997de34c5060b993fc3d15"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060topLeft == nil || !finite(topLeft.X) || !finite(topLeft.Y)\u0060 appears character-identically in 2 files \u2014 d2renderers/d2scenebuild/build.go, d2renderers/d2scenebuild/latex.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/build.go"},"region":{"startLine":479}}}],"partialFingerprints":{"codehealthFindingId/v1":"2a0f52037df5e3810efaf63254c64c9932a6bf4f2cc0d85b6a544ef095252f25"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060track.Property != d2scene.AnimateDropShadow \u0026\u0026 track.TargetIndex != 0\u0060 appears character-identically in 2 files \u2014 d2renderers/d2raster/raster.go, d2renderers/d2raster/vector_validation.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2raster/raster.go"},"region":{"startLine":1025}}}],"partialFingerprints":{"codehealthFindingId/v1":"912c222f66ede180603569b1c87ba1876d48a4bb3d91b292ba0646433afe064d"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060value \u003E 0 \u0026\u0026 a \u003C minInt\u002Bvalue || value \u003C 0 \u0026\u0026 a \u003E maxInt\u002Bvalue\u0060 appears character-identically in 2 files \u2014 d2renderers/d2scenebuild/build.go, d2target/render_validation.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/build.go"},"region":{"startLine":1317}}}],"partialFingerprints":{"codehealthFindingId/v1":"e66b2209554f49ce54f649e497c3c18aeaf50d9f2a572bfd910d619fa6df2c61"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060value \u003E 0 \u0026\u0026 a \u003E maxInt-value || value \u003C 0 \u0026\u0026 a \u003C minInt-value\u0060 appears character-identically in 2 files \u2014 d2renderers/d2scenebuild/build.go, d2target/render_validation.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/build.go"},"region":{"startLine":1310}}}],"partialFingerprints":{"codehealthFindingId/v1":"cd1606564e7580e2cf5df3e83d3e169e6bef2e1570833ebb5456992476f7c38c"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060value \u003E= \u0027A\u0027 \u0026\u0026 value \u003C= \u0027Z\u0027 || value \u003E= \u0027a\u0027 \u0026\u0026 value \u003C= \u0027z\u0027\u0060 appears character-identically in 2 files \u2014 d2renderers/d2svgimport/import.go, d2renderers/internal/fontface/shaping.go. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svgimport/import.go"},"region":{"startLine":982}}}],"partialFingerprints":{"codehealthFindingId/v1":"f1a2f002f3843d60075c373ed587f8a0b112bcbc96a07a117172adb5d11db591"}},{"ruleId":"X3","level":"warning","message":{"text":"Swallowed exception (caught, then discarded): \u0060if err != nil\u0060 takes every exception and records none of it \u2014 the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/version/version.go"},"region":{"startLine":10}}}],"partialFingerprints":{"codehealthFindingId/v1":"069747635bd82afff9c3fa11df9361f0d115778e8e7b4a0510b2b89ebccce40b"}},{"ruleId":"X3","level":"warning","message":{"text":"Swallowed exception (caught, then discarded): \u0060if err != nil\u0060 takes every exception and records none of it \u2014 the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/textmeasure/fontface.go"},"region":{"startLine":103}}}],"partialFingerprints":{"codehealthFindingId/v1":"2e3e51fe2c786b4ff91673c9ad884ef3b2763f981d3aa45d645a5b796f368c31"}},{"ruleId":"X3","level":"warning","message":{"text":"Swallowed exception (caught, then discarded): \u0060if err != nil\u0060 takes every exception and records none of it \u2014 the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/textmeasure/fontface.go"},"region":{"startLine":107}}}],"partialFingerprints":{"codehealthFindingId/v1":"747739e6c4b8a9c9fa555590d8d838761698358a979f0a1bafb3d7ae825497ee"}},{"ruleId":"X3","level":"warning","message":{"text":"Swallowed exception (caught, then discarded): \u0060if err != nil\u0060 takes every exception and records none of it \u2014 the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/textmeasure/fontface.go"},"region":{"startLine":131}}}],"partialFingerprints":{"codehealthFindingId/v1":"d20a8f295f04ea965aa99e6c9ffecdfa6399fd03d6b9c951ded26811361ae139"}},{"ruleId":"X3","level":"warning","message":{"text":"Swallowed exception (caught, then discarded): \u0060if err != nil\u0060 takes every exception and records none of it \u2014 the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/textmeasure/substitutions.go"},"region":{"startLine":15}}}],"partialFingerprints":{"codehealthFindingId/v1":"8e53099172fb3926f0e2682f9d34464639d5b3dae9eff53d260a2671152b9bd4"}},{"ruleId":"X3","level":"warning","message":{"text":"Swallowed exception (caught, then discarded): \u0060if err != nil\u0060 takes every exception and records none of it \u2014 the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/textmeasure/textmeasure.go"},"region":{"startLine":256}}}],"partialFingerprints":{"codehealthFindingId/v1":"820e249360a0ece4238924d753c61cf62413878b069798dac0a44854df46159a"}},{"ruleId":"X3","level":"warning","message":{"text":"Swallowed exception (caught, then discarded): \u0060if err != nil\u0060 takes every exception and records none of it \u2014 the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/textmeasure/textmeasure.go"},"region":{"startLine":271}}}],"partialFingerprints":{"codehealthFindingId/v1":"94a120972c0b5f691573811bf28d5d739a213e8ac0c31920c562fce51e0d589e"}},{"ruleId":"X3","level":"warning","message":{"text":"Swallowed exception (caught, then discarded): \u0060if err != nil\u0060 takes every exception and records none of it \u2014 the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/color/color.go"},"region":{"startLine":517}}}],"partialFingerprints":{"codehealthFindingId/v1":"e5a829fec8e86c4cc205357136b80e52b43c3c94b1bde64cbd9f5bb9ce1be4f0"}},{"ruleId":"X3","level":"warning","message":{"text":"Swallowed exception (caught, then discarded): \u0060if err != nil\u0060 takes every exception and records none of it \u2014 the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/color/color.go"},"region":{"startLine":522}}}],"partialFingerprints":{"codehealthFindingId/v1":"6157167b6b2cc537cece286b78c678e534faab0d4fdf7f55f0e723befb25a2e8"}},{"ruleId":"X3","level":"warning","message":{"text":"Swallowed exception (caught, then discarded): \u0060if err != nil\u0060 takes every exception and records none of it \u2014 the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/testutil/pptx.go"},"region":{"startLine":370}}}],"partialFingerprints":{"codehealthFindingId/v1":"23f9018362dc85cc3f7fcf10be1cb707781b74c3df9d7f3e6c4e1e4c2eaa4b5c"}},{"ruleId":"X3","level":"warning","message":{"text":"Swallowed exception (caught, then discarded): \u0060if _, err := face.Outline.LoadGlyph(\u0026buffer, outlineGlyph, fixed.I(1_000), nil); err != nil\u0060 takes every exception and records none of it \u2014 the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/internal/fontface/face.go"},"region":{"startLine":227}}}],"partialFingerprints":{"codehealthFindingId/v1":"d2743ac20cb78fbaf4f75582bc75eda6b1834a8b668e0270109fa78c7d71c983"}},{"ruleId":"X3","level":"warning","message":{"text":"Swallowed exception (caught, then discarded): \u0060if _, err := outline.LoadGlyph(\u0026buffer, outlineGlyph, fixed.I(1_000), nil); err != nil\u0060 takes every exception and records none of it \u2014 the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/internal/fontface/face.go"},"region":{"startLine":476}}}],"partialFingerprints":{"codehealthFindingId/v1":"f9de9b83f7a7e5946123ae7be1689bbdf553d665b923cbe1e4c8d07f303c72df"}},{"ruleId":"X3","level":"warning","message":{"text":"Swallowed exception (caught, then discarded): \u0060if err != nil\u0060 takes every exception and records none of it \u2014 the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svg/d2svg.go"},"region":{"startLine":1539}}}],"partialFingerprints":{"codehealthFindingId/v1":"659668c14fdb06f689de1bcce632ed9d9fdd65515234dcc9694ddc1fc7908edd"}},{"ruleId":"X3","level":"warning","message":{"text":"Swallowed exception (caught, then discarded): \u0060if err != nil\u0060 takes every exception and records none of it \u2014 the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svg/d2svg.go"},"region":{"startLine":1675}}}],"partialFingerprints":{"codehealthFindingId/v1":"1575e5e0b8b57e03ca222aec61300bf9fbd59642b6d8773e09560462cd3c436c"}},{"ruleId":"X3","level":"warning","message":{"text":"Swallowed exception (caught, then discarded): \u0060if err != nil\u0060 takes every exception and records none of it \u2014 the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svg/font_corpus.go"},"region":{"startLine":101}}}],"partialFingerprints":{"codehealthFindingId/v1":"2d32596dd97f0b07f124d2521585f8f104c13d197ededba85dc5a950e37fdfce"}},{"ruleId":"X3","level":"warning","message":{"text":"Swallowed exception (caught, then discarded): \u0060if err != nil\u0060 takes every exception and records none of it \u2014 the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svg/appendix/appendix.go"},"region":{"startLine":185}}}],"partialFingerprints":{"codehealthFindingId/v1":"9412854707862183330dd842c1e6f93162a3eebc83cb8df9de4b6a7c95dce06c"}},{"ruleId":"X3","level":"warning","message":{"text":"Swallowed exception (caught, then discarded): \u0060if err != nil\u0060 takes every exception and records none of it \u2014 the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2scenebuild/shape_effects.go"},"region":{"startLine":509}}}],"partialFingerprints":{"codehealthFindingId/v1":"041df81733aad13e21edb0362390d2c5336b48fd2f06ed669e15fee35d67480a"}},{"ruleId":"X3","level":"warning","message":{"text":"Swallowed exception (caught, then discarded): \u0060if err != nil\u0060 takes every exception and records none of it \u2014 the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/native_structured.go"},"region":{"startLine":84}}}],"partialFingerprints":{"codehealthFindingId/v1":"a8f9b34eee8426e03c39c1f705e8dfd269a51e1568e9a75c9965d0d90b4d5fe9"}},{"ruleId":"X3","level":"warning","message":{"text":"Swallowed exception (caught, then discarded): \u0060if err != nil\u0060 takes every exception and records none of it \u2014 the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2fonts/fallback.go"},"region":{"startLine":237}}}],"partialFingerprints":{"codehealthFindingId/v1":"7fc435d0f3d5fb2e3343fbeac50f9391e3e371b2297ac6b12aeb0d5678c3ec65"}},{"ruleId":"X3","level":"warning","message":{"text":"Swallowed exception (caught, then discarded): \u0060if readErr != nil\u0060 takes every exception and records none of it \u2014 the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2fonts/fallback.go"},"region":{"startLine":399}}}],"partialFingerprints":{"codehealthFindingId/v1":"02f423ec675328074b7580c3fa5e9120117d4d76bf83bb9468019c3b57c174a5"}},{"ruleId":"X3","level":"warning","message":{"text":"Swallowed exception (caught, then discarded): \u0060if err != nil\u0060 takes every exception and records none of it \u2014 the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2fonts/fallback.go"},"region":{"startLine":564}}}],"partialFingerprints":{"codehealthFindingId/v1":"505591ac9f5932b6c52030f84c935de7bf5070e00819575d6f7ca6d753e93d78"}},{"ruleId":"X3","level":"warning","message":{"text":"Swallowed exception (caught, then discarded): \u0060if err != nil\u0060 takes every exception and records none of it \u2014 the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2oracle/edit.go"},"region":{"startLine":3302}}}],"partialFingerprints":{"codehealthFindingId/v1":"9be225d4408ae9a333e2a06cd1b11c302283d38718de9361e9e0b4f1a5451154"}},{"ruleId":"X3","level":"warning","message":{"text":"Swallowed exception (caught, then discarded): \u0060if err != nil\u0060 takes every exception and records none of it \u2014 the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2oracle/edit.go"},"region":{"startLine":3306}}}],"partialFingerprints":{"codehealthFindingId/v1":"6c91f5e115046afc8f7b536b8daaace21948e0ec2239d927f7d792fc823415b6"}},{"ruleId":"X3","level":"warning","message":{"text":"Swallowed exception (caught, then discarded): \u0060if err != nil\u0060 takes every exception and records none of it \u2014 the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2oracle/get.go"},"region":{"startLine":206}}}],"partialFingerprints":{"codehealthFindingId/v1":"27be4ec0ea28c2a3d2a9af11b5d33d879d946648709fc3f1931a6d92a10803c6"}},{"ruleId":"X3","level":"warning","message":{"text":"Swallowed exception (caught, then discarded): \u0060if err != nil\u0060 takes every exception and records none of it \u2014 the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2oracle/get.go"},"region":{"startLine":221}}}],"partialFingerprints":{"codehealthFindingId/v1":"2978ca20fe47528a3f1cb14aeb66250e01dfe05bb2135ac442bc6f4cf9cb258c"}},{"ruleId":"X3","level":"warning","message":{"text":"Swallowed exception (caught, then discarded): \u0060if err != nil\u0060 takes every exception and records none of it \u2014 the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/routing/coordinator.go"},"region":{"startLine":448}}}],"partialFingerprints":{"codehealthFindingId/v1":"007ecffad5b72956561b8410a920254d4d3d6e44d24f77db04a27504d5ec2891"}},{"ruleId":"X3","level":"warning","message":{"text":"Swallowed exception (caught, then discarded): \u0060if err != nil\u0060 takes every exception and records none of it \u2014 the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/packing/routed_container.go"},"region":{"startLine":283}}}],"partialFingerprints":{"codehealthFindingId/v1":"3413b0464f217b923d103473eba002c1f2d78a527c863ccfba6a631e33093c53"}},{"ruleId":"X3","level":"warning","message":{"text":"Swallowed exception (caught, then discarded): \u0060if captureErr != nil\u0060 takes every exception and records none of it \u2014 the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2layouts/d2talalayout/internal/layoutgraph/transaction_snapshot.go"},"region":{"startLine":382}}}],"partialFingerprints":{"codehealthFindingId/v1":"d8fc9300583287a3c48f1be34592504991dfa8adf0eb507d774f43254b0d7f46"}},{"ruleId":"X3","level":"warning","message":{"text":"Swallowed exception (empty catch): An empty catch block silently discards the error \u2014 failures vanish with no log and no rethrow. Log it, handle it, or don\u0027t catch it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2js/d2wasm/api.go"},"region":{"startLine":32}}}],"partialFingerprints":{"codehealthFindingId/v1":"f0affa77f1df39fa30fc2ed1dbaab9a34e66617b0f4039ac06239c35defa7977"}},{"ruleId":"X3","level":"warning","message":{"text":"Swallowed exception (caught, then discarded): \u0060if err != nil\u0060 takes every exception and records none of it \u2014 the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ir/compile.go"},"region":{"startLine":1950}}}],"partialFingerprints":{"codehealthFindingId/v1":"2723b49fd2e28a24bb810304dee3ae49846b355efd9f9c70ea594a2dfbd79932"}},{"ruleId":"X3","level":"warning","message":{"text":"Swallowed exception (caught, then discarded): \u0060if err != nil\u0060 takes every exception and records none of it \u2014 the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ir/compile.go"},"region":{"startLine":1998}}}],"partialFingerprints":{"codehealthFindingId/v1":"565840786880460136240e01a8df35aec26f1b5301a805a9863893ff8fbfdd62"}},{"ruleId":"X3","level":"warning","message":{"text":"Swallowed exception (caught, then discarded): \u0060if err != nil\u0060 takes every exception and records none of it \u2014 the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ir/d2ir.go"},"region":{"startLine":1465}}}],"partialFingerprints":{"codehealthFindingId/v1":"74b7202b38f477aac6cddb4a64e1446dec79ecf4333f4db3e827df5432b9c1a7"}},{"ruleId":"X3","level":"warning","message":{"text":"Swallowed exception (caught, then discarded): \u0060if err != nil\u0060 takes every exception and records none of it \u2014 the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ir/d2ir.go"},"region":{"startLine":1533}}}],"partialFingerprints":{"codehealthFindingId/v1":"da65d87fc7a4b542f9570056a7459d344eab239900e5a236cbd8b95b50588556"}},{"ruleId":"X3","level":"warning","message":{"text":"Swallowed exception (caught, then discarded): \u0060if err != nil\u0060 takes every exception and records none of it \u2014 the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ir/d2ir.go"},"region":{"startLine":1572}}}],"partialFingerprints":{"codehealthFindingId/v1":"c9d9e809a5f315e5393a217f08c48cdc74d0e6e63d03a15ee40edcda9a98800b"}},{"ruleId":"X3","level":"warning","message":{"text":"Swallowed exception (caught, then discarded): \u0060if err != nil\u0060 takes every exception and records none of it \u2014 the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ir/d2ir.go"},"region":{"startLine":1615}}}],"partialFingerprints":{"codehealthFindingId/v1":"c088d2ebe5c8c0e4594d4641651b0db6e6121086ebb1c60755e28e17d503efdd"}},{"ruleId":"X3","level":"warning","message":{"text":"Swallowed exception (caught, then discarded): \u0060if err != nil\u0060 takes every exception and records none of it \u2014 the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2ir/import.go"},"region":{"startLine":252}}}],"partialFingerprints":{"codehealthFindingId/v1":"e72753bb411437fca9806d8706e7d5495afd64f96508bd6e885c1e41cd83715c"}},{"ruleId":"X3","level":"warning","message":{"text":"Swallowed exception (caught, then discarded): \u0060if err != nil\u0060 takes every exception and records none of it \u2014 the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2graph/d2graph.go"},"region":{"startLine":826}}}],"partialFingerprints":{"codehealthFindingId/v1":"ccac24c2bda03737d727f8fde7a0e0ecaf488ffb430eaf874dc420a0f4afcdb9"}},{"ruleId":"X3","level":"warning","message":{"text":"Swallowed exception (caught, then discarded): \u0060if err != nil\u0060 takes every exception and records none of it \u2014 the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2graph/d2graph.go"},"region":{"startLine":830}}}],"partialFingerprints":{"codehealthFindingId/v1":"eb3e28d5a0449175e1bdb7c709a4be5bb36573fb98fbf4c26b5949804ad1c5c3"}},{"ruleId":"X3","level":"warning","message":{"text":"Swallowed exception (caught, then discarded): \u0060if err != nil\u0060 takes every exception and records none of it \u2014 the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2exporter/export.go"},"region":{"startLine":300}}}],"partialFingerprints":{"codehealthFindingId/v1":"93a199597e4969b7fa8df0082fc40766f64967b75e350d21c1a0320f6a686dbe"}},{"ruleId":"X3","level":"warning","message":{"text":"Swallowed exception (caught, then discarded): \u0060if err != nil\u0060 takes every exception and records none of it \u2014 the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2compiler/compile.go"},"region":{"startLine":1736}}}],"partialFingerprints":{"codehealthFindingId/v1":"bf724d1af0f4fbca8517b9dbb59a5983c8bf242cb07f46fbf0ff2be63c9994c5"}},{"ruleId":"X3","level":"warning","message":{"text":"Swallowed exception (caught, then discarded): \u0060if err != nil\u0060 takes every exception and records none of it \u2014 the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2cli/watch.go"},"region":{"startLine":727}}}],"partialFingerprints":{"codehealthFindingId/v1":"f30313769a3336d7307cccd2942820e8a4d199c81e29b746bd4bec9ed32827b5"}},{"ruleId":"X6","level":"note","message":{"text":"Hand-rolled JSON/XML parsing via regex: A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand \u2014 malformed or differently-typed content (e.g. \u0060\u0022amount\u0022: \u00225\u0022\u0060 as a string) silently mis-parses instead of failing validation. This Go code already uses a real parser in the same package; use it here too."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/imgbundler/imgbundler.go"},"region":{"startLine":44}}}],"partialFingerprints":{"codehealthFindingId/v1":"c8cc45e2c01e05ac865ba6769cd09ae105bf60a98edf0dd5c79ba53029fc4406"}},{"ruleId":"X6","level":"note","message":{"text":"Hand-rolled JSON/XML parsing via regex: A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand \u2014 malformed or differently-typed content (e.g. \u0060\u0022amount\u0022: \u00225\u0022\u0060 as a string) silently mis-parses instead of failing validation. This Go code already uses a real parser in the same package; use it here too."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2svg/d2svg.go"},"region":{"startLine":2842}}}],"partialFingerprints":{"codehealthFindingId/v1":"8a01d3f252ded26f3be39b43795b090f0fd1534c00ecce87e6a1eab8469c84ed"}},{"ruleId":"X7","level":"note","message":{"text":"Silent fallback default on error: \u0060GetID\u0060 turns a non-nil \u0060err\u0060 into \u0060return \u0022\u0022\u0060 \u2014 a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the \u0060if\u0060 or in the doc comment, and the row stops firing."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2oracle/get.go"},"region":{"startLine":221}}}],"partialFingerprints":{"codehealthFindingId/v1":"2a3557bc697a77e347f9829f96d9c4b5a3bcca6334e882923d643773b3886e0c"}},{"ruleId":"X7","level":"note","message":{"text":"Silent fallback default on error: \u0060nativeStructuredTextRow\u0060 turns a non-nil \u0060err\u0060 into \u0060return -1\u0060 \u2014 a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the \u0060if\u0060 or in the doc comment, and the row stops firing."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"d2renderers/d2isometric/d2isometricimg/native_structured.go"},"region":{"startLine":84}}}],"partialFingerprints":{"codehealthFindingId/v1":"f8328251b41c2eacc1ade28beda569fa03c93eccd33266bb040ff02ddf6287e5"}},{"ruleId":"X7","level":"note","message":{"text":"Silent fallback default on error: \u0060getExpectedPptxFileCount\u0060 turns a non-nil \u0060err\u0060 into \u0060return -1\u0060 \u2014 a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the \u0060if\u0060 or in the doc comment, and the row stops firing."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"internal/testutil/pptx.go"},"region":{"startLine":370}}}],"partialFingerprints":{"codehealthFindingId/v1":"3842e6b2a15f725094c2d6251d29fe9063961c43d3b11cc4b84bd56dd0e53733"}},{"ruleId":"X7","level":"note","message":{"text":"Silent fallback default on error: \u0060OnlyNumbers\u0060 turns a non-nil \u0060err\u0060 into \u0060return \u0022\u0022\u0060 \u2014 a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the \u0060if\u0060 or in the doc comment, and the row stops firing."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"lib/version/version.go"},"region":{"startLine":10}}}],"partialFingerprints":{"codehealthFindingId/v1":"d74139bb6692fac33c4dd8fcaacea2a1d34cee7c99e9d912b93a47cf4132c2ed"}}],"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-242","guid":"5c147e5c-be37-b051-9928-764ef5a8f3d3","name":"CWE-242","shortDescription":{"text":"CWE-242"},"helpUri":"https://cwe.mitre.org/data/definitions/242.html"},{"id":"CWE-248","guid":"64b58946-d244-a556-a48a-f82fcd4f4186","name":"Uncaught Exception","shortDescription":{"text":"Uncaught Exception"},"helpUri":"https://cwe.mitre.org/data/definitions/248.html"},{"id":"CWE-250","guid":"52ee12e8-390a-7351-b1e6-388afa694e54","name":"CWE-250","shortDescription":{"text":"CWE-250"},"helpUri":"https://cwe.mitre.org/data/definitions/250.html"},{"id":"CWE-252","guid":"78915dc5-e486-f858-bc3c-aa570ad9010d","name":"Unchecked Return Value","shortDescription":{"text":"Unchecked Return Value"},"helpUri":"https://cwe.mitre.org/data/definitions/252.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-319","guid":"7af97476-9f0d-4458-9163-3d2043918a1a","name":"Cleartext Transmission of Sensitive Information","shortDescription":{"text":"Cleartext Transmission of Sensitive Information"},"helpUri":"https://cwe.mitre.org/data/definitions/319.html"},{"id":"CWE-328","guid":"f0ffc869-97c3-dc5c-8825-be1159f1fc5f","name":"Reversible One-Way Hash","shortDescription":{"text":"Reversible One-Way Hash"},"helpUri":"https://cwe.mitre.org/data/definitions/328.html"},{"id":"CWE-338","guid":"e89b7604-c3f7-8b53-bc8c-4d4718c28617","name":"Use of Cryptographically Weak Pseudo-Random Number Generator(PRNG)","shortDescription":{"text":"Use of Cryptographically Weak Pseudo-Random Number Generator(PRNG)"},"helpUri":"https://cwe.mitre.org/data/definitions/338.html"},{"id":"CWE-391","guid":"d9ef5687-8d79-9b51-b509-b83411fbcdc3","name":"Unchecked Error Condition","shortDescription":{"text":"Unchecked Error Condition"},"helpUri":"https://cwe.mitre.org/data/definitions/391.html"},{"id":"CWE-476","guid":"df404eaf-4a12-445c-9306-241412f65220","name":"NULL Pointer Dereference","shortDescription":{"text":"NULL Pointer Dereference"},"helpUri":"https://cwe.mitre.org/data/definitions/476.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-506","guid":"401d6455-56e3-0552-9a39-f77461673e3f","name":"Embedded Malicious Code","shortDescription":{"text":"Embedded Malicious Code"},"helpUri":"https://cwe.mitre.org/data/definitions/506.html"},{"id":"CWE-614","guid":"faa8a6a5-7e9d-5d5e-afc9-020ff49d250a","name":"Sensitive Cookie in HTTPS Session Without \u0027Secure\u0027 Attribute","shortDescription":{"text":"Sensitive Cookie in HTTPS Session Without \u0027Secure\u0027 Attribute"},"helpUri":"https://cwe.mitre.org/data/definitions/614.html"},{"id":"CWE-665","guid":"fe279ff9-a979-f952-9df9-3f7d05af85d8","name":"CWE-665","shortDescription":{"text":"CWE-665"},"helpUri":"https://cwe.mitre.org/data/definitions/665.html"},{"id":"CWE-703","guid":"fa730aa9-95e4-845e-83fa-8169f2cf339e","name":"Improper Check or Handling of Exceptional Conditions","shortDescription":{"text":"Improper Check or Handling of Exceptional Conditions"},"helpUri":"https://cwe.mitre.org/data/definitions/703.html"},{"id":"CWE-704","guid":"50bd74b4-a921-5159-8671-99fd7e78c810","name":"CWE-704","shortDescription":{"text":"CWE-704"},"helpUri":"https://cwe.mitre.org/data/definitions/704.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":"Improper Neutralization of Special Elements used in a Command (\u0027Command Injection\u0027)","shortDescription":{"text":"Improper Neutralization of Special Elements used in a Command (\u0027Command Injection\u0027)"},"helpUri":"https://cwe.mitre.org/data/definitions/77.html"},{"id":"CWE-78","guid":"2e31ceaf-c7ae-2e5e-9661-cfb1362789cf","name":"Improper Neutralization of Special Elements used in an OS Command (\u0027OS Command Injection\u0027)","shortDescription":{"text":"Improper Neutralization of Special Elements used in an OS Command (\u0027OS Command Injection\u0027)"},"helpUri":"https://cwe.mitre.org/data/definitions/78.html"},{"id":"CWE-79","guid":"fd45580b-e8c4-fc5e-8c2f-aa8fab0b4dbf","name":"Improper Neutralization of Input During Web Page Generation (\u0027Cross-site Scripting\u0027)","shortDescription":{"text":"Improper Neutralization of Input During Web Page Generation (\u0027Cross-site Scripting\u0027)"},"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":"Improper Neutralization of Special Elements used in an SQL Command (\u0027SQL Injection\u0027)","shortDescription":{"text":"Improper Neutralization of Special Elements used in an SQL Command (\u0027SQL Injection\u0027)"},"helpUri":"https://cwe.mitre.org/data/definitions/89.html"},{"id":"CWE-908","guid":"ca1da1d1-5eaf-e95b-adbb-4eb2bc10b9fc","name":"CWE-908","shortDescription":{"text":"CWE-908"},"helpUri":"https://cwe.mitre.org/data/definitions/908.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":"Improper Control of Generation of Code (\u0027Code Injection\u0027)","shortDescription":{"text":"Improper Control of Generation of Code (\u0027Code Injection\u0027)"},"helpUri":"https://cwe.mitre.org/data/definitions/94.html"}]},{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61","version":"2025","organization":"OWASP Foundation","informationUri":"https://top10.owasp.org/2025/","isComprehensive":false,"shortDescription":{"text":"The OWASP Top 10:2025 web application security risks."},"taxa":[{"id":"A01:2025","guid":"df693558-c822-0452-8f7b-4d53cb6bcc59","name":"Broken Access Control","shortDescription":{"text":"Broken Access Control"},"helpUri":"https://top10.owasp.org/2025/A01_2025-Broken_Access_Control/"},{"id":"A02:2025","guid":"668dee9e-41bc-6354-97d0-fdf8f40c50c1","name":"Security Misconfiguration","shortDescription":{"text":"Security Misconfiguration"},"helpUri":"https://top10.owasp.org/2025/A02_2025-Security_Misconfiguration/"},{"id":"A03:2025","guid":"168e227c-7735-2e57-bc6e-997affe644c5","name":"Software Supply Chain Failures","shortDescription":{"text":"Software Supply Chain Failures"},"helpUri":"https://top10.owasp.org/2025/A03_2025-Software_Supply_Chain_Failures/"},{"id":"A04:2025","guid":"6a9f5bfd-1a56-6453-beec-a7eff0ba3007","name":"Cryptographic Failures","shortDescription":{"text":"Cryptographic Failures"},"helpUri":"https://top10.owasp.org/2025/A04_2025-Cryptographic_Failures/"},{"id":"A05:2025","guid":"87e86033-3231-8458-8e4a-5cb82743553a","name":"Injection","shortDescription":{"text":"Injection"},"helpUri":"https://top10.owasp.org/2025/A05_2025-Injection/"},{"id":"A06:2025","guid":"491554d7-b8e4-9652-91a9-53700dc92ece","name":"Insecure Design","shortDescription":{"text":"Insecure Design"},"helpUri":"https://top10.owasp.org/2025/A06_2025-Insecure_Design/"},{"id":"A07:2025","guid":"334ddd78-539d-d35c-83dd-253647eb7eaf","name":"Authentication Failures","shortDescription":{"text":"Authentication Failures"},"helpUri":"https://top10.owasp.org/2025/A07_2025-Authentication_Failures/"},{"id":"A08:2025","guid":"84b0c297-710e-9a5f-9335-936ecb260c36","name":"Software or Data Integrity Failures","shortDescription":{"text":"Software or Data Integrity Failures"},"helpUri":"https://top10.owasp.org/2025/A08_2025-Software_or_Data_Integrity_Failures/"},{"id":"A10:2025","guid":"9ca3ab55-ca61-fd5e-b9ab-3dad2efa59d0","name":"Mishandling of Exceptional Conditions","shortDescription":{"text":"Mishandling of Exceptional Conditions"},"helpUri":"https://top10.owasp.org/2025/A10_2025-Mishandling_of_Exceptional_Conditions/"}]},{"name":"OWASP Top 10 CI/CD Security Risks","guid":"3c9b2a6e-5d14-4f7b-8e02-6a1d9c4b7f35","organization":"OWASP Foundation","informationUri":"https://owasp.org/www-project-top-10-ci-cd-security-risks/","isComprehensive":false,"shortDescription":{"text":"The OWASP Top 10 CI/CD Security Risks."},"taxa":[{"id":"CICD-SEC-3","guid":"458c83a6-ebf7-cf55-8cc3-b4d949bbf271","name":"Dependency Chain Abuse","shortDescription":{"text":"Dependency Chain Abuse"},"helpUri":"https://owasp.github.io/www-project-top-10-ci-cd-security-risks/CICD-SEC-03-Dependency-Chain-Abuse"},{"id":"CICD-SEC-6","guid":"f2ee2486-b260-2952-a41f-6b67fa713940","name":"Insufficient Credential Hygiene","shortDescription":{"text":"Insufficient Credential Hygiene"},"helpUri":"https://owasp.github.io/www-project-top-10-ci-cd-security-risks/CICD-SEC-06-Insufficient-Credential-Hygiene"}]}],"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":45,"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."]}]}