{"$schema":"https://json.schemastore.org/sarif-2.1.0.json","version":"2.1.0","runs":[{"tool":{"driver":{"name":"codehealth","informationUri":"https://codehealth.canine.dev","rules":[{"id":"D1","name":"Cyclomatic Complexity","shortDescription":{"text":"Cyclomatic Complexity"},"helpUri":"https://codehealth.canine.dev/dimensions/D1"},{"id":"D2","name":"Cognitive Complexity","shortDescription":{"text":"Cognitive Complexity"},"helpUri":"https://codehealth.canine.dev/dimensions/D2"},{"id":"D3","name":"God Classes","shortDescription":{"text":"God Classes"},"helpUri":"https://codehealth.canine.dev/dimensions/D3"},{"id":"D4","name":"Code Duplication","shortDescription":{"text":"Code Duplication"},"helpUri":"https://codehealth.canine.dev/dimensions/D4"},{"id":"D13","name":"Secret Scanning","shortDescription":{"text":"Secret Scanning"},"helpUri":"https://codehealth.canine.dev/dimensions/D13","relationships":[{"target":{"id":"CWE-798","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-259","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-798","CWE-259"]}},{"id":"D15","name":"Churn \u00D7 Complexity Hotspots","shortDescription":{"text":"Churn \u00D7 Complexity Hotspots"},"helpUri":"https://codehealth.canine.dev/dimensions/D15"},{"id":"D16","name":"Bus Factor","shortDescription":{"text":"Bus Factor"},"helpUri":"https://codehealth.canine.dev/dimensions/D16"},{"id":"D19","name":"Documentation Quality","shortDescription":{"text":"Documentation Quality"},"helpUri":"https://codehealth.canine.dev/dimensions/D19"},{"id":"D21","name":"Naming Consistency","shortDescription":{"text":"Naming Consistency"},"helpUri":"https://codehealth.canine.dev/dimensions/D21"},{"id":"D28","name":"Secrets (history)","shortDescription":{"text":"Secrets (history)"},"helpUri":"https://codehealth.canine.dev/dimensions/D28","relationships":[{"target":{"id":"CWE-798","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-259","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-798","CWE-259"]}},{"id":"D29","name":"Static Analysis (SAST)","shortDescription":{"text":"Static Analysis (SAST)"},"helpUri":"https://codehealth.canine.dev/dimensions/D29","relationships":[{"target":{"id":"CWE-79","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-89","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-78","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-94","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-77","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-79","CWE-89","CWE-78","CWE-94","CWE-77"]}},{"id":"D34","name":"Knowledge Freshness","shortDescription":{"text":"Knowledge Freshness"},"helpUri":"https://codehealth.canine.dev/dimensions/D34"},{"id":"D35","name":"Change Coupling","shortDescription":{"text":"Change Coupling"},"helpUri":"https://codehealth.canine.dev/dimensions/D35"},{"id":"D36","name":"Supply-chain Provenance \u0026 Signing","shortDescription":{"text":"Supply-chain Provenance \u0026 Signing"},"helpUri":"https://codehealth.canine.dev/dimensions/D36","relationships":[{"target":{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-494","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-1357","CWE-494"]}},{"id":"D37","name":"Vulnerability-disclosure Policy","shortDescription":{"text":"Vulnerability-disclosure Policy"},"helpUri":"https://codehealth.canine.dev/dimensions/D37","relationships":[{"target":{"id":"CWE-1059","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-1059"]}},{"id":"D38","name":"OSV Dependency Vulnerabilities","shortDescription":{"text":"OSV Dependency Vulnerabilities"},"helpUri":"https://codehealth.canine.dev/dimensions/D38","relationships":[{"target":{"id":"CWE-1395","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-937","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-1395","CWE-937"]}}]}},"results":[{"ruleId":"D1","level":"warning","message":{"text":"Handler.UnmarshalCaddyfile (cyclomatic 238): Handler.UnmarshalCaddyfile has cyclomatic complexity 238 (threshold 15). Of this number, 227 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":"modules/caddyhttp/reverseproxy/caddyfile.go"},"region":{"startLine":143}}}],"partialFingerprints":{"codehealthFindingId/v1":"4a420ddf454e62c824abf919fdf970a0a3a8708a370f4f87ec30c6c9db293b45"}},{"ruleId":"D1","level":"warning","message":{"text":"httpcaddyfile.parseTLS (cyclomatic 121): httpcaddyfile.parseTLS 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":"caddyconfig/httpcaddyfile/builtins.go"},"region":{"startLine":118}}}],"partialFingerprints":{"codehealthFindingId/v1":"455624b01ef5792c4f54ca59b67a6b3dc66ec11342a70ab5547b59528c5dc340"}},{"ruleId":"D1","level":"warning","message":{"text":"ServerType.serversFromPairings (cyclomatic 118): ServerType.serversFromPairings has cyclomatic complexity 118 (threshold 15). Of this number, 101 points are the body\u0027s own statements and 17 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":"caddyconfig/httpcaddyfile/httptype.go"},"region":{"startLine":551}}}],"partialFingerprints":{"codehealthFindingId/v1":"3316d8e3fdf62cee31262b4622a4b0508e34fb2f2a3304ae1c7947a4a61a295e"}},{"ruleId":"D1","level":"warning","message":{"text":"ServerType.buildTLSApp (cyclomatic 118): ServerType.buildTLSApp has cyclomatic complexity 118 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"caddyconfig/httpcaddyfile/tlsapp.go"},"region":{"startLine":36}}}],"partialFingerprints":{"codehealthFindingId/v1":"c36cf045e48fd50ce80d9599a7e4871eed7193f501d36581092222e0880a8154"}},{"ruleId":"D1","level":"warning","message":{"text":"HTTPTransport.UnmarshalCaddyfile (cyclomatic 104): HTTPTransport.UnmarshalCaddyfile has cyclomatic complexity 104 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/reverseproxy/caddyfile.go"},"region":{"startLine":1018}}}],"partialFingerprints":{"codehealthFindingId/v1":"243f228e987e8097e1d32e4ddd9f1acdf3d70cbb8efbbb3f5ddd18c4c0a99cb7"}},{"ruleId":"D1","level":"warning","message":{"text":"caddyhttp.addHTTPVarsToReplacer (cyclomatic 91): caddyhttp.addHTTPVarsToReplacer has cyclomatic complexity 91 (threshold 15). Most of this is not in the body itself: 1 of the 91 points is its own statement and the rest belongs to one function literal inside it that branches (line 62). 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":"modules/caddyhttp/replacer.go"},"region":{"startLine":58}}}],"partialFingerprints":{"codehealthFindingId/v1":"67aeec4f3fe7104dab1d156f669ea58ff0c4a22e3b9e390e29c58d4a8597b0ba"}},{"ruleId":"D1","level":"warning","message":{"text":"caddyfile.Format (cyclomatic 90): caddyfile.Format has cyclomatic complexity 90 (threshold 15). Of this number, 82 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":"caddyconfig/caddyfile/formatter.go"},"region":{"startLine":30}}}],"partialFingerprints":{"codehealthFindingId/v1":"5b2f0cebaa59f696569a0ba372f166a7710460ad16bfa6c9b8527d236d2e6194"}},{"ruleId":"D1","level":"warning","message":{"text":"httpcaddyfile.unmarshalCaddyfileServerOptions (cyclomatic 80): httpcaddyfile.unmarshalCaddyfileServerOptions has cyclomatic complexity 80 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"caddyconfig/httpcaddyfile/serveroptions.go"},"region":{"startLine":66}}}],"partialFingerprints":{"codehealthFindingId/v1":"babc218f992725a79445d0643eecd4f4957f440905262133d624dbec5267fab5"}},{"ruleId":"D1","level":"warning","message":{"text":"App.automaticHTTPSPhase1 (cyclomatic 78): App.automaticHTTPSPhase1 has cyclomatic complexity 78 (threshold 15). Of this number, 65 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":"modules/caddyhttp/autohttps.go"},"region":{"startLine":77}}}],"partialFingerprints":{"codehealthFindingId/v1":"ca30a72d1762067621235da8ed06c957942add3b3c8c3b0e63d5c536ed7782d2"}},{"ruleId":"D1","level":"warning","message":{"text":"ACMEIssuer.UnmarshalCaddyfile (cyclomatic 77): ACMEIssuer.UnmarshalCaddyfile has cyclomatic complexity 77 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddytls/acmeissuer.go"},"region":{"startLine":448}}}],"partialFingerprints":{"codehealthFindingId/v1":"b2266c3f3ad1dd335107984374d17a7815938be083c665c84528826399b8ba82"}},{"ruleId":"D1","level":"warning","message":{"text":"FileServer.ServeHTTP (cyclomatic 70): FileServer.ServeHTTP 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":"modules/caddyhttp/fileserver/staticfiles.go"},"region":{"startLine":269}}}],"partialFingerprints":{"codehealthFindingId/v1":"00ddd42c44329446069c07a827e37d0d6a4380e61149809d7ebee9550c4327dc"}},{"ruleId":"D1","level":"warning","message":{"text":"httpcaddyfile.consolidateConnPolicies (cyclomatic 68): httpcaddyfile.consolidateConnPolicies has cyclomatic complexity 68 (threshold 15). Of this number, 67 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":"caddyconfig/httpcaddyfile/httptype.go"},"region":{"startLine":1091}}}],"partialFingerprints":{"codehealthFindingId/v1":"2dc3459cd767ddb547d313a3af9d90602a551f5a1df71c77289cfb80d764be09"}},{"ruleId":"D1","level":"warning","message":{"text":"ServerType.Setup (cyclomatic 67): ServerType.Setup has cyclomatic complexity 67 (threshold 15). Of this number, 62 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":"caddyconfig/httpcaddyfile/httptype.go"},"region":{"startLine":57}}}],"partialFingerprints":{"codehealthFindingId/v1":"76dc01b3b5d34d3a0f812a6620c7ecb6ae63de6b17f2bf7c1e7ad5094f6a7053"}},{"ruleId":"D1","level":"warning","message":{"text":"HTTPTransport.NewTransport (cyclomatic 64): HTTPTransport.NewTransport has cyclomatic complexity 64 (threshold 15). Of this number, 39 points are the body\u0027s own statements and 25 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":"modules/caddyhttp/reverseproxy/httptransport.go"},"region":{"startLine":207}}}],"partialFingerprints":{"codehealthFindingId/v1":"00ec2549f4ca002deb56389b8ce0b86835e889d4e3ebfaf141b80932c1fdf510"}},{"ruleId":"D1","level":"warning","message":{"text":"httpcaddyfile.parseLogHelper (cyclomatic 55): httpcaddyfile.parseLogHelper has cyclomatic complexity 55 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"caddyconfig/httpcaddyfile/builtins.go"},"region":{"startLine":941}}}],"partialFingerprints":{"codehealthFindingId/v1":"5782427fcee5890ee15f6d06b1d0284bd1cd9e66a982c1e9e8eee3071de3fe16"}},{"ruleId":"D1","level":"warning","message":{"text":"httpcaddyfile.fillInGlobalACMEDefaults (cyclomatic 55): httpcaddyfile.fillInGlobalACMEDefaults has cyclomatic complexity 55 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"caddyconfig/httpcaddyfile/tlsapp.go"},"region":{"startLine":516}}}],"partialFingerprints":{"codehealthFindingId/v1":"2ef14c336ef4b11901613d36917f3e2a506ed2043615702a20e66b789f234005"}},{"ruleId":"D1","level":"warning","message":{"text":"parser.doImport (cyclomatic 53): parser.doImport 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":"caddyconfig/caddyfile/parse.go"},"region":{"startLine":356}}}],"partialFingerprints":{"codehealthFindingId/v1":"3e087fea575bd66d5324a1a1a4f4ad2c3a566fc443a7568b26f09966414d8cf7"}},{"ruleId":"D1","level":"warning","message":{"text":"lexer.next (cyclomatic 49): lexer.next 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":"caddyconfig/caddyfile/lexer.go"},"region":{"startLine":107}}}],"partialFingerprints":{"codehealthFindingId/v1":"c0effdbb9604f467a228cee4ab7e5c0cb5df82b3a8a6e09698f8cd2c58a1a033"}},{"ruleId":"D1","level":"warning","message":{"text":"reverseproxy.cmdReverseProxy (cyclomatic 48): reverseproxy.cmdReverseProxy 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":"modules/caddyhttp/reverseproxy/command.go"},"region":{"startLine":87}}}],"partialFingerprints":{"codehealthFindingId/v1":"93ad316101db1d0e9d0273fc1b1ac3f9ce7b8679ceff829d666c8e0d4f3c5c4e"}},{"ruleId":"D1","level":"warning","message":{"text":"FileWriter.UnmarshalCaddyfile (cyclomatic 46): FileWriter.UnmarshalCaddyfile 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":"modules/logging/filewriter.go"},"region":{"startLine":379}}}],"partialFingerprints":{"codehealthFindingId/v1":"de1c801a761b7d6477709f5c8a2d193a80f8784209fba6d6a100e87c3558c557"}},{"ruleId":"D1","level":"warning","message":{"text":"App.Provision (cyclomatic 45): App.Provision 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":"modules/caddyhttp/app.go"},"region":{"startLine":186}}}],"partialFingerprints":{"codehealthFindingId/v1":"19b5ce42f1bc4120468a72ba5880f7849585dc73b8c91c1b3eeba19913c348c7"}},{"ruleId":"D1","level":"warning","message":{"text":"TLS.Provision (cyclomatic 45): TLS.Provision 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":"modules/caddytls/tls.go"},"region":{"startLine":162}}}],"partialFingerprints":{"codehealthFindingId/v1":"bd54a694de817e19c4b9156413d084acb8988ed3c29a7172b45102872515cd84"}},{"ruleId":"D1","level":"warning","message":{"text":"caddy.unsyncedConfigAccess (cyclomatic 44): caddy.unsyncedConfigAccess 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":"admin.go"},"region":{"startLine":1159}}}],"partialFingerprints":{"codehealthFindingId/v1":"c106d825f3ef86a894e50c6f30b3feceaf12b1b291296cc321e9a28c4584733e"}},{"ruleId":"D1","level":"warning","message":{"text":"Handler.Provision (cyclomatic 44): Handler.Provision 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":"modules/caddyhttp/reverseproxy/reverseproxy.go"},"region":{"startLine":262}}}],"partialFingerprints":{"codehealthFindingId/v1":"4582d38441c754da58bcfbebaa64dc57f146441d78ebc9a4c57456fa924302ed"}},{"ruleId":"D1","level":"warning","message":{"text":"httpcaddyfile.parsePKIApp (cyclomatic 42): httpcaddyfile.parsePKIApp 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":"caddyconfig/httpcaddyfile/pkiapp.go"},"region":{"startLine":55}}}],"partialFingerprints":{"codehealthFindingId/v1":"8b67da89cd71c5f0d92266c28c231b23945e55aa1b7c7374fa9f045372abb8e1"}},{"ruleId":"D1","level":"warning","message":{"text":"MatchFile.selectFile (cyclomatic 41): MatchFile.selectFile has cyclomatic complexity 41 (threshold 15). Of this number, 30 points are the body\u0027s own statements and 11 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":"modules/caddyhttp/fileserver/matcher.go"},"region":{"startLine":333}}}],"partialFingerprints":{"codehealthFindingId/v1":"f8d2f138eeb2565065eb9eac4d94450c39f727d7197a3d55f3ae7f5fbcd0854d"}},{"ruleId":"D1","level":"warning","message":{"text":"TLS.publishECHConfigs (cyclomatic 40): TLS.publishECHConfigs has cyclomatic complexity 40 (threshold 15). Of this number, 39 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":"modules/caddytls/ech.go"},"region":{"startLine":314}}}],"partialFingerprints":{"codehealthFindingId/v1":"1e40e15a3116dc2718d96b040f7666f368eeffb4ff46845aa4ff78cc6fe136c3"}},{"ruleId":"D1","level":"warning","message":{"text":"caddyhttp.getReqTLSReplacement (cyclomatic 39): caddyhttp.getReqTLSReplacement 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":"modules/caddyhttp/replacer.go"},"region":{"startLine":414}}}],"partialFingerprints":{"codehealthFindingId/v1":"a18de7fd3d33b5bfcbd358acf639a2d9a9623404fdb5479e5c384474ba510594"}},{"ruleId":"D1","level":"warning","message":{"text":"App.createAutomationPolicies (cyclomatic 39): App.createAutomationPolicies 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":"modules/caddyhttp/autohttps.go"},"region":{"startLine":597}}}],"partialFingerprints":{"codehealthFindingId/v1":"fa1a135977318b2be7e43bc31312dc3dc15913396fcb5828a8c52e96f80fe7fb"}},{"ruleId":"D1","level":"warning","message":{"text":"FileServer.UnmarshalCaddyfile (cyclomatic 39): FileServer.UnmarshalCaddyfile 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":"modules/caddyhttp/fileserver/caddyfile.go"},"region":{"startLine":67}}}],"partialFingerprints":{"codehealthFindingId/v1":"bc84311433605e154dc828c06346f3003ce28f49fb0da0806af3669df0653701"}},{"ruleId":"D1","level":"warning","message":{"text":"App.Start (cyclomatic 38): App.Start has cyclomatic complexity 38 (threshold 15). Of this number, 37 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/app.go"},"region":{"startLine":465}}}],"partialFingerprints":{"codehealthFindingId/v1":"45dfc03560fce3ac18970485071001254751f6cbb7244511c8709dd91b4e487c"}},{"ruleId":"D1","level":"warning","message":{"text":"fastcgi.parsePHPFastCGI (cyclomatic 36): fastcgi.parsePHPFastCGI 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":"modules/caddyhttp/reverseproxy/fastcgi/caddyfile.go"},"region":{"startLine":172}}}],"partialFingerprints":{"codehealthFindingId/v1":"7dac2c346db89c630b769b98edae9f335f873ea7a716e91fd0e318d7aaaf8ba6"}},{"ruleId":"D1","level":"warning","message":{"text":"HeaderOps.ApplyTo (cyclomatic 35): HeaderOps.ApplyTo 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":"modules/caddyhttp/headers/headers.go"},"region":{"startLine":220}}}],"partialFingerprints":{"codehealthFindingId/v1":"d289e8a935ba0645af9b47b4e3201d0cc632fedfd94e0e286df3fabf96386bc0"}},{"ruleId":"D1","level":"warning","message":{"text":"ConnectionPolicy.UnmarshalCaddyfile (cyclomatic 35): ConnectionPolicy.UnmarshalCaddyfile 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":"modules/caddytls/connpolicy.go"},"region":{"startLine":481}}}],"partialFingerprints":{"codehealthFindingId/v1":"93397a6abdb0804e8c4bb0b1ec6007386f6b056e2b06a7be9198240de9fb830c"}},{"ruleId":"D1","level":"warning","message":{"text":"Handler.doActiveHealthCheck (cyclomatic 34): Handler.doActiveHealthCheck 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":"modules/caddyhttp/reverseproxy/healthchecks.go"},"region":{"startLine":391}}}],"partialFingerprints":{"codehealthFindingId/v1":"54e94b62aae108ad326391bf64f9c7ccfd59e5d6b0151bf08da91d02e0b05781"}},{"ruleId":"D1","level":"warning","message":{"text":"Rewrite.Rewrite (cyclomatic 34): Rewrite.Rewrite 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":"modules/caddyhttp/rewrite/rewrite.go"},"region":{"startLine":158}}}],"partialFingerprints":{"codehealthFindingId/v1":"3f8fa1e17d6fea752d4161f1ed083eb8a1affc3ae89ce11921a2d28c2371c484"}},{"ruleId":"D1","level":"warning","message":{"text":"Server.ServeHTTP (cyclomatic 33): Server.ServeHTTP 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":"modules/caddyhttp/server.go"},"region":{"startLine":421}}}],"partialFingerprints":{"codehealthFindingId/v1":"94d2284ea00486c929da67c864cdcfd5f3b1fc1facf775a6f7e524942686c0c6"}},{"ruleId":"D1","level":"warning","message":{"text":"caddyhttp.cmdRespond (cyclomatic 31): caddyhttp.cmdRespond 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":"modules/caddyhttp/staticresp.go"},"region":{"startLine":316}}}],"partialFingerprints":{"codehealthFindingId/v1":"dd2283631fe8e1e4f795dea43f7a366ccf9e756cf3754fce975dd55af7e748d0"}},{"ruleId":"D1","level":"warning","message":{"text":"TLSConfig.MakeTLSClientConfig (cyclomatic 31): TLSConfig.MakeTLSClientConfig has cyclomatic complexity 31 (threshold 15). Of this number, 28 points are the body\u0027s own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/reverseproxy/httptransport.go"},"region":{"startLine":790}}}],"partialFingerprints":{"codehealthFindingId/v1":"6200c2ddfe44d75f0a1c71e14296ca4bbb12b94f49878502433fccf663c562d0"}},{"ruleId":"D1","level":"warning","message":{"text":"ACMEIssuer.Provision (cyclomatic 31): ACMEIssuer.Provision 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":"modules/caddytls/acmeissuer.go"},"region":{"startLine":129}}}],"partialFingerprints":{"codehealthFindingId/v1":"88860b4f5aabe181d41913e43f66a3183435237ad4be0cac304a2879f1ef4ffa"}},{"ruleId":"D1","level":"warning","message":{"text":"caddycmd.cmdRun (cyclomatic 30): caddycmd.cmdRun has cyclomatic complexity 30 (threshold 15). Of this number, 29 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/commandfuncs.go"},"region":{"startLine":188}}}],"partialFingerprints":{"codehealthFindingId/v1":"1762220dfcec6840bf5d3f63c9735a856d8159d247130a9091e10d3db50bc1ff"}},{"ruleId":"D1","level":"warning","message":{"text":"Handler.reverseProxy (cyclomatic 30): Handler.reverseProxy has cyclomatic complexity 30 (threshold 15). Of this number, 29 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/reverseproxy/reverseproxy.go"},"region":{"startLine":991}}}],"partialFingerprints":{"codehealthFindingId/v1":"e7c64ddbfada22f8d3d73f123d03db808ad884160ae5c5b0f1b840b8126b4ae5"}},{"ruleId":"D1","level":"warning","message":{"text":"acmeserver.parseACMEServer (cyclomatic 30): acmeserver.parseACMEServer 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":"modules/caddypki/acmeserver/caddyfile.go"},"region":{"startLine":45}}}],"partialFingerprints":{"codehealthFindingId/v1":"09855f56caadee217b5fa67f741de30e19b27df4b84754f4d0115004c968ca5d"}},{"ruleId":"D1","level":"warning","message":{"text":"ZeroSSLIssuer.UnmarshalCaddyfile (cyclomatic 30): ZeroSSLIssuer.UnmarshalCaddyfile 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":"modules/caddytls/zerosslissuer.go"},"region":{"startLine":138}}}],"partialFingerprints":{"codehealthFindingId/v1":"b2b02ccb0e646b99cc35955ddd8af43a136420ac65099a435ec177ffe4eeb2c5"}},{"ruleId":"D1","level":"warning","message":{"text":"AUpstreams.UnmarshalCaddyfile (cyclomatic 29): AUpstreams.UnmarshalCaddyfile 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":"modules/caddyhttp/reverseproxy/caddyfile.go"},"region":{"startLine":1562}}}],"partialFingerprints":{"codehealthFindingId/v1":"74ab549e9c57a5591b29cdfee1b6a0070abf1e3b7d73aefe58fd76bb73b28aff"}},{"ruleId":"D1","level":"warning","message":{"text":"reverseproxy.parseUpstreamDialAddress (cyclomatic 28): reverseproxy.parseUpstreamDialAddress 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":"modules/caddyhttp/reverseproxy/addresses.go"},"region":{"startLine":65}}}],"partialFingerprints":{"codehealthFindingId/v1":"6e15270c1f0d0d9fc9eb6418c763ec42920a3166b8363279859c9c2f97643295"}},{"ruleId":"D1","level":"warning","message":{"text":"SRVUpstreams.UnmarshalCaddyfile (cyclomatic 28): SRVUpstreams.UnmarshalCaddyfile 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":"modules/caddyhttp/reverseproxy/caddyfile.go"},"region":{"startLine":1456}}}],"partialFingerprints":{"codehealthFindingId/v1":"f304b7fc6210bb9e9cbd5826c4c2b1504f21e91c064f9f3312de378cb3d190ba"}},{"ruleId":"D1","level":"warning","message":{"text":"ClientAuthentication.UnmarshalCaddyfile (cyclomatic 28): ClientAuthentication.UnmarshalCaddyfile 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":"modules/caddytls/connpolicy.go"},"region":{"startLine":654}}}],"partialFingerprints":{"codehealthFindingId/v1":"2f0fecee192c26eeb04c0c4fbe0e5fcdb6a0266ac0fccfa1c8af2c5853a4cd2e"}},{"ruleId":"D1","level":"warning","message":{"text":"FileWriter.OpenWriter (cyclomatic 28): FileWriter.OpenWriter 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":"modules/logging/filewriter.go"},"region":{"startLine":187}}}],"partialFingerprints":{"codehealthFindingId/v1":"85181c166d499af05b20de41e8286e8e2be79e44fa3c4c29caa96c08e6d2e953"}},{"ruleId":"D1","level":"warning","message":{"text":"ConnectionPolicy.buildStandardTLSConfig (cyclomatic 27): ConnectionPolicy.buildStandardTLSConfig has cyclomatic complexity 27 (threshold 15). Of this number, 24 points are the body\u0027s own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddytls/connpolicy.go"},"region":{"startLine":269}}}],"partialFingerprints":{"codehealthFindingId/v1":"ccbc85d8b06eef1296ded67faae16fd8d6b148d40cd97c27a30d21a4b29ae2b4"}},{"ruleId":"D1","level":"warning","message":{"text":"LogEncoderConfig.ZapcoreEncoderConfig (cyclomatic 27): LogEncoderConfig.ZapcoreEncoderConfig 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, 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":"modules/logging/encoders.go"},"region":{"startLine":203}}}],"partialFingerprints":{"codehealthFindingId/v1":"91dd5830017e5d229d21354765fd513d7ba188d347e5a406ab5bcdedebc57736"}},{"ruleId":"D1","level":"warning","message":{"text":"httpcaddyfile.consolidateAutomationPolicies (cyclomatic 26): httpcaddyfile.consolidateAutomationPolicies 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":"caddyconfig/httpcaddyfile/tlsapp.go"},"region":{"startLine":969}}}],"partialFingerprints":{"codehealthFindingId/v1":"bc7e9010b679734c83466f1a8c6e1a4f8f5cf8d929a1bb726970f073e9291c5f"}},{"ruleId":"D1","level":"warning","message":{"text":"caddycmd.cmdListModules (cyclomatic 26): caddycmd.cmdListModules has cyclomatic complexity 26 (threshold 15). Of this number, 18 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":"cmd/commandfuncs.go"},"region":{"startLine":438}}}],"partialFingerprints":{"codehealthFindingId/v1":"470ffabd60fe8982d44c83d3405d8254044884bb47c77e4aeaf3c746d018ea13"}},{"ruleId":"D1","level":"warning","message":{"text":"App.Stop (cyclomatic 26): App.Stop has cyclomatic complexity 26 (threshold 15). Of this number, 14 points are the body\u0027s own statements and 12 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/app.go"},"region":{"startLine":674}}}],"partialFingerprints":{"codehealthFindingId/v1":"f3207ea78017a7635ab30a64ed88014aa40fb479466383dab8ad640f446697c8"}},{"ruleId":"D1","level":"warning","message":{"text":"caddy.Version (cyclomatic 25): caddy.Version 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":"caddy.go"},"region":{"startLine":1003}}}],"partialFingerprints":{"codehealthFindingId/v1":"693ca489eb172ca73532d1809caaf5f4c3db470fb7eeda5f95ecb1d544c2893b"}},{"ruleId":"D1","level":"warning","message":{"text":"FileServer.Provision (cyclomatic 25): FileServer.Provision 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":"modules/caddyhttp/fileserver/staticfiles.go"},"region":{"startLine":194}}}],"partialFingerprints":{"codehealthFindingId/v1":"69326fc746e5d1e676f8fd2738adfeefaac90fa06c06d99384865de173e9045e"}},{"ruleId":"D1","level":"warning","message":{"text":"Handler.proxyLoopIteration (cyclomatic 25): Handler.proxyLoopIteration 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":"modules/caddyhttp/reverseproxy/reverseproxy.go"},"region":{"startLine":603}}}],"partialFingerprints":{"codehealthFindingId/v1":"9a16043380ed5ce295c222ed4b99f80ed77dba3a72da16d54f4d4e7e2d7b7156"}},{"ruleId":"D1","level":"warning","message":{"text":"AutomationPolicy.makeCertMagicConfig (cyclomatic 25): AutomationPolicy.makeCertMagicConfig has cyclomatic complexity 25 (threshold 15). Of this number, 14 points are the body\u0027s own statements and 11 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddytls/automation.go"},"region":{"startLine":272}}}],"partialFingerprints":{"codehealthFindingId/v1":"c6b4b6ba2b65023d49cbaa2c7203e4dd099dbea12400ddbdac0bf7a6d1db5c97"}},{"ruleId":"D1","level":"warning","message":{"text":"FileServer.serveBrowse (cyclomatic 24): FileServer.serveBrowse 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":"modules/caddyhttp/fileserver/browse.go"},"region":{"startLine":78}}}],"partialFingerprints":{"codehealthFindingId/v1":"8a2d32ced2b2ae397db7bcb6dce6df0ad316816abf75d1dc0dffad3f4ef0df66"}},{"ruleId":"D1","level":"warning","message":{"text":"echConfig.UnmarshalBinary (cyclomatic 24): echConfig.UnmarshalBinary 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":"modules/caddytls/ech.go"},"region":{"startLine":968}}}],"partialFingerprints":{"codehealthFindingId/v1":"ab1f0678a881735d4eb165edca872b7a749eb0140cbf847b67418fd6499b890f"}},{"ruleId":"D1","level":"warning","message":{"text":"ServerType.listenersForServerBlockAddress (cyclomatic 23): ServerType.listenersForServerBlockAddress 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":"caddyconfig/httpcaddyfile/addresses.go"},"region":{"startLine":270}}}],"partialFingerprints":{"codehealthFindingId/v1":"368eea5b31800f4dd56e475ee9c38f6a23c5e85ba081bacf971fcb0653e7a8e6"}},{"ruleId":"D1","level":"warning","message":{"text":"caddycmd.loadConfigWithLogger (cyclomatic 23): caddycmd.loadConfigWithLogger 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":"cmd/main.go"},"region":{"startLine":146}}}],"partialFingerprints":{"codehealthFindingId/v1":"db7f51ffca11e7ab0d28c16b1f7eb73695895b803b570f003fe02a413e21b8d7"}},{"ruleId":"D1","level":"warning","message":{"text":"Context.LoadModule (cyclomatic 23): Context.LoadModule 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":"context.go"},"region":{"startLine":188}}}],"partialFingerprints":{"codehealthFindingId/v1":"c01b802b2d3f140e48445072bebb2564989bf70e567090d5439db8ee676fdc57"}},{"ruleId":"D1","level":"warning","message":{"text":"CustomLog.loggerAllowed (cyclomatic 23): CustomLog.loggerAllowed 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":"logging.go"},"region":{"startLine":533}}}],"partialFingerprints":{"codehealthFindingId/v1":"458e14aefb2bbcdce43d19426cfdc7aa9c80c32b6e8d9f78332c48a46cdb53b1"}},{"ruleId":"D1","level":"warning","message":{"text":"App.Emit (cyclomatic 23): App.Emit has cyclomatic complexity 23 (threshold 15). Of this number, 14 points are the body\u0027s own statements and 9 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyevents/app.go"},"region":{"startLine":207}}}],"partialFingerprints":{"codehealthFindingId/v1":"5d62b80657b9f26ee60c59de2e6ddaf2476895a88457472678022d53d725d6ff"}},{"ruleId":"D1","level":"warning","message":{"text":"Handler.finalizeResponse (cyclomatic 23): Handler.finalizeResponse 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":"modules/caddyhttp/reverseproxy/reverseproxy.go"},"region":{"startLine":1218}}}],"partialFingerprints":{"codehealthFindingId/v1":"37cb4a1d1076eca8fdeac4b7e93a14f4a9dbb63d4b4421b2b1f1e9c4af365630"}},{"ruleId":"D1","level":"warning","message":{"text":"Replacer.replace (cyclomatic 23): Replacer.replace 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":"replacer.go"},"region":{"startLine":175}}}],"partialFingerprints":{"codehealthFindingId/v1":"a97abbaf24a06cbb057691409397e5311326f1079eb2ba8ab07412e30b566e4d"}},{"ruleId":"D1","level":"warning","message":{"text":"httpcaddyfile.newBaseAutomationPolicy (cyclomatic 22): httpcaddyfile.newBaseAutomationPolicy 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":"caddyconfig/httpcaddyfile/tlsapp.go"},"region":{"startLine":903}}}],"partialFingerprints":{"codehealthFindingId/v1":"9056619ce3223c85952df621583b7213560130d1adaa0de0c8e278dcccc13381"}},{"ruleId":"D1","level":"warning","message":{"text":"Transport.UnmarshalCaddyfile (cyclomatic 22): Transport.UnmarshalCaddyfile 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":"modules/caddyhttp/reverseproxy/fastcgi/caddyfile.go"},"region":{"startLine":50}}}],"partialFingerprints":{"codehealthFindingId/v1":"59df49c4246c5b8d2c6a22453056fc6932c9210c4ce2e281db42bb83177253e8"}},{"ruleId":"D1","level":"warning","message":{"text":"Handler.addForwardedHeaders (cyclomatic 22): Handler.addForwardedHeaders 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":"modules/caddyhttp/reverseproxy/reverseproxy.go"},"region":{"startLine":889}}}],"partialFingerprints":{"codehealthFindingId/v1":"7a2a0dacf407bebe985bd65c05a33d0e362a66cc42cdd56cd78b30455a4d8a1d"}},{"ruleId":"D1","level":"warning","message":{"text":"StaticResponse.ServeHTTP (cyclomatic 22): StaticResponse.ServeHTTP 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":"modules/caddyhttp/staticresp.go"},"region":{"startLine":181}}}],"partialFingerprints":{"codehealthFindingId/v1":"ecb65262afab9ed111fa1722144fdde51ce581a648286f355da9c78bb1026694"}},{"ruleId":"D1","level":"warning","message":{"text":"Transport.buildEnv (cyclomatic 21): Transport.buildEnv 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":"modules/caddyhttp/reverseproxy/fastcgi/fastcgi.go"},"region":{"startLine":257}}}],"partialFingerprints":{"codehealthFindingId/v1":"f5f8ef31b40913b9a1fd4e72c2d78835cd44fab894911725b221f0382c938168"}},{"ruleId":"D1","level":"warning","message":{"text":"forwardauth.parseCaddyfile (cyclomatic 21): forwardauth.parseCaddyfile 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":"modules/caddyhttp/reverseproxy/forwardauth/caddyfile.go"},"region":{"startLine":64}}}],"partialFingerprints":{"codehealthFindingId/v1":"e979a9270837de6463529d0118f02a66329daac293160ba2c49530e734b0ad57"}},{"ruleId":"D1","level":"warning","message":{"text":"Handler.prepareRequest (cyclomatic 21): Handler.prepareRequest 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":"modules/caddyhttp/reverseproxy/reverseproxy.go"},"region":{"startLine":763}}}],"partialFingerprints":{"codehealthFindingId/v1":"49e670b3c51aa537d80032bb7b3c96721cb90a4c41d78ec0eeffdaad8612ca41"}},{"ruleId":"D1","level":"warning","message":{"text":"LoadBalancing.tryAgain (cyclomatic 21): LoadBalancing.tryAgain 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":"modules/caddyhttp/reverseproxy/reverseproxy.go"},"region":{"startLine":1342}}}],"partialFingerprints":{"codehealthFindingId/v1":"58733b18117046dddbb5e98db1eab9be13ddcbeb6356d19112df1a87fee2c263"}},{"ruleId":"D1","level":"warning","message":{"text":"CA.Provision (cyclomatic 21): CA.Provision 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":"modules/caddypki/ca.go"},"region":{"startLine":99}}}],"partialFingerprints":{"codehealthFindingId/v1":"46f06d0fa4f7fe7a49b20f2dcaecb37913ece680a747ac041eb95107ca89fd3a"}},{"ruleId":"D1","level":"warning","message":{"text":"FilterEncoder.UnmarshalCaddyfile (cyclomatic 21): FilterEncoder.UnmarshalCaddyfile has cyclomatic complexity 21 (threshold 15). Of this number, 14 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":"modules/logging/filterencoder.go"},"region":{"startLine":152}}}],"partialFingerprints":{"codehealthFindingId/v1":"8318f54d12ea2d3914cd8e801646b7e52738f9a19063f897d711af5c8750af12"}},{"ruleId":"D1","level":"warning","message":{"text":"ServerType.compileEncodedMatcherSets (cyclomatic 20): ServerType.compileEncodedMatcherSets 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":"caddyconfig/httpcaddyfile/httptype.go"},"region":{"startLine":1488}}}],"partialFingerprints":{"codehealthFindingId/v1":"c031ba42769c191b9aab42349088693d554f4f42fcc6134db3b7315ec721c19d"}},{"ruleId":"D1","level":"warning","message":{"text":"caddycmd.cmdExportStorage (cyclomatic 20): caddycmd.cmdExportStorage 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":"cmd/storagefuncs.go"},"region":{"startLine":136}}}],"partialFingerprints":{"codehealthFindingId/v1":"f494e5c5fe49b0f8ff4a53cb8c982fd708d8c22bbc93fb412f4217d7373d68bf"}},{"ruleId":"D1","level":"warning","message":{"text":"browseTemplateContext.applySortAndLimit (cyclomatic 20): browseTemplateContext.applySortAndLimit has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/fileserver/browsetplcontext.go"},"region":{"startLine":228}}}],"partialFingerprints":{"codehealthFindingId/v1":"a2fce2c4cb5006b3f8e896610ed2ac871cda8588b8394cd04a896fd9817800ed"}},{"ruleId":"D1","level":"warning","message":{"text":"Handler.ServeHTTP (cyclomatic 20): Handler.ServeHTTP has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/reverseproxy/reverseproxy.go"},"region":{"startLine":485}}}],"partialFingerprints":{"codehealthFindingId/v1":"2ce4bc0c841bf57693df59ba8ac7a06a53c2ccf59e109a5aa2197675282d2b03"}},{"ruleId":"D1","level":"warning","message":{"text":"rewrite.parseCaddyfileURI (cyclomatic 20): rewrite.parseCaddyfileURI 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":"modules/caddyhttp/rewrite/caddyfile.go"},"region":{"startLine":97}}}],"partialFingerprints":{"codehealthFindingId/v1":"b7211f2d2d52a00f9c755866548e8344e08f3aefb19a3313fb4782a7f9835a8f"}},{"ruleId":"D1","level":"warning","message":{"text":"queryOps.do (cyclomatic 20): queryOps.do 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":"modules/caddyhttp/rewrite/rewrite.go"},"region":{"startLine":562}}}],"partialFingerprints":{"codehealthFindingId/v1":"45a89b3f55c3a2b271b3f864d065e71cdc1ee2031ee336c8f11acd1fda6c473f"}},{"ruleId":"D1","level":"warning","message":{"text":"caddy.changeConfig (cyclomatic 19): caddy.changeConfig 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":"caddy.go"},"region":{"startLine":158}}}],"partialFingerprints":{"codehealthFindingId/v1":"0c57f04602668e137a8399deb1e185d8bbec27278bc08f9412087375649d8b15"}},{"ruleId":"D1","level":"warning","message":{"text":"caddy.finishSettingUp (cyclomatic 19): caddy.finishSettingUp has cyclomatic complexity 19 (threshold 15). Of this number, 10 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":"caddy.go"},"region":{"startLine":594}}}],"partialFingerprints":{"codehealthFindingId/v1":"f7d6f07a0aee0b114e3bbd8b099711e48d25b31f88f50504c5d98527d5812967"}},{"ruleId":"D1","level":"warning","message":{"text":"caddy.listenReusable (cyclomatic 19): caddy.listenReusable has cyclomatic complexity 19 (threshold 15). Of this number, 15 points are the body\u0027s own statements and 4 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"listen_unix.go"},"region":{"startLine":94}}}],"partialFingerprints":{"codehealthFindingId/v1":"7cb33c1f3acf591bd164948afae248da3ae7995771bee32d7c167d007d3d1e54"}},{"ruleId":"D1","level":"warning","message":{"text":"parser.addresses (cyclomatic 19): parser.addresses 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":"caddyconfig/caddyfile/parse.go"},"region":{"startLine":210}}}],"partialFingerprints":{"codehealthFindingId/v1":"c7c1c82e42e1655f7083d005e4f2909da2129fb1740e95b496d495c696e160be"}},{"ruleId":"D1","level":"warning","message":{"text":"httpcaddyfile.detectConflictingSchemes (cyclomatic 19): httpcaddyfile.detectConflictingSchemes has cyclomatic complexity 19 (threshold 15). Of this number, 14 points are the body\u0027s own statements and 5 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"caddyconfig/httpcaddyfile/httptype.go"},"region":{"startLine":1031}}}],"partialFingerprints":{"codehealthFindingId/v1":"104473fae7a5798b50f8ec930d8fda1d9ec2b6a064c360aa5500d673379e5245"}},{"ruleId":"D1","level":"warning","message":{"text":"Context.LoadModuleByID (cyclomatic 19): Context.LoadModuleByID 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":"context.go"},"region":{"startLine":364}}}],"partialFingerprints":{"codehealthFindingId/v1":"dcdcb771448c90520192a33e66b606f80fc3090213ce4205bfbc26c5dc8794f4"}},{"ruleId":"D1","level":"warning","message":{"text":"Handler.doActiveHealthCheckForAllHosts (cyclomatic 19): Handler.doActiveHealthCheckForAllHosts has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 2 of the 19 points are its own statements and the rest belongs to one function literal inside it that branches (line 299). 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":"modules/caddyhttp/reverseproxy/healthchecks.go"},"region":{"startLine":297}}}],"partialFingerprints":{"codehealthFindingId/v1":"24a6fa54c56e36005b72a34a0197276269f4136dc5dd78ee770ae92cf3b0d715"}},{"ruleId":"D1","level":"warning","message":{"text":"Server.serveHTTP (cyclomatic 19): Server.serveHTTP 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":"modules/caddyhttp/server.go"},"region":{"startLine":582}}}],"partialFingerprints":{"codehealthFindingId/v1":"03a6fdb6fdc7d020f9bf72ff53a71770db4a73b305658abc23683079cd94f29c"}},{"ruleId":"D1","level":"warning","message":{"text":"caddytls.tlsCertFromCertAndKeyPEMBundle (cyclomatic 19): caddytls.tlsCertFromCertAndKeyPEMBundle 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":"modules/caddytls/folderloader.go"},"region":{"startLine":106}}}],"partialFingerprints":{"codehealthFindingId/v1":"197b76b315642e3b3b26fb9790c09276d666110bb5a46c32e19f5f70b01f7489"}},{"ruleId":"D1","level":"warning","message":{"text":"AutomationPolicy.Provision (cyclomatic 19): AutomationPolicy.Provision 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":"modules/caddytls/automation.go"},"region":{"startLine":182}}}],"partialFingerprints":{"codehealthFindingId/v1":"15569cb11ff6240a68de69f01df9348d1097aeeeb3c7062a603e165a7056f1e2"}},{"ruleId":"D1","level":"warning","message":{"text":"ConnectionPolicies.TLSConfig (cyclomatic 19): ConnectionPolicies.TLSConfig has cyclomatic complexity 19 (threshold 15). Of this number, 14 points are the body\u0027s own statements and 5 belong to one function literal inside it that branches. To reduce it, 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":"modules/caddytls/connpolicy.go"},"region":{"startLine":98}}}],"partialFingerprints":{"codehealthFindingId/v1":"8ee00b3b25d0f805a1a16995e651526f72a7c9ad3a6be67160c6b45411562daa"}},{"ruleId":"D1","level":"warning","message":{"text":"parser.directive (cyclomatic 18): parser.directive 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":"caddyconfig/caddyfile/parse.go"},"region":{"startLine":636}}}],"partialFingerprints":{"codehealthFindingId/v1":"c34b2668eff5a073cc70b7fea96dd783228afde7e2475c6c60e291b4b2507eff"}},{"ruleId":"D1","level":"warning","message":{"text":"ServerType.evaluateGlobalOptionsBlock (cyclomatic 18): ServerType.evaluateGlobalOptionsBlock 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":"caddyconfig/httpcaddyfile/httptype.go"},"region":{"startLine":370}}}],"partialFingerprints":{"codehealthFindingId/v1":"7d4b163bcbb5e3e0f06b296f653611f1aad644c4576568817455a03f41802bd6"}},{"ruleId":"D1","level":"warning","message":{"text":"caddycmd.cmdStart (cyclomatic 18): caddycmd.cmdStart has cyclomatic complexity 18 (threshold 15). Of this number, 14 points are the body\u0027s own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/commandfuncs.go"},"region":{"startLine":45}}}],"partialFingerprints":{"codehealthFindingId/v1":"4f7c75fb072a1260d59cf21445c30e69d2e3eaf155b792ba09d872e7de24f33d"}},{"ruleId":"D1","level":"warning","message":{"text":"caddycmd.cmdFmt (cyclomatic 18): caddycmd.cmdFmt 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":"cmd/commandfuncs.go"},"region":{"startLine":685}}}],"partialFingerprints":{"codehealthFindingId/v1":"6e799bf24a03dd4b1b2021cb243095b23f30abee6a9dff93e2af7282ca42ab8e"}},{"ruleId":"D1","level":"warning","message":{"text":"fileserver.cmdFileServer (cyclomatic 18): fileserver.cmdFileServer 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":"modules/caddyhttp/fileserver/command.go"},"region":{"startLine":86}}}],"partialFingerprints":{"codehealthFindingId/v1":"9171867b968f0dc7a9bf486802468b5759d3ec8c84e407a097c6688e691285e3"}},{"ruleId":"D1","level":"warning","message":{"text":"FileServer.directoryListing (cyclomatic 18): FileServer.directoryListing 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":"modules/caddyhttp/fileserver/browsetplcontext.go"},"region":{"startLine":37}}}],"partialFingerprints":{"codehealthFindingId/v1":"59a95426492ea6a960be8f4cfd768f5198aadd798432cfca4e59ce3b1fa51528"}},{"ruleId":"D1","level":"warning","message":{"text":"headers.parseCaddyfile (cyclomatic 18): headers.parseCaddyfile 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":"modules/caddyhttp/headers/caddyfile.go"},"region":{"startLine":49}}}],"partialFingerprints":{"codehealthFindingId/v1":"116b32aea2835b95ebcee2f473dade6d945bbda2941db5f083133bd8e6706714"}},{"ruleId":"D1","level":"warning","message":{"text":"Intercept.ServeHTTP (cyclomatic 18): Intercept.ServeHTTP 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":"modules/caddyhttp/intercept/intercept.go"},"region":{"startLine":115}}}],"partialFingerprints":{"codehealthFindingId/v1":"004904cbfc23989b59ef53442b7abd24595a00c9934c63941a5753ab0f80ffd1"}},{"ruleId":"D1","level":"warning","message":{"text":"MatchPath.matchPatternWithEscapeSequence (cyclomatic 18): MatchPath.matchPatternWithEscapeSequence 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":"modules/caddyhttp/matchers.go"},"region":{"startLine":537}}}],"partialFingerprints":{"codehealthFindingId/v1":"30b7be414760e24ee4128215109d433cb7264dc08e1013c3fcb7e375a8a78a13"}},{"ruleId":"D1","level":"warning","message":{"text":"ActiveHealthChecks.Provision (cyclomatic 18): ActiveHealthChecks.Provision has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body\u0027s own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/reverseproxy/healthchecks.go"},"region":{"startLine":137}}}],"partialFingerprints":{"codehealthFindingId/v1":"80bcb10eb7e243f3160915707349fa8a6240969baea6a76a644d60317e7f4944"}},{"ruleId":"D1","level":"warning","message":{"text":"CustomCertSelectionPolicy.UnmarshalCaddyfile (cyclomatic 18): CustomCertSelectionPolicy.UnmarshalCaddyfile 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":"modules/caddytls/certselection.go"},"region":{"startLine":125}}}],"partialFingerprints":{"codehealthFindingId/v1":"35223a5fc1778bb332d8d0d2e7f8c4c52fb789e89d4ca22698c45c6f9541c8e0"}},{"ruleId":"D1","level":"warning","message":{"text":"caddy.unsyncedDecodeAndRun (cyclomatic 17): caddy.unsyncedDecodeAndRun 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":"caddy.go"},"region":{"startLine":337}}}],"partialFingerprints":{"codehealthFindingId/v1":"4404446b5d1893ef05809666b4fcdb0493ce572ec2ef72e1477d074d9d91809f"}},{"ruleId":"D1","level":"warning","message":{"text":"caddyhttp.matchHeaders (cyclomatic 17): caddyhttp.matchHeaders 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":"modules/caddyhttp/matchers.go"},"region":{"startLine":1150}}}],"partialFingerprints":{"codehealthFindingId/v1":"084cec4da79c9c7e15837009a2a67b9b3f069af261536a7243331827e3f2bd93"}},{"ruleId":"D1","level":"warning","message":{"text":"headers.applyHeaderOp (cyclomatic 17): headers.applyHeaderOp 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":"modules/caddyhttp/headers/caddyfile.go"},"region":{"startLine":225}}}],"partialFingerprints":{"codehealthFindingId/v1":"ab480fd229b92df5bbb6920270d42897f05fcfbe496359dbfc953b3bf90da60a"}},{"ruleId":"D1","level":"warning","message":{"text":"rewrite.buildQueryString (cyclomatic 17): rewrite.buildQueryString has cyclomatic complexity 17 (threshold 15). Of this number, 12 points are the body\u0027s own statements and 5 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/rewrite/rewrite.go"},"region":{"startLine":336}}}],"partialFingerprints":{"codehealthFindingId/v1":"310c53efe97a3200aae73c42e8060c7cce49fba5a570ea3ef29450e316bf3522"}},{"ruleId":"D1","level":"warning","message":{"text":"TLS.Start (cyclomatic 17): TLS.Start has cyclomatic complexity 17 (threshold 15). Of this number, 11 points are the body\u0027s own statements and 6 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddytls/tls.go"},"region":{"startLine":401}}}],"partialFingerprints":{"codehealthFindingId/v1":"47717753975db0db6eb546bf17d6ff1164c74fe20ff4c67458aaaab3d109e534"}},{"ruleId":"D1","level":"warning","message":{"text":"httpcaddyfile.appendSubrouteToRouteList (cyclomatic 16): httpcaddyfile.appendSubrouteToRouteList 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":"caddyconfig/httpcaddyfile/httptype.go"},"region":{"startLine":1254}}}],"partialFingerprints":{"codehealthFindingId/v1":"ce2ea6cd5613db1da70fb056b0a601ab1416dcf572a6c67a798e03d17718d876"}},{"ruleId":"D1","level":"warning","message":{"text":"httpcaddyfile.buildSubroute (cyclomatic 16): httpcaddyfile.buildSubroute 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":"caddyconfig/httpcaddyfile/httptype.go"},"region":{"startLine":1317}}}],"partialFingerprints":{"codehealthFindingId/v1":"9d0195692fc52a8b6f7c0b57ab8c174daf963fd89e52015db28f295fe6245eab"}},{"ruleId":"D1","level":"warning","message":{"text":"httpcaddyfile.parseOptOnDemand (cyclomatic 16): httpcaddyfile.parseOptOnDemand 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":"caddyconfig/httpcaddyfile/options.go"},"region":{"startLine":383}}}],"partialFingerprints":{"codehealthFindingId/v1":"aa4abfc68bc731fcbf8b04c977d403d3f183733545ef061c4f9da26aedf4da73"}},{"ruleId":"D1","level":"warning","message":{"text":"caddycmd.cmdAdaptConfig (cyclomatic 16): caddycmd.cmdAdaptConfig 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":"cmd/commandfuncs.go"},"region":{"startLine":552}}}],"partialFingerprints":{"codehealthFindingId/v1":"8bb1ea790f7c5cbc5bce0d85885690c8e335b95c5b693280746cce143e1f1bda"}},{"ruleId":"D1","level":"warning","message":{"text":"caddycmd.parseEnvFile (cyclomatic 16): caddycmd.parseEnvFile has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/main.go"},"region":{"startLine":385}}}],"partialFingerprints":{"codehealthFindingId/v1":"8d653b0228b5400638f8e75648189923b296c32360f8156c5f38ab3114084783"}},{"ruleId":"D1","level":"warning","message":{"text":"caddyhttp.CELMatcherDecorator (cyclomatic 16): caddyhttp.CELMatcherDecorator 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 470). 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":"modules/caddyhttp/celmatcher.go"},"region":{"startLine":469}}}],"partialFingerprints":{"codehealthFindingId/v1":"3c77a45a9c404a859734f37aa1ea8871aab0402547422c37a1f9d5afc1848f76"}},{"ruleId":"D1","level":"warning","message":{"text":"caddyhttp.CELValueToMapStrList (cyclomatic 16): caddyhttp.CELValueToMapStrList has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/celmatcher.go"},"region":{"startLine":669}}}],"partialFingerprints":{"codehealthFindingId/v1":"5c233a9187dcc92f63a79d952ff590dc81be49c490d7732c8480bffe9665060f"}},{"ruleId":"D1","level":"warning","message":{"text":"Encode.UnmarshalCaddyfile (cyclomatic 16): Encode.UnmarshalCaddyfile 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":"modules/caddyhttp/encode/caddyfile.go"},"region":{"startLine":59}}}],"partialFingerprints":{"codehealthFindingId/v1":"3d107b5017d172124201ee929904e01dedcf89d6accfe7bec6dfb70d76780fec"}},{"ruleId":"D1","level":"warning","message":{"text":"MatchPath.MatchWithError (cyclomatic 16): MatchPath.MatchWithError 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":"modules/caddyhttp/matchers.go"},"region":{"startLine":429}}}],"partialFingerprints":{"codehealthFindingId/v1":"b9ef3dcdc494a116d567c307aaf703dd90a5fd2238df75763e2c8754a0cddbd3"}},{"ruleId":"D1","level":"warning","message":{"text":"CustomCertSelectionPolicy.SelectCertificate (cyclomatic 16): CustomCertSelectionPolicy.SelectCertificate 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":"modules/caddytls/certselection.go"},"region":{"startLine":56}}}],"partialFingerprints":{"codehealthFindingId/v1":"6de97923070ba44988729427edeb8cdc81e2d426ffaa99d177410067e3424b8d"}},{"ruleId":"D1","level":"warning","message":{"text":"ClientAuthentication.ConfigureTLSConfig (cyclomatic 16): ClientAuthentication.ConfigureTLSConfig 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":"modules/caddytls/connpolicy.go"},"region":{"startLine":834}}}],"partialFingerprints":{"codehealthFindingId/v1":"87c2cb5ba3560f9a366e8420c1a507adfa99a5459f88ddd0cf9c42b1b46df5fd"}},{"ruleId":"D1","level":"warning","message":{"text":"ECH.rotateECHKeys (cyclomatic 16): ECH.rotateECHKeys 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":"modules/caddytls/ech.go"},"region":{"startLine":190}}}],"partialFingerprints":{"codehealthFindingId/v1":"b3c4323af9bf50dbd2f4505083bd74d7e9ff8d4538b461d0dc18bd421d822b0b"}},{"ruleId":"D2","level":"warning","message":{"text":"Handler.UnmarshalCaddyfile (cognitive 512): Handler.UnmarshalCaddyfile has cognitive complexity 512 (threshold 15). Drivers by points: if/else 465, boolean chains 19, loops 16, match/switch 12 (nesting depth added 321). Of this number, 501 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":"modules/caddyhttp/reverseproxy/caddyfile.go"},"region":{"startLine":143}}}],"partialFingerprints":{"codehealthFindingId/v1":"16bdf0ca17fab51a9a10b65babf39470eb7914c05b77482163cc3e172df94707"}},{"ruleId":"D2","level":"warning","message":{"text":"ServerType.serversFromPairings (cognitive 322): ServerType.serversFromPairings has cognitive complexity 322 (threshold 15). Drivers by points: if/else 213, loops 85, boolean chains 21, match/switch 3 (nesting depth added 210). Of this number, 284 points are the body\u0027s own statements and 38 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":"caddyconfig/httpcaddyfile/httptype.go"},"region":{"startLine":551}}}],"partialFingerprints":{"codehealthFindingId/v1":"8b75841c4a03604deecfdf9fce10b26ab8c4db47da7a3eb3a291d0f3ae970cd6"}},{"ruleId":"D2","level":"warning","message":{"text":"ServerType.buildTLSApp (cognitive 283): ServerType.buildTLSApp has cognitive complexity 283 (threshold 15). Drivers by points: if/else 193, loops 76, boolean chains 14 (nesting depth added 170). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"caddyconfig/httpcaddyfile/tlsapp.go"},"region":{"startLine":36}}}],"partialFingerprints":{"codehealthFindingId/v1":"f0a1424b972af3c04811faeedba6825603e222dc36a9c9c1db686e3e3c8ee0c5"}},{"ruleId":"D2","level":"warning","message":{"text":"httpcaddyfile.parseTLS (cognitive 226): httpcaddyfile.parseTLS has cognitive complexity 226 (threshold 15). Drivers by points: if/else 202, loops 12, boolean chains 8, match/switch 4 (nesting depth added 131). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"caddyconfig/httpcaddyfile/builtins.go"},"region":{"startLine":118}}}],"partialFingerprints":{"codehealthFindingId/v1":"6cddb160cdd2037b59ba88ebc482504361b08bef63dcbb13df83793438122868"}},{"ruleId":"D2","level":"warning","message":{"text":"HTTPTransport.UnmarshalCaddyfile (cognitive 214): HTTPTransport.UnmarshalCaddyfile has cognitive complexity 214 (threshold 15). Drivers by points: if/else 202, match/switch 11, loops 1 (nesting depth added 142). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/reverseproxy/caddyfile.go"},"region":{"startLine":1018}}}],"partialFingerprints":{"codehealthFindingId/v1":"dbe516066019285901f26f87e7106721ce4364d5845bc3e97588d22b6b3110c4"}},{"ruleId":"D2","level":"warning","message":{"text":"App.automaticHTTPSPhase1 (cognitive 179): App.automaticHTTPSPhase1 has cognitive complexity 179 (threshold 15). Drivers by points: if/else 115, loops 46, boolean chains 16, jumps 2 (nesting depth added 100). Of this number, 162 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":"modules/caddyhttp/autohttps.go"},"region":{"startLine":77}}}],"partialFingerprints":{"codehealthFindingId/v1":"3399cf2b9f130b525f96891fadaa4ea169318438f1c390519bd0549c112074b3"}},{"ruleId":"D2","level":"warning","message":{"text":"httpcaddyfile.unmarshalCaddyfileServerOptions (cognitive 177): httpcaddyfile.unmarshalCaddyfileServerOptions has cognitive complexity 177 (threshold 15). Drivers by points: if/else 146, loops 19, match/switch 10, boolean chains 2 (nesting depth added 123). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"caddyconfig/httpcaddyfile/serveroptions.go"},"region":{"startLine":66}}}],"partialFingerprints":{"codehealthFindingId/v1":"91fba4805091ad6670fcff540f2da2132a481e33618325f5fbf32df440007679"}},{"ruleId":"D2","level":"warning","message":{"text":"ACMEIssuer.UnmarshalCaddyfile (cognitive 168): ACMEIssuer.UnmarshalCaddyfile has cognitive complexity 168 (threshold 15). Drivers by points: if/else 165, match/switch 2, loops 1 (nesting depth added 110). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddytls/acmeissuer.go"},"region":{"startLine":448}}}],"partialFingerprints":{"codehealthFindingId/v1":"510e2bbf3f63219858f11b0fba78fee08b67af67260792e3849b2ff56f61d9fc"}},{"ruleId":"D2","level":"warning","message":{"text":"httpcaddyfile.consolidateConnPolicies (cognitive 165): httpcaddyfile.consolidateConnPolicies has cognitive complexity 165 (threshold 15). Drivers by points: if/else 135, boolean chains 22, loops 8 (nesting depth added 109). Of this number, 164 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":"caddyconfig/httpcaddyfile/httptype.go"},"region":{"startLine":1091}}}],"partialFingerprints":{"codehealthFindingId/v1":"abb961aa830410e7fcdd586bc00e3f5c8de163ec3ea817bf31f24effde18b7cc"}},{"ruleId":"D2","level":"warning","message":{"text":"caddyfile.Format (cognitive 158): caddyfile.Format has cognitive complexity 158 (threshold 15). Drivers by points: if/else 125, boolean chains 21, match/switch 8, loops 4 (nesting depth added 77). Of this number, 151 points are the body\u0027s own statements and 7 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"caddyconfig/caddyfile/formatter.go"},"region":{"startLine":30}}}],"partialFingerprints":{"codehealthFindingId/v1":"a96225b4bb81177a97531b16fb6d2fb9a6d1c21788c15c03a2402ca0af39b902"}},{"ruleId":"D2","level":"warning","message":{"text":"httpcaddyfile.parsePKIApp (cognitive 140): httpcaddyfile.parsePKIApp has cognitive complexity 140 (threshold 15). Drivers by points: if/else 107, match/switch 18, loops 14, boolean chains 1 (nesting depth added 111). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"caddyconfig/httpcaddyfile/pkiapp.go"},"region":{"startLine":55}}}],"partialFingerprints":{"codehealthFindingId/v1":"79d9345a013c72825ffe77ea631feafa0ebe4e4f34d4037c49ed94aa2d282f9b"}},{"ruleId":"D2","level":"warning","message":{"text":"caddyhttp.addHTTPVarsToReplacer (cognitive 133): caddyhttp.addHTTPVarsToReplacer has cognitive complexity 133 (threshold 15). Drivers by points: if/else 121, boolean chains 6, loops 3, match/switch 3 (nesting depth added 79). Most of this is not in the body itself: 0 of the 133 points are its own statements and the rest belongs to one function literal inside it that branches (line 62). 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":"modules/caddyhttp/replacer.go"},"region":{"startLine":58}}}],"partialFingerprints":{"codehealthFindingId/v1":"00e306821b1ae5e46ecf586efe962708b53e05e66e1905162340906bbecf3f8e"}},{"ruleId":"D2","level":"warning","message":{"text":"TLS.publishECHConfigs (cognitive 130): TLS.publishECHConfigs has cognitive complexity 130 (threshold 15). Drivers by points: if/else 75, loops 53, boolean chains 2 (nesting depth added 88). Of this number, 129 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":"modules/caddytls/ech.go"},"region":{"startLine":314}}}],"partialFingerprints":{"codehealthFindingId/v1":"971ebb8a1027ba4da59b5fe90b30cb83b2b4c32216c9e5e9dcc8e3148298b271"}},{"ruleId":"D2","level":"warning","message":{"text":"httpcaddyfile.parseLogHelper (cognitive 128): httpcaddyfile.parseLogHelper has cognitive complexity 128 (threshold 15). Drivers by points: if/else 106, loops 13, match/switch 9 (nesting depth added 83). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"caddyconfig/httpcaddyfile/builtins.go"},"region":{"startLine":941}}}],"partialFingerprints":{"codehealthFindingId/v1":"9465d57d6b4155c7f48c066030db70bf50b8afb74445031683861c543f394057"}},{"ruleId":"D2","level":"warning","message":{"text":"FileServer.ServeHTTP (cognitive 124): FileServer.ServeHTTP has cognitive complexity 124 (threshold 15). Drivers by points: if/else 109, boolean chains 12, loops 3 (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":"modules/caddyhttp/fileserver/staticfiles.go"},"region":{"startLine":269}}}],"partialFingerprints":{"codehealthFindingId/v1":"fd91ff7b6856ead5496fca665c71f95d3182f0422d781b2f6a332e20ae1cd969"}},{"ruleId":"D2","level":"warning","message":{"text":"ServerType.Setup (cognitive 119): ServerType.Setup has cognitive complexity 119 (threshold 15). Drivers by points: if/else 80, loops 31, boolean chains 8 (nesting depth added 54). Of this number, 115 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":"caddyconfig/httpcaddyfile/httptype.go"},"region":{"startLine":57}}}],"partialFingerprints":{"codehealthFindingId/v1":"ed63960ec989c94d0f26a530c6a3db7dc7ba511309c6bf954aad9c6ab08ea26e"}},{"ruleId":"D2","level":"warning","message":{"text":"caddy.unsyncedConfigAccess (cognitive 114): caddy.unsyncedConfigAccess has cognitive complexity 114 (threshold 15). Drivers by points: if/else 97, match/switch 10, boolean chains 5, jumps 1, loops 1 (nesting depth added 76). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"admin.go"},"region":{"startLine":1159}}}],"partialFingerprints":{"codehealthFindingId/v1":"1069024686b04016c587cb2f8041a601426cc264eb27af777d43a2a306837556"}},{"ruleId":"D2","level":"warning","message":{"text":"lexer.next (cognitive 112): lexer.next has cognitive complexity 112 (threshold 15). Drivers by points: if/else 100, boolean chains 11, loops 1 (nesting depth added 64). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"caddyconfig/caddyfile/lexer.go"},"region":{"startLine":107}}}],"partialFingerprints":{"codehealthFindingId/v1":"75fcad3f566b32d2e7d71ae445e1de1c1acb4398630c4d7d8590a9d83fec0f71"}},{"ruleId":"D2","level":"warning","message":{"text":"App.Provision (cognitive 103): App.Provision has cognitive complexity 103 (threshold 15). Drivers by points: if/else 84, loops 16, boolean chains 3 (nesting depth added 59). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/app.go"},"region":{"startLine":186}}}],"partialFingerprints":{"codehealthFindingId/v1":"ca9196e479f89aa7702418a2616a8c8ed3cce224de7b7cd7bc0250355ac86fed"}},{"ruleId":"D2","level":"warning","message":{"text":"HTTPTransport.NewTransport (cognitive 101): HTTPTransport.NewTransport has cognitive complexity 101 (threshold 15). Drivers by points: if/else 85, boolean chains 8, match/switch 8 (nesting depth added 42). Of this number, 60 points are the body\u0027s own statements and 41 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":"modules/caddyhttp/reverseproxy/httptransport.go"},"region":{"startLine":207}}}],"partialFingerprints":{"codehealthFindingId/v1":"2453006a72f6c840b9bf1c94c730b4ca08520340d4f923fa1d600e9691928c4c"}},{"ruleId":"D2","level":"warning","message":{"text":"FileWriter.UnmarshalCaddyfile (cognitive 101): FileWriter.UnmarshalCaddyfile has cognitive complexity 101 (threshold 15). Drivers by points: if/else 78, loops 15, match/switch 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":"modules/logging/filewriter.go"},"region":{"startLine":379}}}],"partialFingerprints":{"codehealthFindingId/v1":"e8a693e70461ade5fea9ca95ec75b517b7c3799d7651d4530f1e749b1d4222f1"}},{"ruleId":"D2","level":"warning","message":{"text":"parser.doImport (cognitive 100): parser.doImport has cognitive complexity 100 (threshold 15). Drivers by points: if/else 71, loops 16, boolean chains 9, match/switch 4 (nesting depth added 46). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"caddyconfig/caddyfile/parse.go"},"region":{"startLine":356}}}],"partialFingerprints":{"codehealthFindingId/v1":"c467a60fbbed3a9f277d5c8ac0f77e13c1e8dc3b8fe45f4d331fb567e11ae3e9"}},{"ruleId":"D2","level":"warning","message":{"text":"App.Start (cognitive 100): App.Start has cognitive complexity 100 (threshold 15). Drivers by points: if/else 73, loops 19, boolean chains 8 (nesting depth added 65). Of this number, 98 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":"modules/caddyhttp/app.go"},"region":{"startLine":465}}}],"partialFingerprints":{"codehealthFindingId/v1":"17e802dfff4ed1e99737b9b2e7e9b9b9bb01369a16c03676cf2d4e1344990369"}},{"ruleId":"D2","level":"warning","message":{"text":"HeaderOps.ApplyTo (cognitive 93): HeaderOps.ApplyTo has cognitive complexity 93 (threshold 15). Drivers by points: if/else 51, loops 39, match/switch 2, boolean chains 1 (nesting depth added 59). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/headers/headers.go"},"region":{"startLine":220}}}],"partialFingerprints":{"codehealthFindingId/v1":"c667bf8cc4968754f8646b689e0c2166296d03ac8c442b1939791046d4cc2ae4"}},{"ruleId":"D2","level":"warning","message":{"text":"FileServer.UnmarshalCaddyfile (cognitive 87): FileServer.UnmarshalCaddyfile has cognitive complexity 87 (threshold 15). Drivers by points: if/else 62, match/switch 13, loops 12 (nesting depth added 61). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/fileserver/caddyfile.go"},"region":{"startLine":67}}}],"partialFingerprints":{"codehealthFindingId/v1":"fb4cbc570e5ad8ede620986731274607d59de85d1686c252e9bc3582f2aaf686"}},{"ruleId":"D2","level":"warning","message":{"text":"TLS.Provision (cognitive 76): TLS.Provision has cognitive complexity 76 (threshold 15). Drivers by points: if/else 59, loops 12, boolean chains 3, match/switch 2 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddytls/tls.go"},"region":{"startLine":162}}}],"partialFingerprints":{"codehealthFindingId/v1":"c0315e2ecc3eb91a2c0d13d460c1122328fb8a07d4322dc716e683e005bf3df7"}},{"ruleId":"D2","level":"warning","message":{"text":"App.createAutomationPolicies (cognitive 75): App.createAutomationPolicies has cognitive complexity 75 (threshold 15). Drivers by points: if/else 66, loops 7, boolean chains 2 (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/autohttps.go"},"region":{"startLine":597}}}],"partialFingerprints":{"codehealthFindingId/v1":"b536b7b7ce0e82423b21413c25b16ec2fbd895a13c74d104778dfdcd70673012"}},{"ruleId":"D2","level":"warning","message":{"text":"MatchFile.selectFile (cognitive 75): MatchFile.selectFile has cognitive complexity 75 (threshold 15). Drivers by points: if/else 47, loops 21, boolean chains 5, match/switch 2 (nesting depth added 38). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/fileserver/matcher.go"},"region":{"startLine":333}}}],"partialFingerprints":{"codehealthFindingId/v1":"79e063058f2a7be9922f4bb1ab4b10a6127614a34079897ff97a3a1410bcf950"}},{"ruleId":"D2","level":"warning","message":{"text":"Handler.Provision (cognitive 73): Handler.Provision has cognitive complexity 73 (threshold 15). Drivers by points: if/else 67, boolean chains 3, loops 3 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/reverseproxy/reverseproxy.go"},"region":{"startLine":262}}}],"partialFingerprints":{"codehealthFindingId/v1":"22b6783e2a27e6f6fab3109d3b7b522df36bec1c78bedaa6f97518dd5c758a0d"}},{"ruleId":"D2","level":"warning","message":{"text":"Server.ServeHTTP (cognitive 73): Server.ServeHTTP has cognitive complexity 73 (threshold 15). Drivers by points: if/else 61, loops 8, boolean chains 4 (nesting depth added 38). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/server.go"},"region":{"startLine":421}}}],"partialFingerprints":{"codehealthFindingId/v1":"bc02ef7dd7d52f3124291451322eef34bb70176766ae74a058c1fcdf4e587349"}},{"ruleId":"D2","level":"warning","message":{"text":"fastcgi.parsePHPFastCGI (cognitive 72): fastcgi.parsePHPFastCGI has cognitive complexity 72 (threshold 15). Drivers by points: if/else 65, loops 4, match/switch 3 (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/reverseproxy/fastcgi/caddyfile.go"},"region":{"startLine":172}}}],"partialFingerprints":{"codehealthFindingId/v1":"900f47d48a00db67c8b3254e4e5e9d50531a2c793da24262d70b87d298c2bb96"}},{"ruleId":"D2","level":"warning","message":{"text":"reverseproxy.cmdReverseProxy (cognitive 66): reverseproxy.cmdReverseProxy has cognitive complexity 66 (threshold 15). Drivers by points: if/else 48, loops 9, boolean chains 6, match/switch 3 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/reverseproxy/command.go"},"region":{"startLine":87}}}],"partialFingerprints":{"codehealthFindingId/v1":"c40915eb6d8f4b0a78bd7b479858961fbeaf57ff138c68894e86ba239c92a7ed"}},{"ruleId":"D2","level":"warning","message":{"text":"ConnectionPolicy.UnmarshalCaddyfile (cognitive 64): ConnectionPolicy.UnmarshalCaddyfile has cognitive complexity 64 (threshold 15). Drivers by points: if/else 60, match/switch 2, boolean chains 1, loops 1 (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddytls/connpolicy.go"},"region":{"startLine":481}}}],"partialFingerprints":{"codehealthFindingId/v1":"ef2c09c5143a6025a28e62c114f9efa04e8fbacebfed80cee0e5c262935e3651"}},{"ruleId":"D2","level":"warning","message":{"text":"ZeroSSLIssuer.UnmarshalCaddyfile (cognitive 64): ZeroSSLIssuer.UnmarshalCaddyfile has cognitive complexity 64 (threshold 15). Drivers by points: if/else 61, match/switch 2, loops 1 (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddytls/zerosslissuer.go"},"region":{"startLine":138}}}],"partialFingerprints":{"codehealthFindingId/v1":"d95c3c655eb1e8cf639fbe82560903474f6faa21d85403ba1070faf964ac8c3d"}},{"ruleId":"D2","level":"warning","message":{"text":"httpcaddyfile.fillInGlobalACMEDefaults (cognitive 63): httpcaddyfile.fillInGlobalACMEDefaults has cognitive complexity 63 (threshold 15). Drivers by points: if/else 40, boolean chains 23 (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":"caddyconfig/httpcaddyfile/tlsapp.go"},"region":{"startLine":516}}}],"partialFingerprints":{"codehealthFindingId/v1":"45f91e5745aa267cf0804cd05c342c9eea14ca65f0e30a964c3b717da7945718"}},{"ruleId":"D2","level":"warning","message":{"text":"Rewrite.Rewrite (cognitive 57): Rewrite.Rewrite has cognitive complexity 57 (threshold 15). Drivers by points: if/else 43, boolean chains 6, loops 4, match/switch 3, 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":"modules/caddyhttp/rewrite/rewrite.go"},"region":{"startLine":158}}}],"partialFingerprints":{"codehealthFindingId/v1":"623d4a9251d37f7777a80bada0785a6ed5bf1481da00747ccf76f9ef3b72096f"}},{"ruleId":"D2","level":"warning","message":{"text":"AUpstreams.UnmarshalCaddyfile (cognitive 56): AUpstreams.UnmarshalCaddyfile has cognitive complexity 56 (threshold 15). Drivers by points: if/else 46, match/switch 6, loops 4 (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":"modules/caddyhttp/reverseproxy/caddyfile.go"},"region":{"startLine":1562}}}],"partialFingerprints":{"codehealthFindingId/v1":"15db8d3b3e675cf299b376f3fff6ddb0f46e9e107369308c2dab490f71d0e652"}},{"ruleId":"D2","level":"warning","message":{"text":"ClientAuthentication.UnmarshalCaddyfile (cognitive 56): ClientAuthentication.UnmarshalCaddyfile has cognitive complexity 56 (threshold 15). Drivers by points: if/else 52, loops 2, match/switch 2 (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddytls/connpolicy.go"},"region":{"startLine":654}}}],"partialFingerprints":{"codehealthFindingId/v1":"486729fa78d967131145693113fded5506e74fe0560945379241ef3637dac1a5"}},{"ruleId":"D2","level":"warning","message":{"text":"acmeserver.parseACMEServer (cognitive 55): acmeserver.parseACMEServer has cognitive complexity 55 (threshold 15). Drivers by points: if/else 38, match/switch 10, loops 7 (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":"modules/caddypki/acmeserver/caddyfile.go"},"region":{"startLine":45}}}],"partialFingerprints":{"codehealthFindingId/v1":"ff1e6464c3b0dd3d7feaaf3477475735a17bc001d2231a6ec1bf0dcb585a0aa2"}},{"ruleId":"D2","level":"warning","message":{"text":"ConnectionPolicies.TLSConfig (cognitive 54): ConnectionPolicies.TLSConfig has cognitive complexity 54 (threshold 15). Drivers by points: loops 29, if/else 23, boolean chains 1, jumps 1 (nesting depth added 35). Of this number, 44 points are the body\u0027s own statements and 10 belong to one function literal inside it that branches. To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddytls/connpolicy.go"},"region":{"startLine":98}}}],"partialFingerprints":{"codehealthFindingId/v1":"eb99f0f9bb33da69533d2cef341c0d675ab93c8aa1fd45550cc3bb942aed6c7a"}},{"ruleId":"D2","level":"warning","message":{"text":"Handler.doActiveHealthCheck (cognitive 53): Handler.doActiveHealthCheck has cognitive complexity 53 (threshold 15). Drivers by points: if/else 49, loops 3, boolean chains 1 (nesting depth added 19). Of this number, 38 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":"modules/caddyhttp/reverseproxy/healthchecks.go"},"region":{"startLine":391}}}],"partialFingerprints":{"codehealthFindingId/v1":"543efe6bc46edc0ab973ca20a77936dfcc7f30b0c5804c12db3aa1f98d23297c"}},{"ruleId":"D2","level":"warning","message":{"text":"SRVUpstreams.UnmarshalCaddyfile (cognitive 53): SRVUpstreams.UnmarshalCaddyfile has cognitive complexity 53 (threshold 15). Drivers by points: if/else 50, match/switch 2, 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":"modules/caddyhttp/reverseproxy/caddyfile.go"},"region":{"startLine":1456}}}],"partialFingerprints":{"codehealthFindingId/v1":"d0f10a22d3d6bebdafbc5685d326e25e150282f2f126b4343921a43315d9876e"}},{"ruleId":"D2","level":"warning","message":{"text":"Context.LoadModule (cognitive 50): Context.LoadModule has cognitive complexity 50 (threshold 15). Drivers by points: if/else 35, loops 13, boolean chains 1, match/switch 1 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"context.go"},"region":{"startLine":188}}}],"partialFingerprints":{"codehealthFindingId/v1":"0e4eb396ceb2832865ac220967249217a068965b7be12bb3a0c164e360ac3d0e"}},{"ruleId":"D2","level":"warning","message":{"text":"Handler.reverseProxy (cognitive 50): Handler.reverseProxy has cognitive complexity 50 (threshold 15). Drivers by points: if/else 39, loops 6, boolean chains 5 (nesting depth added 21). 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":"modules/caddyhttp/reverseproxy/reverseproxy.go"},"region":{"startLine":991}}}],"partialFingerprints":{"codehealthFindingId/v1":"45d7cb72502ec446a80a377868023cbf380d6eb0d2771e4719147c46c873b6d8"}},{"ruleId":"D2","level":"warning","message":{"text":"ACMEIssuer.Provision (cognitive 50): ACMEIssuer.Provision has cognitive complexity 50 (threshold 15). Drivers by points: if/else 46, boolean chains 2, loops 2 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddytls/acmeissuer.go"},"region":{"startLine":129}}}],"partialFingerprints":{"codehealthFindingId/v1":"a8c7926f5becf885bef8685ccbd9239fc042e7cf09ee96cb3c86e12d410ce99a"}},{"ruleId":"D2","level":"warning","message":{"text":"caddyhttp.getReqTLSReplacement (cognitive 49): caddyhttp.getReqTLSReplacement has cognitive complexity 49 (threshold 15). Drivers by points: if/else 37, match/switch 9, boolean chains 3 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/replacer.go"},"region":{"startLine":414}}}],"partialFingerprints":{"codehealthFindingId/v1":"8f0e7126230883692c25095cb0118287a3938aaa1bda46358a6485eb47e5b814"}},{"ruleId":"D2","level":"warning","message":{"text":"httpcaddyfile.consolidateAutomationPolicies (cognitive 48): httpcaddyfile.consolidateAutomationPolicies has cognitive complexity 48 (threshold 15). Drivers by points: if/else 33, loops 9, boolean chains 4, jumps 2 (nesting depth added 26). Of this number, 46 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":"caddyconfig/httpcaddyfile/tlsapp.go"},"region":{"startLine":969}}}],"partialFingerprints":{"codehealthFindingId/v1":"88e13b440ccb08074a426f524d1a01b7db8af3d430bc1d2249ba5422da7a21df"}},{"ruleId":"D2","level":"warning","message":{"text":"reverseproxy.parseUpstreamDialAddress (cognitive 48): reverseproxy.parseUpstreamDialAddress has cognitive complexity 48 (threshold 15). Drivers by points: if/else 39, boolean chains 6, match/switch 3 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/reverseproxy/addresses.go"},"region":{"startLine":65}}}],"partialFingerprints":{"codehealthFindingId/v1":"289ca507f8a096b1ed522eae125bfebeaaceb1cdfb182fa11d901bc158b6ca5c"}},{"ruleId":"D2","level":"warning","message":{"text":"RemoteAdmin.enforceAccessControls (cognitive 47): RemoteAdmin.enforceAccessControls has cognitive complexity 47 (threshold 15). Drivers by points: if/else 24, loops 21, boolean chains 2 (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"admin.go"},"region":{"startLine":668}}}],"partialFingerprints":{"codehealthFindingId/v1":"17659a1314842b164d6b93135a85077c36a2549f6a2797ac8acfec383773dc7d"}},{"ruleId":"D2","level":"warning","message":{"text":"forwardauth.parseCaddyfile (cognitive 47): forwardauth.parseCaddyfile has cognitive complexity 47 (threshold 15). Drivers by points: if/else 31, loops 13, match/switch 3 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/reverseproxy/forwardauth/caddyfile.go"},"region":{"startLine":64}}}],"partialFingerprints":{"codehealthFindingId/v1":"db303be826b75c90b3746c75191bb5da6cc8a53bed0b3025fd97dc7c00b47b4c"}},{"ruleId":"D2","level":"warning","message":{"text":"caddyhttp.cmdRespond (cognitive 46): caddyhttp.cmdRespond has cognitive complexity 46 (threshold 15). Drivers by points: if/else 32, loops 8, boolean chains 5, 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":"modules/caddyhttp/staticresp.go"},"region":{"startLine":316}}}],"partialFingerprints":{"codehealthFindingId/v1":"e7203310a31259f66d574e3cc10f49bcf43ed884746fac3767a67169e9654268"}},{"ruleId":"D2","level":"warning","message":{"text":"Handler.proxyLoopIteration (cognitive 46): Handler.proxyLoopIteration has cognitive complexity 46 (threshold 15). Drivers by points: if/else 42, loops 3, 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":"modules/caddyhttp/reverseproxy/reverseproxy.go"},"region":{"startLine":603}}}],"partialFingerprints":{"codehealthFindingId/v1":"c72ead294ad01b2ce1d3cb5f91ddd4910789110397cb596936d11b09504393e5"}},{"ruleId":"D2","level":"warning","message":{"text":"TLSConfig.MakeTLSClientConfig (cognitive 45): TLSConfig.MakeTLSClientConfig has cognitive complexity 45 (threshold 15). Drivers by points: if/else 32, loops 7, boolean chains 5, match/switch 1 (nesting depth added 17). Of this number, 38 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":"modules/caddyhttp/reverseproxy/httptransport.go"},"region":{"startLine":790}}}],"partialFingerprints":{"codehealthFindingId/v1":"5985ff6d13cbdf73fb582e93c5292b8111b732140243722503af0b1728bf5c64"}},{"ruleId":"D2","level":"warning","message":{"text":"caddy.Version (cognitive 44): caddy.Version has cognitive complexity 44 (threshold 15). Drivers by points: if/else 37, loops 3, match/switch 3, 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":"caddy.go"},"region":{"startLine":1003}}}],"partialFingerprints":{"codehealthFindingId/v1":"8a947b70a9a05896e089c4ad275346a14b21cd998ff5a8bbc3e512d5a36fdafe"}},{"ruleId":"D2","level":"warning","message":{"text":"App.Stop (cognitive 44): App.Stop has cognitive complexity 44 (threshold 15). Drivers by points: if/else 27, loops 15, boolean chains 2 (nesting depth added 17). Of this number, 28 points are the body\u0027s own statements and 16 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/app.go"},"region":{"startLine":674}}}],"partialFingerprints":{"codehealthFindingId/v1":"fe1672776de5f1262edf33e19ed19b9f2555f0810a102fd0f793d09ca57e2c79"}},{"ruleId":"D2","level":"warning","message":{"text":"Server.serveHTTP (cognitive 44): Server.serveHTTP has cognitive complexity 44 (threshold 15). Drivers by points: if/else 39, loops 4, boolean chains 1 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/server.go"},"region":{"startLine":582}}}],"partialFingerprints":{"codehealthFindingId/v1":"4202fa56a7daed37534a0408835ece39e79badc028b2cdfb66161902cde0282f"}},{"ruleId":"D2","level":"warning","message":{"text":"caddy.finishSettingUp (cognitive 43): caddy.finishSettingUp has cognitive complexity 43 (threshold 15). Drivers by points: if/else 35, match/switch 4, loops 3, boolean chains 1 (nesting depth added 27). Most of this is not in the body itself: 12 of the 43 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 636, 621). 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":"caddy.go"},"region":{"startLine":594}}}],"partialFingerprints":{"codehealthFindingId/v1":"2ed3d45f033f8cf9c0446439faa0c42fa684466119ccb7a5eb35e158b6b99e11"}},{"ruleId":"D2","level":"warning","message":{"text":"AutomationPolicy.makeCertMagicConfig (cognitive 43): AutomationPolicy.makeCertMagicConfig has cognitive complexity 43 (threshold 15). Drivers by points: if/else 37, boolean chains 6 (nesting depth added 20). Of this number, 16 points are the body\u0027s own statements and 27 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddytls/automation.go"},"region":{"startLine":272}}}],"partialFingerprints":{"codehealthFindingId/v1":"ff3fa1fc031c05e7de734767e8d9a48e1d30ed10b9b9b6179766b76601af8c86"}},{"ruleId":"D2","level":"warning","message":{"text":"caddy.listenReusable (cognitive 41): caddy.listenReusable has cognitive complexity 41 (threshold 15). Drivers by points: if/else 41 (nesting depth added 18). Of this number, 31 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":"listen_unix.go"},"region":{"startLine":94}}}],"partialFingerprints":{"codehealthFindingId/v1":"df68515f52d293579341fd9314dd221e44fac352398d21d6448ad024a4cd6ea9"}},{"ruleId":"D2","level":"warning","message":{"text":"ServerType.mapAddressToProtocolToServerBlocks (cognitive 41): ServerType.mapAddressToProtocolToServerBlocks has cognitive complexity 41 (threshold 15). Drivers by points: loops 24, if/else 17 (nesting depth added 27). 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":"caddyconfig/httpcaddyfile/addresses.go"},"region":{"startLine":80}}}],"partialFingerprints":{"codehealthFindingId/v1":"faaec0189537697865ee8abeb9aa5c485fe0e56a47c63c8a6c9f5d15beaadfb8"}},{"ruleId":"D2","level":"warning","message":{"text":"caddycmd.cmdRun (cognitive 41): caddycmd.cmdRun has cognitive complexity 41 (threshold 15). Drivers by points: if/else 35, boolean chains 4, match/switch 2 (nesting depth added 12). Of this number, 39 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/commandfuncs.go"},"region":{"startLine":188}}}],"partialFingerprints":{"codehealthFindingId/v1":"f2247793cc6d5f37de553ed357e3175f381ab45fe77b5dbc24ad54f281399e9b"}},{"ruleId":"D2","level":"warning","message":{"text":"queryOps.do (cognitive 41): queryOps.do has cognitive complexity 41 (threshold 15). Drivers by points: if/else 26, loops 14, 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":"modules/caddyhttp/rewrite/rewrite.go"},"region":{"startLine":562}}}],"partialFingerprints":{"codehealthFindingId/v1":"56139af5696e8fb791796bb951077dbe3deefa61e4630f67a802b795b4e09f49"}},{"ruleId":"D2","level":"warning","message":{"text":"caddycmd.loadConfigWithLogger (cognitive 40): caddycmd.loadConfigWithLogger has cognitive complexity 40 (threshold 15). Drivers by points: if/else 37, 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":"cmd/main.go"},"region":{"startLine":146}}}],"partialFingerprints":{"codehealthFindingId/v1":"816ae06a07141b8dac8b28af5b9f071d677a327f994efa23c1e46d3b6838fcc9"}},{"ruleId":"D2","level":"warning","message":{"text":"FilterEncoder.UnmarshalCaddyfile (cognitive 40): FilterEncoder.UnmarshalCaddyfile has cognitive complexity 40 (threshold 15). Drivers by points: if/else 30, loops 8, match/switch 2 (nesting depth added 20). Of this number, 33 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":"modules/logging/filterencoder.go"},"region":{"startLine":152}}}],"partialFingerprints":{"codehealthFindingId/v1":"e428fee0c24e725edc28c1cfc96cd5e7a3ec3c1724c8eac1f620052113853e10"}},{"ruleId":"D2","level":"warning","message":{"text":"caddycmd.cmdListModules (cognitive 39): caddycmd.cmdListModules has cognitive complexity 39 (threshold 15). Drivers by points: if/else 23, loops 11, boolean chains 5 (nesting depth added 14). Of this number, 27 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":"cmd/commandfuncs.go"},"region":{"startLine":438}}}],"partialFingerprints":{"codehealthFindingId/v1":"8152b01799da84860fbfc89c9d5fd13cdeef88087ceb79795c437adf1cd480be"}},{"ruleId":"D2","level":"warning","message":{"text":"Transport.UnmarshalCaddyfile (cognitive 39): Transport.UnmarshalCaddyfile has cognitive complexity 39 (threshold 15). Drivers by points: if/else 36, match/switch 2, loops 1 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/reverseproxy/fastcgi/caddyfile.go"},"region":{"startLine":50}}}],"partialFingerprints":{"codehealthFindingId/v1":"3d65c4584115f6ca28af7f39cbb9b051222cb7fa1de36c8c8203cde687e1f8b0"}},{"ruleId":"D2","level":"warning","message":{"text":"caddytls.tlsCertFromCertAndKeyPEMBundle (cognitive 39): caddytls.tlsCertFromCertAndKeyPEMBundle has cognitive complexity 39 (threshold 15). Drivers by points: if/else 36, boolean chains 2, loops 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddytls/folderloader.go"},"region":{"startLine":106}}}],"partialFingerprints":{"codehealthFindingId/v1":"ea5375f1177aef70970f69b9fcb3db6c7688a2cc17196f1756cacd2de61bf950"}},{"ruleId":"D2","level":"warning","message":{"text":"App.Emit (cognitive 38): App.Emit has cognitive complexity 38 (threshold 15). Drivers by points: if/else 27, loops 6, match/switch 5 (nesting depth added 21). Of this number, 34 points are the body\u0027s own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyevents/app.go"},"region":{"startLine":207}}}],"partialFingerprints":{"codehealthFindingId/v1":"b56bc7877efdb1c8f7c824aae4684d242a724c41127144f0115ddfbc56a09282"}},{"ruleId":"D2","level":"warning","message":{"text":"FileServer.Provision (cognitive 38): FileServer.Provision has cognitive complexity 38 (threshold 15). Drivers by points: if/else 28, loops 4, boolean chains 3, match/switch 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":"modules/caddyhttp/fileserver/staticfiles.go"},"region":{"startLine":194}}}],"partialFingerprints":{"codehealthFindingId/v1":"522bd22b09d5d63c1d8949e3c0c554ca474f3e1ab08d4fd52a7795683af31569"}},{"ruleId":"D2","level":"warning","message":{"text":"Handler.doActiveHealthCheckForAllHosts (cognitive 38): Handler.doActiveHealthCheckForAllHosts has cognitive complexity 38 (threshold 15). Drivers by points: if/else 35, boolean chains 2, loops 1 (nesting depth added 20). Most of this is not in the body itself: 1 of the 38 points is its own statement and the rest belongs to one function literal inside it that branches (line 299). 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":"modules/caddyhttp/reverseproxy/healthchecks.go"},"region":{"startLine":297}}}],"partialFingerprints":{"codehealthFindingId/v1":"f2ccc619e6aaa30404f1beef0c725001b69768bed6af99e3f917179231420ee6"}},{"ruleId":"D2","level":"warning","message":{"text":"Replacer.replace (cognitive 38): Replacer.replace has cognitive complexity 38 (threshold 15). Drivers by points: if/else 30, boolean chains 4, loops 3, 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":"replacer.go"},"region":{"startLine":175}}}],"partialFingerprints":{"codehealthFindingId/v1":"b91333719ae7a29bb36913c4fffb974c58ac2bd81f82f0f905784e72f955199f"}},{"ruleId":"D2","level":"warning","message":{"text":"parser.addresses (cognitive 37): parser.addresses has cognitive complexity 37 (threshold 15). Drivers by points: if/else 32, boolean chains 4, 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":"caddyconfig/caddyfile/parse.go"},"region":{"startLine":210}}}],"partialFingerprints":{"codehealthFindingId/v1":"89bd358df6fe4bf3343d6b7c7cd98a0b008ab1c07d49e7c53ea8e153cf1cbfb0"}},{"ruleId":"D2","level":"warning","message":{"text":"ServerType.evaluateGlobalOptionsBlock (cognitive 37): ServerType.evaluateGlobalOptionsBlock has cognitive complexity 37 (threshold 15). Drivers by points: if/else 33, loops 3, 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":"caddyconfig/httpcaddyfile/httptype.go"},"region":{"startLine":370}}}],"partialFingerprints":{"codehealthFindingId/v1":"80330ec293cb5e17236b0d804fe6a74ce3949ec0b1623dd0bacc20192803520e"}},{"ruleId":"D2","level":"warning","message":{"text":"caddycmd.cmdExportStorage (cognitive 37): caddycmd.cmdExportStorage has cognitive complexity 37 (threshold 15). Drivers by points: if/else 35, boolean chains 1, loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/storagefuncs.go"},"region":{"startLine":136}}}],"partialFingerprints":{"codehealthFindingId/v1":"317a72a32c7bf9474424c07e0f79705e6b90ced5564b23ce729ccdd542b17104"}},{"ruleId":"D2","level":"warning","message":{"text":"MatchPath.matchPatternWithEscapeSequence (cognitive 37): MatchPath.matchPatternWithEscapeSequence has cognitive complexity 37 (threshold 15). Drivers by points: if/else 31, boolean chains 3, match/switch 2, loops 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/matchers.go"},"region":{"startLine":537}}}],"partialFingerprints":{"codehealthFindingId/v1":"850cd25284d6c0766418187d6535b6580b881aefefd84632d08767f3b1cfa959"}},{"ruleId":"D2","level":"warning","message":{"text":"CustomCertSelectionPolicy.SelectCertificate (cognitive 37): CustomCertSelectionPolicy.SelectCertificate has cognitive complexity 37 (threshold 15). Drivers by points: if/else 28, loops 7, boolean chains 1, jumps 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":"modules/caddytls/certselection.go"},"region":{"startLine":56}}}],"partialFingerprints":{"codehealthFindingId/v1":"63e9aeaf4e8cf30832b2e799a4a20192f987379cea15d7b5895a91d46feeade1"}},{"ruleId":"D2","level":"warning","message":{"text":"FileWriter.OpenWriter (cognitive 37): FileWriter.OpenWriter has cognitive complexity 37 (threshold 15). Drivers by points: if/else 33, boolean chains 3, match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/logging/filewriter.go"},"region":{"startLine":187}}}],"partialFingerprints":{"codehealthFindingId/v1":"f15648dc614bb2546de079d4075e73dbbf5c00b64095059f4b985ebfbdc30d8d"}},{"ruleId":"D2","level":"warning","message":{"text":"ServerType.consolidateAddrMappings (cognitive 36): ServerType.consolidateAddrMappings has cognitive complexity 36 (threshold 15). Drivers by points: loops 23, if/else 11, boolean chains 2 (nesting depth added 23). 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":"caddyconfig/httpcaddyfile/addresses.go"},"region":{"startLine":195}}}],"partialFingerprints":{"codehealthFindingId/v1":"c980c84b10f32c3bfa48e88946afb3965f980cfada5b89d5ca50e38f30b4a2db"}},{"ruleId":"D2","level":"warning","message":{"text":"FileServer.directoryListing (cognitive 36): FileServer.directoryListing has cognitive complexity 36 (threshold 15). Drivers by points: if/else 32, boolean chains 3, 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":"modules/caddyhttp/fileserver/browsetplcontext.go"},"region":{"startLine":37}}}],"partialFingerprints":{"codehealthFindingId/v1":"f424b985fe1dbf8e52aa07762b6f93cf51f1f2ce1bde1d54e9121e4b994d43c5"}},{"ruleId":"D2","level":"warning","message":{"text":"ConnectionPolicy.buildStandardTLSConfig (cognitive 36): ConnectionPolicy.buildStandardTLSConfig has cognitive complexity 36 (threshold 15). Drivers by points: if/else 30, boolean chains 4, loops 2 (nesting depth added 10). Of this number, 32 points are the body\u0027s own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddytls/connpolicy.go"},"region":{"startLine":269}}}],"partialFingerprints":{"codehealthFindingId/v1":"0bfc6da02958f50a847b98f9df21291eeeaf8f4d81a95785deae7edcd28f05dd"}},{"ruleId":"D2","level":"warning","message":{"text":"MatchPath.MatchWithError (cognitive 35): MatchPath.MatchWithError has cognitive complexity 35 (threshold 15). Drivers by points: if/else 33, 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":"modules/caddyhttp/matchers.go"},"region":{"startLine":429}}}],"partialFingerprints":{"codehealthFindingId/v1":"149703c7de247d41b61ac431b0a9c89778e51f1f6f185d78797393cd49845b8d"}},{"ruleId":"D2","level":"warning","message":{"text":"ServerType.listenersForServerBlockAddress (cognitive 34): ServerType.listenersForServerBlockAddress has cognitive complexity 34 (threshold 15). Drivers by points: if/else 20, loops 10, boolean chains 3, match/switch 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"caddyconfig/httpcaddyfile/addresses.go"},"region":{"startLine":270}}}],"partialFingerprints":{"codehealthFindingId/v1":"c0131c928aff8a8d029420d1d66664ae0dfa81b069b5e7052a7eb85cdfaab878"}},{"ruleId":"D2","level":"warning","message":{"text":"CustomLog.loggerAllowed (cognitive 34): CustomLog.loggerAllowed has cognitive complexity 34 (threshold 15). Drivers by points: if/else 21, boolean chains 9, loops 4 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"logging.go"},"region":{"startLine":533}}}],"partialFingerprints":{"codehealthFindingId/v1":"7c22dfd1b2598f96122de6f3383170b773b5a128ea97532f5b4b6849bdacd9d5"}},{"ruleId":"D2","level":"warning","message":{"text":"FileServer.serveBrowse (cognitive 34): FileServer.serveBrowse has cognitive complexity 34 (threshold 15). Drivers by points: if/else 28, boolean chains 2, loops 2, match/switch 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/fileserver/browse.go"},"region":{"startLine":78}}}],"partialFingerprints":{"codehealthFindingId/v1":"1163deed20ba5169944f78a8acb19f55cf0f6089f3dced64d7d2ec338798a5ce"}},{"ruleId":"D2","level":"warning","message":{"text":"CustomCertSelectionPolicy.UnmarshalCaddyfile (cognitive 34): CustomCertSelectionPolicy.UnmarshalCaddyfile has cognitive complexity 34 (threshold 15). Drivers by points: if/else 28, loops 4, match/switch 2 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddytls/certselection.go"},"region":{"startLine":125}}}],"partialFingerprints":{"codehealthFindingId/v1":"4a44ab7cde46656beeed10182041881165d80386cf4136b5d87b850006ebcb03"}},{"ruleId":"D2","level":"warning","message":{"text":"Context.LoadModuleByID (cognitive 33): Context.LoadModuleByID has cognitive complexity 33 (threshold 15). Drivers by points: if/else 33 (nesting depth added 15). Of this number, 31 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"context.go"},"region":{"startLine":364}}}],"partialFingerprints":{"codehealthFindingId/v1":"5e5308fae035a62c114237803043a6c1b70ad0b8dcd6c0dd6ebaf06ee22d0cf3"}},{"ruleId":"D2","level":"warning","message":{"text":"templates.parseCaddyfile (cognitive 33): templates.parseCaddyfile has cognitive complexity 33 (threshold 15). Drivers by points: if/else 27, loops 4, match/switch 2 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/templates/caddyfile.go"},"region":{"startLine":36}}}],"partialFingerprints":{"codehealthFindingId/v1":"5788978b129521bf00cfb7ffbdd8a0f221f09bcb735ce3976298dab5c3060ba0"}},{"ruleId":"D2","level":"warning","message":{"text":"ServerType.compileEncodedMatcherSets (cognitive 32): ServerType.compileEncodedMatcherSets has cognitive complexity 32 (threshold 15). Drivers by points: if/else 22, boolean chains 5, loops 5 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"caddyconfig/httpcaddyfile/httptype.go"},"region":{"startLine":1488}}}],"partialFingerprints":{"codehealthFindingId/v1":"44a696f7dcfde1069143d005b9d0a6924108bd4d4d0202e65ea2b6ec784f2619"}},{"ruleId":"D2","level":"warning","message":{"text":"ECH.rotateECHKeys (cognitive 32): ECH.rotateECHKeys has cognitive complexity 32 (threshold 15). Drivers by points: if/else 27, loops 3, boolean chains 2 (nesting depth added 17). Of this number, 30 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":"modules/caddytls/ech.go"},"region":{"startLine":190}}}],"partialFingerprints":{"codehealthFindingId/v1":"ced0b097d4eaea953114f2e75d669ec6bfd5b60b832f452288318a86706be1ac"}},{"ruleId":"D2","level":"warning","message":{"text":"Metrics.scanConfigForHosts (cognitive 31): Metrics.scanConfigForHosts has cognitive complexity 31 (threshold 15). Drivers by points: loops 16, if/else 15 (nesting depth added 22). 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":"modules/caddyhttp/metrics.go"},"region":{"startLine":232}}}],"partialFingerprints":{"codehealthFindingId/v1":"ceac3a66e58a4454d5e0022d13f24a12af5f05202941d7685d1b5a41277be513"}},{"ruleId":"D2","level":"warning","message":{"text":"Handler.addForwardedHeaders (cognitive 31): Handler.addForwardedHeaders has cognitive complexity 31 (threshold 15). Drivers by points: if/else 25, boolean chains 3, loops 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/reverseproxy/reverseproxy.go"},"region":{"startLine":889}}}],"partialFingerprints":{"codehealthFindingId/v1":"2cdf52a92d85a88d9e4fd91bb9c2540fd211f57f894aaf54b1b4764baa912d6c"}},{"ruleId":"D2","level":"warning","message":{"text":"ECHDNSPublisher.PublishECHConfigList (cognitive 31): ECHDNSPublisher.PublishECHConfigList has cognitive complexity 31 (threshold 15). Drivers by points: if/else 25, loops 3, boolean chains 2, jumps 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddytls/ech.go"},"region":{"startLine":821}}}],"partialFingerprints":{"codehealthFindingId/v1":"23bb7eb35614fde1f9a58acc74ca53d65fea4c76e5e5737d6ec1ab09d723b502"}},{"ruleId":"D2","level":"warning","message":{"text":"TLS.Start (cognitive 31): TLS.Start has cognitive complexity 31 (threshold 15). Drivers by points: if/else 21, loops 4, boolean chains 3, match/switch 3 (nesting depth added 16). Of this number, 16 points are the body\u0027s own statements and 15 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddytls/tls.go"},"region":{"startLine":401}}}],"partialFingerprints":{"codehealthFindingId/v1":"caea32194b7298cdafa610dcb440d3dfc45b70893657632c1d3f3b96e70082cd"}},{"ruleId":"D2","level":"warning","message":{"text":"httpcaddyfile.detectConflictingSchemes (cognitive 30): httpcaddyfile.detectConflictingSchemes has cognitive complexity 30 (threshold 15). Drivers by points: if/else 24, boolean chains 3, loops 3 (nesting depth added 13). Of this number, 24 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":"caddyconfig/httpcaddyfile/httptype.go"},"region":{"startLine":1031}}}],"partialFingerprints":{"codehealthFindingId/v1":"f4eb71541b551e87e678b0522ed7aeff67a2da9f358997c53f121f079e0b1d4a"}},{"ruleId":"D2","level":"warning","message":{"text":"Encode.UnmarshalCaddyfile (cognitive 30): Encode.UnmarshalCaddyfile has cognitive complexity 30 (threshold 15). Drivers by points: if/else 25, loops 2, match/switch 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":"modules/caddyhttp/encode/caddyfile.go"},"region":{"startLine":59}}}],"partialFingerprints":{"codehealthFindingId/v1":"f655d168a927c03eb05486847fea5c6e6722ae392406a63972aa36e512d438b5"}},{"ruleId":"D2","level":"warning","message":{"text":"headers.parseCaddyfile (cognitive 30): headers.parseCaddyfile has cognitive complexity 30 (threshold 15). Drivers by points: if/else 29, 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":"modules/caddyhttp/headers/caddyfile.go"},"region":{"startLine":49}}}],"partialFingerprints":{"codehealthFindingId/v1":"2b6ed85f7544ce6875757255379814f043028ae18af732ce9d23ce38353bf797"}},{"ruleId":"D2","level":"warning","message":{"text":"rewrite.parseCaddyfileURI (cognitive 30): rewrite.parseCaddyfileURI has cognitive complexity 30 (threshold 15). Drivers by points: if/else 25, match/switch 3, loops 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/rewrite/caddyfile.go"},"region":{"startLine":97}}}],"partialFingerprints":{"codehealthFindingId/v1":"d985f1e1bb33a187488a962d80fc9e76c84b2b5a8a9bb1ec7cb0031632f295d8"}},{"ruleId":"D2","level":"warning","message":{"text":"caddy.changeConfig (cognitive 29): caddy.changeConfig has cognitive complexity 29 (threshold 15). Drivers by points: if/else 26, boolean chains 2, match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"caddy.go"},"region":{"startLine":158}}}],"partialFingerprints":{"codehealthFindingId/v1":"caef7c911b896d989aab14ca9e026dd70eaea03240f919f8e08628c7d4f34ff5"}},{"ruleId":"D2","level":"warning","message":{"text":"httpcaddyfile.parseHandleErrors (cognitive 29): httpcaddyfile.parseHandleErrors has cognitive complexity 29 (threshold 15). Drivers by points: if/else 27, loops 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"caddyconfig/httpcaddyfile/builtins.go"},"region":{"startLine":828}}}],"partialFingerprints":{"codehealthFindingId/v1":"7b566ce316cc821d61a72d289be25ad68c84defecbf0a4eee04bee20f3cfb79c"}},{"ruleId":"D2","level":"warning","message":{"text":"httpcaddyfile.appendSubrouteToRouteList (cognitive 29): httpcaddyfile.appendSubrouteToRouteList has cognitive complexity 29 (threshold 15). Drivers by points: if/else 15, loops 9, boolean chains 4, jumps 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"caddyconfig/httpcaddyfile/httptype.go"},"region":{"startLine":1254}}}],"partialFingerprints":{"codehealthFindingId/v1":"5a5044028fe82726b0e6948fa0c72c6636439ec2e08dfeca287174ab27c7ac47"}},{"ruleId":"D2","level":"warning","message":{"text":"httpcaddyfile.parseOptOnDemand (cognitive 29): httpcaddyfile.parseOptOnDemand has cognitive complexity 29 (threshold 15). Drivers by points: if/else 26, match/switch 2, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"caddyconfig/httpcaddyfile/options.go"},"region":{"startLine":383}}}],"partialFingerprints":{"codehealthFindingId/v1":"fb29c6b575cd1ace0ef579a934db60e4fbd56b163391c8f9121d7bc17fe28949"}},{"ruleId":"D2","level":"warning","message":{"text":"caddyhttp.ParseNamedResponseMatcher (cognitive 29): caddyhttp.ParseNamedResponseMatcher has cognitive complexity 29 (threshold 15). Drivers by points: if/else 21, loops 4, boolean chains 2, match/switch 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/responsematchers.go"},"region":{"startLine":69}}}],"partialFingerprints":{"codehealthFindingId/v1":"3b6b0e8cafe3b3227dc2523712749502ec277b761a757d521765ca6d55e69c48"}},{"ruleId":"D2","level":"warning","message":{"text":"fileserver.cmdFileServer (cognitive 29): fileserver.cmdFileServer has cognitive complexity 29 (threshold 15). Drivers by points: if/else 26, loops 2, match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/fileserver/command.go"},"region":{"startLine":86}}}],"partialFingerprints":{"codehealthFindingId/v1":"80eae7da8e4022ce765535bf72c44a11a62c3a0a98e71942c2ac5aedf3c900a8"}},{"ruleId":"D2","level":"warning","message":{"text":"MatchHost.MatchWithError (cognitive 29): MatchHost.MatchWithError has cognitive complexity 29 (threshold 15). Drivers by points: if/else 22, loops 4, boolean chains 2, jumps 1 (nesting depth added 14). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/matchers.go"},"region":{"startLine":307}}}],"partialFingerprints":{"codehealthFindingId/v1":"88dc0a7ad9ce16b43113bc58dd8dd041234110e9ded75a48c020b6982e2cd63a"}},{"ruleId":"D2","level":"warning","message":{"text":"Tracing.UnmarshalCaddyfile (cognitive 29): Tracing.UnmarshalCaddyfile has cognitive complexity 29 (threshold 15). Drivers by points: if/else 23, loops 4, match/switch 2 (nesting depth added 16). Of this number, 26 points are the body\u0027s own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/tracing/module.go"},"region":{"startLine":80}}}],"partialFingerprints":{"codehealthFindingId/v1":"ddc9a5f6f032f1e95fcbe056cc7c60bce092b08bcc03517299e3a5cf4362777f"}},{"ruleId":"D2","level":"warning","message":{"text":"httpcaddyfile.buildSubroute (cognitive 28): httpcaddyfile.buildSubroute has cognitive complexity 28 (threshold 15). Drivers by points: if/else 18, loops 7, match/switch 2, boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"caddyconfig/httpcaddyfile/httptype.go"},"region":{"startLine":1317}}}],"partialFingerprints":{"codehealthFindingId/v1":"58de7aad90ad78da1c1b5c4efed89be9d965b2716389b53cea8a52b4bc55bbb5"}},{"ruleId":"D2","level":"warning","message":{"text":"caddyhttp.matchHeaders (cognitive 28): caddyhttp.matchHeaders has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14, loops 6, match/switch 4, boolean chains 3, jumps 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":"modules/caddyhttp/matchers.go"},"region":{"startLine":1150}}}],"partialFingerprints":{"codehealthFindingId/v1":"5da3c099539c9238af7da03091b55d34e97c1f55e5df221c488824c87be83ef4"}},{"ruleId":"D2","level":"warning","message":{"text":"caddyauth.cmdHashPassword (cognitive 28): caddyauth.cmdHashPassword has cognitive complexity 28 (threshold 15). Drivers by points: if/else 27, match/switch 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/caddyauth/command.go"},"region":{"startLine":89}}}],"partialFingerprints":{"codehealthFindingId/v1":"72ceea3575ade9e164559a038fdca943a669e24753a53680ce6d9984c1ce5358"}},{"ruleId":"D2","level":"warning","message":{"text":"Authentication.ServeHTTP (cognitive 28): Authentication.ServeHTTP has cognitive complexity 28 (threshold 15). Drivers by points: if/else 26, 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":"modules/caddyhttp/caddyauth/caddyauth.go"},"region":{"startLine":89}}}],"partialFingerprints":{"codehealthFindingId/v1":"5a86fcc5c97ebfd995a31330ce44f58aa1b73ee111c724ccf768017b4be45fef"}},{"ruleId":"D2","level":"warning","message":{"text":"RequestBody.ServeHTTP (cognitive 28): RequestBody.ServeHTTP has cognitive complexity 28 (threshold 15). Drivers by points: if/else 27, 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":"modules/caddyhttp/requestbody/requestbody.go"},"region":{"startLine":67}}}],"partialFingerprints":{"codehealthFindingId/v1":"b8d6458e22ba390e9c10ca9925e3c7e2cae67a323734ba787c13904627517ddc"}},{"ruleId":"D2","level":"warning","message":{"text":"LoadBalancing.tryAgain (cognitive 28): LoadBalancing.tryAgain has cognitive complexity 28 (threshold 15). Drivers by points: if/else 21, boolean chains 6, match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/reverseproxy/reverseproxy.go"},"region":{"startLine":1342}}}],"partialFingerprints":{"codehealthFindingId/v1":"8d74375eb46f838a0af8816a646db575f27980beb505b1ba921c58a15d784aca"}},{"ruleId":"D2","level":"warning","message":{"text":"CookieHashSelection.UnmarshalCaddyfile (cognitive 28): CookieHashSelection.UnmarshalCaddyfile has cognitive complexity 28 (threshold 15). Drivers by points: if/else 24, match/switch 3, 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":"modules/caddyhttp/reverseproxy/selectionpolicies.go"},"region":{"startLine":742}}}],"partialFingerprints":{"codehealthFindingId/v1":"7346e5d6880d32c5d333cbf515a36255eac4afbeab86d24572844eb18a3f595a"}},{"ruleId":"D2","level":"warning","message":{"text":"caddycmd.parseEnvFile (cognitive 27): caddycmd.parseEnvFile has cognitive complexity 27 (threshold 15). Drivers by points: if/else 19, boolean chains 4, loops 4 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/main.go"},"region":{"startLine":385}}}],"partialFingerprints":{"codehealthFindingId/v1":"bc4be2d31b7a3da846f19d385b69e993e1fcc510a3845ccc3ee3b0fcd825fbec"}},{"ruleId":"D2","level":"warning","message":{"text":"Intercept.UnmarshalCaddyfile (cognitive 27): Intercept.UnmarshalCaddyfile has cognitive complexity 27 (threshold 15). Drivers by points: if/else 23, match/switch 2, boolean chains 1, loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/intercept/intercept.go"},"region":{"startLine":232}}}],"partialFingerprints":{"codehealthFindingId/v1":"42431a1cf2edc53c07ff123bd66a087cbb9cf1816010615d866e672f18d7b214"}},{"ruleId":"D2","level":"warning","message":{"text":"maphandler.parseCaddyfile (cognitive 27): maphandler.parseCaddyfile has cognitive complexity 27 (threshold 15). Drivers by points: if/else 18, loops 9 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/map/caddyfile.go"},"region":{"startLine":44}}}],"partialFingerprints":{"codehealthFindingId/v1":"1524f3c048c621749464f20a75338b25ee5ec8b52a2a4f1e31212cdf9b44569d"}},{"ruleId":"D2","level":"warning","message":{"text":"Handler.finalizeResponse (cognitive 27): Handler.finalizeResponse has cognitive complexity 27 (threshold 15). Drivers by points: if/else 17, loops 6, boolean chains 4 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/reverseproxy/reverseproxy.go"},"region":{"startLine":1218}}}],"partialFingerprints":{"codehealthFindingId/v1":"c39374e213e1c8de94f7fb3df3c3adc03a6eed7a8d9ff6346967ad1596b48489"}},{"ruleId":"D2","level":"warning","message":{"text":"StaticResponse.ServeHTTP (cognitive 27): StaticResponse.ServeHTTP has cognitive complexity 27 (threshold 15). Drivers by points: if/else 18, boolean chains 6, 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":"modules/caddyhttp/staticresp.go"},"region":{"startLine":181}}}],"partialFingerprints":{"codehealthFindingId/v1":"5c7f177e0f73ab6124367613c1c712026b3769915d8b456a91c1104440861c64"}},{"ruleId":"D2","level":"warning","message":{"text":"CA.Provision (cognitive 27): CA.Provision has cognitive complexity 27 (threshold 15). Drivers by points: if/else 25, boolean chains 2 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddypki/ca.go"},"region":{"startLine":99}}}],"partialFingerprints":{"codehealthFindingId/v1":"8052fadc1a53f97536699adf713ea2b08b461351cdbed36ac9f230ff8e0f59c7"}},{"ruleId":"D2","level":"warning","message":{"text":"caddytls.ParseCaddyfilePreferredChainsOptions (cognitive 27): caddytls.ParseCaddyfilePreferredChainsOptions has cognitive complexity 27 (threshold 15). Drivers by points: if/else 23, match/switch 2, boolean chains 1, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddytls/acmeissuer.go"},"region":{"startLine":699}}}],"partialFingerprints":{"codehealthFindingId/v1":"f63793942c87c4e26c70e65cbfe9ac3a60b4de7a573c5caf551036ad7cd28dcd"}},{"ruleId":"D2","level":"warning","message":{"text":"AutomationPolicy.Provision (cognitive 27): AutomationPolicy.Provision has cognitive complexity 27 (threshold 15). Drivers by points: if/else 20, loops 6, boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddytls/automation.go"},"region":{"startLine":182}}}],"partialFingerprints":{"codehealthFindingId/v1":"fa39fb16d46d0e8973521aced2cf087832fb5a5d84daf919b0810166432f0628"}},{"ruleId":"D2","level":"warning","message":{"text":"TLSConfig.unmarshalCaddyfile (cognitive 27): TLSConfig.unmarshalCaddyfile has cognitive complexity 27 (threshold 15). Drivers by points: if/else 21, match/switch 5, 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":"modules/caddytls/capools.go"},"region":{"startLine":539}}}],"partialFingerprints":{"codehealthFindingId/v1":"ed95ceb95ba46d74dabf7f5cdad6a51378e5abe3599bb5fa99845992f91e2035"}},{"ruleId":"D2","level":"warning","message":{"text":"TLS.Cleanup (cognitive 27): TLS.Cleanup has cognitive complexity 27 (threshold 15). Drivers by points: if/else 20, loops 4, 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":"modules/caddytls/tls.go"},"region":{"startLine":478}}}],"partialFingerprints":{"codehealthFindingId/v1":"257b6a81472096cbdac7dcee1074bd1beb1bac7dd7e9833de5fd26e0d2f01d0a"}},{"ruleId":"D2","level":"warning","message":{"text":"parser.directive (cognitive 26): parser.directive has cognitive complexity 26 (threshold 15). Drivers by points: if/else 20, boolean chains 5, 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":"caddyconfig/caddyfile/parse.go"},"region":{"startLine":636}}}],"partialFingerprints":{"codehealthFindingId/v1":"40ee03a8a0088eba759716962cd73c735107eefba67a46f60f6df5184fe70689"}},{"ruleId":"D2","level":"warning","message":{"text":"caddyhttp.CELValueToMapStrList (cognitive 26): caddyhttp.CELValueToMapStrList has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11, loops 9, match/switch 6 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/celmatcher.go"},"region":{"startLine":669}}}],"partialFingerprints":{"codehealthFindingId/v1":"14dce564be682a6f873f59f1e30591efda53fb6806732d60d45177b175e91715"}},{"ruleId":"D2","level":"warning","message":{"text":"Transport.buildEnv (cognitive 26): Transport.buildEnv has cognitive complexity 26 (threshold 15). Drivers by points: if/else 21, loops 4, boolean chains 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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":"modules/caddyhttp/reverseproxy/fastcgi/fastcgi.go"},"region":{"startLine":257}}}],"partialFingerprints":{"codehealthFindingId/v1":"33f1f50fe1dcede49c547a7d659e7efc86c59f48d7402af590e1bb8775f4af97"}},{"ruleId":"D2","level":"warning","message":{"text":"Transport.splitPos (cognitive 26): Transport.splitPos has cognitive complexity 26 (threshold 15). Drivers by points: if/else 18, loops 6, 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":"modules/caddyhttp/reverseproxy/fastcgi/fastcgi.go"},"region":{"startLine":433}}}],"partialFingerprints":{"codehealthFindingId/v1":"01752be2c68412f4e345d1450ac8bd95726ecf858a68fb8a893660b1a9b064a9"}},{"ruleId":"D2","level":"warning","message":{"text":"Handler.ServeHTTP (cognitive 26): Handler.ServeHTTP has cognitive complexity 26 (threshold 15). Drivers by points: if/else 21, 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":"modules/caddyhttp/reverseproxy/reverseproxy.go"},"region":{"startLine":485}}}],"partialFingerprints":{"codehealthFindingId/v1":"186db704707c5bb0c64a4279dbd118092a1e1f54da01abc883aaeb038ec46543"}},{"ruleId":"D2","level":"warning","message":{"text":"httpcaddyfile.parseSegmentAsConfig (cognitive 25): httpcaddyfile.parseSegmentAsConfig has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15, loops 10 (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":"caddyconfig/httpcaddyfile/directives.go"},"region":{"startLine":356}}}],"partialFingerprints":{"codehealthFindingId/v1":"76b6a3c8f020db4d017fca1e519cd32e5e7d504d6c0a55b3828f9ddab4caa311"}},{"ruleId":"D2","level":"warning","message":{"text":"Intercept.ServeHTTP (cognitive 25): Intercept.ServeHTTP has cognitive complexity 25 (threshold 15). Drivers by points: if/else 20, boolean chains 3, loops 2 (nesting depth added 6). Of this number, 15 points are the body\u0027s own statements and 10 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/intercept/intercept.go"},"region":{"startLine":115}}}],"partialFingerprints":{"codehealthFindingId/v1":"7ab12fe1c77bb1645e0c7743259f31f8bf7adb2c4821278f4c67647f5ef0669c"}},{"ruleId":"D2","level":"warning","message":{"text":"push.parseCaddyfile (cognitive 25): push.parseCaddyfile has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15, match/switch 6, loops 4 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/push/caddyfile.go"},"region":{"startLine":46}}}],"partialFingerprints":{"codehealthFindingId/v1":"210e334bbdb936532f23d1f0846a2714c426baecd717c9ec7c480fa4ae2c9e99"}},{"ruleId":"D2","level":"warning","message":{"text":"Handler.prepareRequest (cognitive 25): Handler.prepareRequest has cognitive complexity 25 (threshold 15). Drivers by points: if/else 18, boolean chains 6, loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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":"modules/caddyhttp/reverseproxy/reverseproxy.go"},"region":{"startLine":763}}}],"partialFingerprints":{"codehealthFindingId/v1":"35e81ee38b46238c7989b795137503822450df98886b4b469357cb17dfc86ef0"}},{"ruleId":"D2","level":"warning","message":{"text":"AppendEncoder.UnmarshalCaddyfile (cognitive 25): AppendEncoder.UnmarshalCaddyfile has cognitive complexity 25 (threshold 15). Drivers by points: if/else 19, loops 4, match/switch 2 (nesting depth added 14). 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":"modules/logging/appendencoder.go"},"region":{"startLine":130}}}],"partialFingerprints":{"codehealthFindingId/v1":"5ae0b51a0db59b481f8cc155305f52aca2f388d2614ba7310ccb89aae3473bdf"}},{"ruleId":"D2","level":"warning","message":{"text":"requestbody.parseCaddyfile (cognitive 24): requestbody.parseCaddyfile has cognitive complexity 24 (threshold 15). Drivers by points: if/else 21, match/switch 2, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/requestbody/caddyfile.go"},"region":{"startLine":30}}}],"partialFingerprints":{"codehealthFindingId/v1":"f48c2e76baa8ae73030c720eac303786e251396524a48daaddcc31184c26ed40"}},{"ruleId":"D2","level":"warning","message":{"text":"SRVUpstreams.GetUpstreams (cognitive 24): SRVUpstreams.GetUpstreams has cognitive complexity 24 (threshold 15). Drivers by points: if/else 20, loops 3, boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/reverseproxy/upstreams.go"},"region":{"startLine":134}}}],"partialFingerprints":{"codehealthFindingId/v1":"607358a53b63ceac43c595158b2877fbc1fbf0d6cfc12001342665e5857d4ad0"}},{"ruleId":"D2","level":"warning","message":{"text":"HTTPCertPool.Provision (cognitive 24): HTTPCertPool.Provision has cognitive complexity 24 (threshold 15). Drivers by points: if/else 20, loops 3, boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddytls/capools.go"},"region":{"startLine":660}}}],"partialFingerprints":{"codehealthFindingId/v1":"c4cec76e530fad4090261fcb0915f352dadc5189b9cb97c267d4e67a42c2f9ff"}},{"ruleId":"D2","level":"warning","message":{"text":"TLS.HandleHTTPChallenge (cognitive 24): TLS.HandleHTTPChallenge has cognitive complexity 24 (threshold 15). Drivers by points: if/else 19, loops 4, boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddytls/tls.go"},"region":{"startLine":766}}}],"partialFingerprints":{"codehealthFindingId/v1":"055416bb32c2ab80614db8bd8eab5558d81661652849ced310e8f1e96b7700c8"}},{"ruleId":"D2","level":"warning","message":{"text":"IPMaskFilter.UnmarshalCaddyfile (cognitive 24): IPMaskFilter.UnmarshalCaddyfile has cognitive complexity 24 (threshold 15). Drivers by points: if/else 21, match/switch 2, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/logging/filters.go"},"region":{"startLine":171}}}],"partialFingerprints":{"codehealthFindingId/v1":"346a0756d090b585ea5b67e327d51719d333c6341fe851ece3f5902403fdd1d2"}},{"ruleId":"D2","level":"warning","message":{"text":"httpcaddyfile.applyServerOptions (cognitive 23): httpcaddyfile.applyServerOptions has cognitive complexity 23 (threshold 15). Drivers by points: if/else 19, loops 3, boolean chains 1 (nesting depth added 10). 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":"caddyconfig/httpcaddyfile/serveroptions.go"},"region":{"startLine":342}}}],"partialFingerprints":{"codehealthFindingId/v1":"7e2ec378a43cf5d0c3339a0e02b1e65828805d167edef489c7b146c22d2093ed"}},{"ruleId":"D2","level":"warning","message":{"text":"ServerType.buildPKIApp (cognitive 23): ServerType.buildPKIApp has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15, loops 7, 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":"caddyconfig/httpcaddyfile/pkiapp.go"},"region":{"startLine":197}}}],"partialFingerprints":{"codehealthFindingId/v1":"bb517a0e7b1874644161926376cd229ceed04ea68eef50d08cfc0b4a47ef5d8e"}},{"ruleId":"D2","level":"warning","message":{"text":"HTTPLoader.makeClient (cognitive 23): HTTPLoader.makeClient has cognitive complexity 23 (threshold 15). Drivers by points: if/else 19, loops 3, boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"caddyconfig/httploader.go"},"region":{"startLine":170}}}],"partialFingerprints":{"codehealthFindingId/v1":"a7efbbafb42fa672718473c806e47ae9de2febaa502a5afc117471dc7238c5de"}},{"ruleId":"D2","level":"warning","message":{"text":"caddycmd.cmdImportStorage (cognitive 23): caddycmd.cmdImportStorage has cognitive complexity 23 (threshold 15). Drivers by points: if/else 21, 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":"cmd/storagefuncs.go"},"region":{"startLine":64}}}],"partialFingerprints":{"codehealthFindingId/v1":"97bae52d4d257853d5f6b6363317c478f08c005015d1bf1e7ed7c8ae1f7d5129"}},{"ruleId":"D2","level":"warning","message":{"text":"ConnectionPolicies.Provision (cognitive 23): ConnectionPolicies.Provision has cognitive complexity 23 (threshold 15). Drivers by points: if/else 16, loops 6, 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":"modules/caddytls/connpolicy.go"},"region":{"startLine":52}}}],"partialFingerprints":{"codehealthFindingId/v1":"8c1943f12fbc01bc3ff6c0ad8cdca28d0dee398071e78dfc003db88f9c508d82"}},{"ruleId":"D2","level":"warning","message":{"text":"caddy.indexConfigObjects (cognitive 22): caddy.indexConfigObjects has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13, match/switch 5, loops 4 (nesting depth added 14). The drivers above price the dispatch low by construction \u2014 a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full \u2014 so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"caddy.go"},"region":{"startLine":290}}}],"partialFingerprints":{"codehealthFindingId/v1":"ade1f52f5a42886b8ce1e5022a967242060815441a78a75c61dc7c7d350915c5"}},{"ruleId":"D2","level":"warning","message":{"text":"App.Validate (cognitive 22): App.Validate has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13, loops 9 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/app.go"},"region":{"startLine":411}}}],"partialFingerprints":{"codehealthFindingId/v1":"a20a79d02b6e5e75d5e66bb859cb0c286a54863bfcd761eb378e5373d0c37d26"}},{"ruleId":"D2","level":"warning","message":{"text":"MatchFile.UnmarshalCaddyfile (cognitive 22): MatchFile.UnmarshalCaddyfile has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16, loops 3, match/switch 3 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/fileserver/matcher.go"},"region":{"startLine":132}}}],"partialFingerprints":{"codehealthFindingId/v1":"b4f8097cdf88940afc9c2da20c8039e570707b25911778ae1f0f1295b4aab34b"}},{"ruleId":"D2","level":"warning","message":{"text":"headers.applyHeaderOp (cognitive 22): headers.applyHeaderOp has cognitive complexity 22 (threshold 15). Drivers by points: if/else 20, boolean chains 1, 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":"modules/caddyhttp/headers/caddyfile.go"},"region":{"startLine":225}}}],"partialFingerprints":{"codehealthFindingId/v1":"aa650594e05cb0732b22bf15ac7a823c7944de8d3e5a07115df588aabd9496f6"}},{"ruleId":"D2","level":"warning","message":{"text":"rewrite.buildQueryString (cognitive 22): rewrite.buildQueryString has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13, boolean chains 6, match/switch 2, loops 1 (nesting depth added 7). Of this number, 17 points are the body\u0027s own statements and 5 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/rewrite/rewrite.go"},"region":{"startLine":336}}}],"partialFingerprints":{"codehealthFindingId/v1":"e95ec30576f9060a36798fc6e79d8ccbd6de4714109c82dfc73db8bee14348c1"}},{"ruleId":"D2","level":"warning","message":{"text":"TLS.Manage (cognitive 22): TLS.Manage has cognitive complexity 22 (threshold 15). Drivers by points: if/else 17, loops 4, boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddytls/tls.go"},"region":{"startLine":561}}}],"partialFingerprints":{"codehealthFindingId/v1":"f1abed9d3fa54ca97a7b0b695ee079f7b7dffd2e1d32cc19c7d35e0d2fe0321b"}},{"ruleId":"D2","level":"warning","message":{"text":"caddycmd.cmdFmt (cognitive 21): caddycmd.cmdFmt has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13, boolean chains 3, match/switch 3, loops 2 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/commandfuncs.go"},"region":{"startLine":685}}}],"partialFingerprints":{"codehealthFindingId/v1":"a6396fec40ef91001bfd77e4e17a38be32f750f7a4009039b18821deacebdd5c"}},{"ruleId":"D2","level":"warning","message":{"text":"caddyhttp.CELMatcherDecorator (cognitive 21): caddyhttp.CELMatcherDecorator has cognitive complexity 21 (threshold 15). Drivers by points: if/else 19, boolean chains 2 (nesting depth added 6). Most of this is not in the body itself: 0 of the 21 points are its own statements and the rest belongs to one function literal inside it that branches (line 470). 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":"modules/caddyhttp/celmatcher.go"},"region":{"startLine":469}}}],"partialFingerprints":{"codehealthFindingId/v1":"09bb2396e1312d2c6fcead63acaa9d324756478d9b91c70f27ac1a61296d06ce"}},{"ruleId":"D2","level":"warning","message":{"text":"Zstd.UnmarshalCaddyfile (cognitive 21): Zstd.UnmarshalCaddyfile has cognitive complexity 21 (threshold 15). Drivers by points: if/else 17, match/switch 3, 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":"modules/caddyhttp/encode/zstd/zstd.go"},"region":{"startLine":53}}}],"partialFingerprints":{"codehealthFindingId/v1":"880abdd0c14d318d54d1a674fd7ee12732cbf030b3b5edb69e527a54f0e9186e"}},{"ruleId":"D2","level":"warning","message":{"text":"fileserver.parseTryFiles (cognitive 21): fileserver.parseTryFiles has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14, match/switch 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":"modules/caddyhttp/fileserver/caddyfile.go"},"region":{"startLine":259}}}],"partialFingerprints":{"codehealthFindingId/v1":"533a5bcb2ed3c5ecc7c7c5119051baedce743de8e60d0fcbe23d0a024c5db698"}},{"ruleId":"D2","level":"warning","message":{"text":"fileserver.fileHidden (cognitive 21): fileserver.fileHidden has cognitive complexity 21 (threshold 15). Drivers by points: if/else 17, loops 4 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/fileserver/staticfiles.go"},"region":{"startLine":684}}}],"partialFingerprints":{"codehealthFindingId/v1":"293d9cba16f6ede4cb813610d1c585df8451ecceb387bda3875ba61df384f417"}},{"ruleId":"D2","level":"warning","message":{"text":"ActiveHealthChecks.Provision (cognitive 21): ActiveHealthChecks.Provision has cognitive complexity 21 (threshold 15). Drivers by points: if/else 17, loops 4 (nesting depth added 4). 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: 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":"modules/caddyhttp/reverseproxy/healthchecks.go"},"region":{"startLine":137}}}],"partialFingerprints":{"codehealthFindingId/v1":"0e4f01f04977f15cf554ef9cae3f5b9e7ef0533896bc30f0bc158d78341196c4"}},{"ruleId":"D2","level":"warning","message":{"text":"StoragePool.Provision (cognitive 21): StoragePool.Provision has cognitive complexity 21 (threshold 15). Drivers by points: if/else 18, 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":"modules/caddytls/capools.go"},"region":{"startLine":406}}}],"partialFingerprints":{"codehealthFindingId/v1":"4213741007853ed0a4a0387c218d1b868bb3fa126f156a1050252228d17d874b"}},{"ruleId":"D2","level":"warning","message":{"text":"TLS.cleanStorageUnits (cognitive 21): TLS.cleanStorageUnits has cognitive complexity 21 (threshold 15). Drivers by points: if/else 18, loops 2, boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddytls/tls.go"},"region":{"startLine":930}}}],"partialFingerprints":{"codehealthFindingId/v1":"5adc12695a060e366244363727dad1aeb2934ae15348c306af8b486942d3c2d9"}},{"ruleId":"D2","level":"warning","message":{"text":"ServerType.extractNamedRoutes (cognitive 20): ServerType.extractNamedRoutes has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13, loops 6, boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"caddyconfig/httpcaddyfile/httptype.go"},"region":{"startLine":460}}}],"partialFingerprints":{"codehealthFindingId/v1":"8520a1f3af2f7464f1d0f2c5fe22eabc35f417d3da2d8c198d89c15305c2f7c4"}},{"ruleId":"D2","level":"warning","message":{"text":"caddycmd.cmdStart (cognitive 20): caddycmd.cmdStart has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17, loops 2, match/switch 1 (nesting depth added 4). 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":"cmd/commandfuncs.go"},"region":{"startLine":45}}}],"partialFingerprints":{"codehealthFindingId/v1":"baa42be9ce74fd84c23b236bc2c1853c3d5ca00e261ee47557bfc102e2af6084"}},{"ruleId":"D2","level":"warning","message":{"text":"caddycmd.cmdAdaptConfig (cognitive 20): caddycmd.cmdAdaptConfig has cognitive complexity 20 (threshold 15). Drivers by points: if/else 19, 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, 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":"cmd/commandfuncs.go"},"region":{"startLine":552}}}],"partialFingerprints":{"codehealthFindingId/v1":"bb9d328a66d35d12954ec60cb3c1e8e34f5467be6b02eb1424caa91c9a70805f"}},{"ruleId":"D2","level":"warning","message":{"text":"NetworkAddress.listen (cognitive 20): NetworkAddress.listen has cognitive complexity 20 (threshold 15). Drivers by points: if/else 19, 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":"listeners.go"},"region":{"startLine":150}}}],"partialFingerprints":{"codehealthFindingId/v1":"515adc113304383c16889289f6348da3e58c770d48eb53840ece45826ea92cbf"}},{"ruleId":"D2","level":"warning","message":{"text":"Logging.Logger (cognitive 20): Logging.Logger has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17, loops 2, boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"logging.go"},"region":{"startLine":219}}}],"partialFingerprints":{"codehealthFindingId/v1":"f000cea751ab7870658df776548eb74c9ad88653d66cf51b926e3d58720a357f"}},{"ruleId":"D2","level":"warning","message":{"text":"TLS.Validate (cognitive 20): TLS.Validate has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15, loops 5 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddytls/tls.go"},"region":{"startLine":369}}}],"partialFingerprints":{"codehealthFindingId/v1":"c44b5299e88f3b54d3f6d39df068e497607eb97bd59f3e736db856ade2765c46"}},{"ruleId":"D2","level":"warning","message":{"text":"caddy.provisionContext (cognitive 19): caddy.provisionContext has cognitive complexity 19 (threshold 15). Drivers by points: if/else 18, loops 1 (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 3 function literals inside it that branch (lines 540, 505, 573). 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":"caddy.go"},"region":{"startLine":484}}}],"partialFingerprints":{"codehealthFindingId/v1":"7b1bf3f89e90ebda308ff127d2f979e49997980496b6eec94eb6221afb80b586"}},{"ruleId":"D2","level":"warning","message":{"text":"httpcaddyfile.newBaseAutomationPolicy (cognitive 19): httpcaddyfile.newBaseAutomationPolicy has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13, boolean chains 4, loops 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"caddyconfig/httpcaddyfile/tlsapp.go"},"region":{"startLine":903}}}],"partialFingerprints":{"codehealthFindingId/v1":"a1cbdfcbd987eaf3b6b687a4a9ca07b3f86a200293b59696ebc39d8d3cc7ad5f"}},{"ruleId":"D2","level":"warning","message":{"text":"caddycmd.getModules (cognitive 19): caddycmd.getModules has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15, 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":"cmd/packagesfuncs.go"},"region":{"startLine":216}}}],"partialFingerprints":{"codehealthFindingId/v1":"ae6cfdc0b95d3fa33df3ffcb78a29f5eade55282cef653fced5193089ecd45f5"}},{"ruleId":"D2","level":"warning","message":{"text":"CustomLog.provision (cognitive 19): CustomLog.provision has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9, loops 7, boolean chains 2, jumps 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":"logging.go"},"region":{"startLine":490}}}],"partialFingerprints":{"codehealthFindingId/v1":"dea7e308682ff3bf15647ced81f3747c0998eb7a1356fda231f87508c2b6376a"}},{"ruleId":"D2","level":"warning","message":{"text":"Intercept.FinalizeUnmarshalCaddyfile (cognitive 19): Intercept.FinalizeUnmarshalCaddyfile has cognitive complexity 19 (threshold 15). Drivers by points: if/else 17, loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/intercept/intercept.go"},"region":{"startLine":300}}}],"partialFingerprints":{"codehealthFindingId/v1":"3f0962b1ead1ad610d14d28f36c3cb334faa67e67d86acdcb1578819c79db6c5"}},{"ruleId":"D2","level":"warning","message":{"text":"Handler.FinalizeUnmarshalCaddyfile (cognitive 19): Handler.FinalizeUnmarshalCaddyfile has cognitive complexity 19 (threshold 15). Drivers by points: if/else 17, loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/reverseproxy/caddyfile.go"},"region":{"startLine":920}}}],"partialFingerprints":{"codehealthFindingId/v1":"d460de54c4e97c8daac40f7bc59f1e1196d8040260561f0349f7ac856cdc3bc8"}},{"ruleId":"D2","level":"warning","message":{"text":"StaticResponse.UnmarshalCaddyfile (cognitive 19): StaticResponse.UnmarshalCaddyfile has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14, match/switch 3, boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/staticresp.go"},"region":{"startLine":141}}}],"partialFingerprints":{"codehealthFindingId/v1":"7d11fca8a47f6c151b4d72b5dba88906cf5c082cc72a06c852bcf224337957dc"}},{"ruleId":"D2","level":"warning","message":{"text":"templates.extractFrontMatter (cognitive 19): templates.extractFrontMatter has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15, 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":"modules/caddyhttp/templates/frontmatter.go"},"region":{"startLine":13}}}],"partialFingerprints":{"codehealthFindingId/v1":"69ccaf874bbf59c2dff0961c41b6ca221a069d2893ea8ced57dfb8246dbe6ce1"}},{"ruleId":"D2","level":"warning","message":{"text":"caddytls.loadECHConfig (cognitive 19): caddytls.loadECHConfig has cognitive complexity 19 (threshold 15). Drivers by points: if/else 19 (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":"modules/caddytls/ech.go"},"region":{"startLine":529}}}],"partialFingerprints":{"codehealthFindingId/v1":"b20d0cf589d407caaa26a0426b3f6e31c83d09154425e272107f7b451ef5d007"}},{"ruleId":"D2","level":"warning","message":{"text":"ACMEIssuer.makeIssuerTemplate (cognitive 19): ACMEIssuer.makeIssuerTemplate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 19 (nesting depth added 7). Of this number, 17 points are the body\u0027s own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddytls/acmeissuer.go"},"region":{"startLine":254}}}],"partialFingerprints":{"codehealthFindingId/v1":"9e43ca911912a6cee788fa074158d5745a1fbb3fba625a752afe084044eddd21"}},{"ruleId":"D2","level":"warning","message":{"text":"MultiRegexpFilter.UnmarshalCaddyfile (cognitive 19): MultiRegexpFilter.UnmarshalCaddyfile has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, match/switch 2, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/logging/filters.go"},"region":{"startLine":683}}}],"partialFingerprints":{"codehealthFindingId/v1":"634ef29ccd3b5b957a82e6e8b9cba0b5c21d238c7c3a9f3982048af366ea4bd9"}},{"ruleId":"D2","level":"warning","message":{"text":"caddy.replaceRemoteAdminServer (cognitive 18): caddy.replaceRemoteAdminServer has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14, loops 3, boolean chains 1 (nesting depth added 4). Of this number, 14 points are the body\u0027s own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body: 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":"admin.go"},"region":{"startLine":510}}}],"partialFingerprints":{"codehealthFindingId/v1":"7cad2b498191244dfd8fc2a9ff2d9d29765aea17a4ae33c6e6763049d66d75ed"}},{"ruleId":"D2","level":"warning","message":{"text":"caddycmd.DetermineAdminAPIAddress (cognitive 18): caddycmd.DetermineAdminAPIAddress has cognitive complexity 18 (threshold 15). Drivers by points: if/else 18 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/commandfuncs.go"},"region":{"startLine":862}}}],"partialFingerprints":{"codehealthFindingId/v1":"c12ae0d23655baa6b7586d28dc4c96c3405afb300636190a22f82f3a47fdc234"}},{"ruleId":"D2","level":"warning","message":{"text":"caddycmd.upgradeBuild (cognitive 18): caddycmd.upgradeBuild has cognitive complexity 18 (threshold 15). Drivers by points: if/else 17, loops 1 (nesting depth added 3). Of this number, 15 points are the body\u0027s own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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":"cmd/packagesfuncs.go"},"region":{"startLine":124}}}],"partialFingerprints":{"codehealthFindingId/v1":"3882720b298683027a0d6f536b6c07d9d1a8094df529d8f92ee9cf0eafe1e08f"}},{"ruleId":"D2","level":"warning","message":{"text":"BaseLog.provisionCommon (cognitive 18): BaseLog.provisionCommon has cognitive complexity 18 (threshold 15). Drivers by points: if/else 18 (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":"logging.go"},"region":{"startLine":342}}}],"partialFingerprints":{"codehealthFindingId/v1":"eabe8e55f5642d7946b736da253a1ce1f7b3fa92c12334a4351e308c8daa8b74"}},{"ruleId":"D2","level":"warning","message":{"text":"caddyhttp.ParseCaddyfileNestedMatcherSet (cognitive 18): caddyhttp.ParseCaddyfileNestedMatcherSet has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14, loops 3, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/matchers.go"},"region":{"startLine":1678}}}],"partialFingerprints":{"codehealthFindingId/v1":"2fd9912b5260d183bd99b39b7a75d0e7b63d9ab20ec6173b8921ade5df0b82bb"}},{"ruleId":"D2","level":"warning","message":{"text":"browseTemplateContext.applySortAndLimit (cognitive 18): browseTemplateContext.applySortAndLimit has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9, match/switch 4, boolean chains 3, loops 2 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/fileserver/browsetplcontext.go"},"region":{"startLine":228}}}],"partialFingerprints":{"codehealthFindingId/v1":"d929bd63fdac43403d3f24b0ec757adb401754022d812f22fe682b3b55e79335"}},{"ruleId":"D2","level":"warning","message":{"text":"MatchHeader.UnmarshalCaddyfile (cognitive 18): MatchHeader.UnmarshalCaddyfile has cognitive complexity 18 (threshold 15). Drivers by points: if/else 17, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/matchers.go"},"region":{"startLine":1057}}}],"partialFingerprints":{"codehealthFindingId/v1":"07df8e9521de94cbc12350b0f2b04eb526ecefb502291a40da4c4f1e04f25cde"}},{"ruleId":"D2","level":"warning","message":{"text":"echConfig.UnmarshalBinary (cognitive 18): echConfig.UnmarshalBinary has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, 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":"modules/caddytls/ech.go"},"region":{"startLine":968}}}],"partialFingerprints":{"codehealthFindingId/v1":"963cbf8a17c80f354b372cd33e7b6e23173053c1fc61009f7f01c9d83397496c"}},{"ruleId":"D2","level":"warning","message":{"text":"MatchRemoteIP.UnmarshalCaddyfile (cognitive 18): MatchRemoteIP.UnmarshalCaddyfile has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14, loops 3, boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddytls/matchers.go"},"region":{"startLine":401}}}],"partialFingerprints":{"codehealthFindingId/v1":"5383c81a039f705682e4ae2cedc6de82049729d14168459436b95f6eb2654cd0"}},{"ruleId":"D2","level":"warning","message":{"text":"caddy.exitProcess (cognitive 17): caddy.exitProcess has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15, loops 2 (nesting depth added 3). Of this number, 9 points are the body\u0027s own statements and 8 belong to one function literal inside it that branches. To reduce it, split the body: 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":"caddy.go"},"region":{"startLine":760}}}],"partialFingerprints":{"codehealthFindingId/v1":"2f84e72e52edc2d550c12391393613ace2be82d5acdc9e0520f69e20db31636a"}},{"ruleId":"D2","level":"warning","message":{"text":"httpcaddyfile.parseMatcherDefinitions (cognitive 17): httpcaddyfile.parseMatcherDefinitions has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, loops 2, boolean chains 1 (nesting depth added 4). Of this number, 12 points are the body\u0027s own statements and 5 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"caddyconfig/httpcaddyfile/httptype.go"},"region":{"startLine":1564}}}],"partialFingerprints":{"codehealthFindingId/v1":"d13fb2070b4945e8864f8266941ded3c5a29f7f8434cfef05b699801f6e07540"}},{"ruleId":"D2","level":"warning","message":{"text":"Tester.initServer (cognitive 17): Tester.initServer has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, boolean chains 1 (nesting depth added 3). Of this number, 13 points are the body\u0027s own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body: 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":"caddytest/caddytest.go"},"region":{"startLine":131}}}],"partialFingerprints":{"codehealthFindingId/v1":"b820957f99233850648dfbf5e53e194fda99777d4e40b78daa26600d656ddc16"}},{"ruleId":"D2","level":"warning","message":{"text":"HTTPBasicAuth.Provision (cognitive 17): HTTPBasicAuth.Provision has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15, boolean chains 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/caddyauth/basicauth.go"},"region":{"startLine":79}}}],"partialFingerprints":{"codehealthFindingId/v1":"e295260ab4d65f7a4013f84e6e09fd2212c5c90d74fe72a49328ece72700ed78"}},{"ruleId":"D2","level":"warning","message":{"text":"fileserver.isCELTryFilesLiteral (cognitive 17): fileserver.isCELTryFilesLiteral has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, match/switch 4, loops 2 (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":"modules/caddyhttp/fileserver/matcher.go"},"region":{"startLine":608}}}],"partialFingerprints":{"codehealthFindingId/v1":"3b0656c12423325c6a4a9e9dbf651bf8e8727a55b84a583310c652708fbb22e5"}},{"ruleId":"D2","level":"warning","message":{"text":"FolderLoader.LoadCertificates (cognitive 17): FolderLoader.LoadCertificates has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, loops 1 (nesting depth added 8). Most of this is not in the body itself: 5 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 70). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal\u0027s work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddytls/folderloader.go"},"region":{"startLine":63}}}],"partialFingerprints":{"codehealthFindingId/v1":"10e90119f56de68900f6843514da88241ded2c4565f63a1ca803681a4a4688d1"}},{"ruleId":"D2","level":"warning","message":{"text":"NetWriter.UnmarshalCaddyfile (cognitive 17): NetWriter.UnmarshalCaddyfile has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, match/switch 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/logging/netwriter.go"},"region":{"startLine":119}}}],"partialFingerprints":{"codehealthFindingId/v1":"bd6f81dc94b64ae0a8c1eee6c970b7e403d69c6951465ea61784835237811837"}},{"ruleId":"D2","level":"warning","message":{"text":"caddy.handleConfig (cognitive 16): caddy.handleConfig has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, boolean chains 1, match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction \u2014 a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full \u2014 so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"admin.go"},"region":{"startLine":1006}}}],"partialFingerprints":{"codehealthFindingId/v1":"a79f5e7ea118ca7b3312265f07ffa5ac0d51fce349ff585109539de127b7196e"}},{"ruleId":"D2","level":"warning","message":{"text":"caddy.run (cognitive 16): caddy.run has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, loops 4 (nesting depth added 7). 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 444, 430). 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":"caddy.go"},"region":{"startLine":419}}}],"partialFingerprints":{"codehealthFindingId/v1":"8437ee674055f92567866a7968a1ac082a1d22137ba2fd0a998c9b1d0e0e1a2c"}},{"ruleId":"D2","level":"warning","message":{"text":"caddy.ParseNetworkAddressWithDefaults (cognitive 16): caddy.ParseNetworkAddressWithDefaults has cognitive complexity 16 (threshold 15). Drivers by points: if/else 16 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"listeners.go"},"region":{"startLine":322}}}],"partialFingerprints":{"codehealthFindingId/v1":"0f4a067a6ee6ba5f4f071dc89785ab209cbb88635173a44a8804424bc3fbbe39"}},{"ruleId":"D2","level":"warning","message":{"text":"caddyfile.makeArgsReplacer (cognitive 16): caddyfile.makeArgsReplacer has cognitive complexity 16 (threshold 15). Drivers by points: if/else 16 (nesting depth added 7). Most of this is not in the body itself: 0 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 100). 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":"caddyconfig/caddyfile/importargs.go"},"region":{"startLine":98}}}],"partialFingerprints":{"codehealthFindingId/v1":"434dde4a370d36c57d8723f94cce9cb8ee275f23507c3d093acbabc1273b61d3"}},{"ruleId":"D2","level":"warning","message":{"text":"httpcaddyfile.sortRoutes (cognitive 16): httpcaddyfile.sortRoutes has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, boolean chains 2, loops 1 (nesting depth added 2). 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 452). 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":"caddyconfig/httpcaddyfile/directives.go"},"region":{"startLine":446}}}],"partialFingerprints":{"codehealthFindingId/v1":"ed9c2729051e2ce809012ffebc01ec7f04930251a2b030ed568197c6e22613a8"}},{"ruleId":"D2","level":"warning","message":{"text":"ListenerWrapper.Provision (cognitive 16): ListenerWrapper.Provision has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, loops 4, boolean chains 1 (nesting depth added 4). Most of this is not in the body itself: 6 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 105). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal\u0027s work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/proxyprotocol/listenerwrapper.go"},"region":{"startLine":89}}}],"partialFingerprints":{"codehealthFindingId/v1":"7adb72aa7f28f218561f99da241c06837a6fc87ac32d2f9d5e0eeb190ec960d8"}},{"ruleId":"D2","level":"warning","message":{"text":"ListenerWrapper.UnmarshalCaddyfile (cognitive 16): ListenerWrapper.UnmarshalCaddyfile has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, match/switch 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/proxyprotocol/module.go"},"region":{"startLine":41}}}],"partialFingerprints":{"codehealthFindingId/v1":"b4b97f7e8b476208149fa8e7de382a9263975f386e8871f24801aca0f6a27d91"}},{"ruleId":"D2","level":"warning","message":{"text":"CookieHashSelection.Select (cognitive 16): CookieHashSelection.Select has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, boolean chains 5, loops 1 (nesting depth added 2). Of this number, 8 points are the body\u0027s own statements and 8 belong to one function literal inside it that branches. To reduce it, split the body: 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":"modules/caddyhttp/reverseproxy/selectionpolicies.go"},"region":{"startLine":678}}}],"partialFingerprints":{"codehealthFindingId/v1":"27e8d240ac50bedd5fdceae2cee6c1d6f969c1ac796a3763803104727c7be3ea"}},{"ruleId":"D2","level":"warning","message":{"text":"MatcherSet.MatchWithError (cognitive 16): MatcherSet.MatchWithError has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, 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":"modules/caddyhttp/routes.go"},"region":{"startLine":371}}}],"partialFingerprints":{"codehealthFindingId/v1":"06f18dd8c8036f3ec33938c553155e45f19d99699ca120f2c125ce5c4243cb82"}},{"ruleId":"D2","level":"warning","message":{"text":"Server.provisionUnderscoreHeaders (cognitive 16): Server.provisionUnderscoreHeaders has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, loops 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/server.go"},"region":{"startLine":334}}}],"partialFingerprints":{"codehealthFindingId/v1":"933d1cd13eb796d0792ba8f1e378af28f812810b4220149eb9acb8b53526a0c2"}},{"ruleId":"D2","level":"warning","message":{"text":"StaticError.UnmarshalCaddyfile (cognitive 16): StaticError.UnmarshalCaddyfile has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, match/switch 3, 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":"modules/caddyhttp/staticerror.go"},"region":{"startLine":62}}}],"partialFingerprints":{"codehealthFindingId/v1":"adddbd7c0455ab90d446ac4cf38ffc4d04157956af3f5493618f3adbd696bc5f"}},{"ruleId":"D2","level":"warning","message":{"text":"TemplateContext.funcMaybe (cognitive 16): TemplateContext.funcMaybe has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, loops 4, match/switch 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/templates/tplcontext.go"},"region":{"startLine":517}}}],"partialFingerprints":{"codehealthFindingId/v1":"920943ddd221e169d8035af70f578ffe247895543470f31ea4acb7c6ea5a58b9"}},{"ruleId":"D2","level":"warning","message":{"text":"MatchURLPattern.UnmarshalCaddyfile (cognitive 16): MatchURLPattern.UnmarshalCaddyfile has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, loops 3, match/switch 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/urlpatternmatcher.go"},"region":{"startLine":181}}}],"partialFingerprints":{"codehealthFindingId/v1":"7a5b365972b900b4b7bb5e99645cce8da3635c02cc3543c6ba638c09353a69e4"}},{"ruleId":"D2","level":"warning","message":{"text":"CA.loadOrGenRoot (cognitive 16): CA.loadOrGenRoot has cognitive complexity 16 (threshold 15). Drivers by points: if/else 16 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddypki/ca.go"},"region":{"startLine":277}}}],"partialFingerprints":{"codehealthFindingId/v1":"cde7d6e2bcbb72ddbb8df7bb32687750e71d4f956faa308bf5bf7e0a223f8aa9"}},{"ruleId":"D2","level":"warning","message":{"text":"KeyPair.Load (cognitive 16): KeyPair.Load has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, 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":"modules/caddypki/crypto.go"},"region":{"startLine":91}}}],"partialFingerprints":{"codehealthFindingId/v1":"8b607930aa6b5868ecf6354c1ff77fb737eea2c0b7755f740e62f133e20d4e41"}},{"ruleId":"D2","level":"warning","message":{"text":"ClientAuthentication.ConfigureTLSConfig (cognitive 16): ClientAuthentication.ConfigureTLSConfig has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, loops 2, match/switch 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":"modules/caddytls/connpolicy.go"},"region":{"startLine":834}}}],"partialFingerprints":{"codehealthFindingId/v1":"bdd821e7b394e4f91e2242e099b17d866423dd83cee21c4d7f008d965aa8b3af"}},{"ruleId":"D2","level":"warning","message":{"text":"ECH.Provision (cognitive 16): ECH.Provision has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, loops 4, boolean chains 1 (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":"modules/caddytls/ech.go"},"region":{"startLine":80}}}],"partialFingerprints":{"codehealthFindingId/v1":"d05a4a267369fa640face7bb6fc41fe8ee43f3b3cf2fc549ed7d8af9128e6858"}},{"ruleId":"D2","level":"warning","message":{"text":"TLS.AddAutomationPolicy (cognitive 16): TLS.AddAutomationPolicy has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, loops 6, boolean chains 1, 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":"modules/caddytls/tls.go"},"region":{"startLine":815}}}],"partialFingerprints":{"codehealthFindingId/v1":"77ead2eb9bab7ff12b405b1ffcd1a76ba38f09eb4275780c729bfdf028f49202"}},{"ruleId":"D2","level":"warning","message":{"text":"FileStorage.UnmarshalCaddyfile (cognitive 16): FileStorage.UnmarshalCaddyfile has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, match/switch 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/filestorage/filestorage.go"},"region":{"startLine":48}}}],"partialFingerprints":{"codehealthFindingId/v1":"5bc878bf3df1c62cf80c5734b0fe9940f846faf729b8b5fc96311c69ebb13a96"}},{"ruleId":"D2","level":"warning","message":{"text":"LogEncoderConfig.ZapcoreEncoderConfig (cognitive 16): LogEncoderConfig.ZapcoreEncoderConfig has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, match/switch 5 (nesting depth added 2). Of this number, 13 points are the body\u0027s own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body: this score is breadth rather than depth \u2014 many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/logging/encoders.go"},"region":{"startLine":203}}}],"partialFingerprints":{"codehealthFindingId/v1":"b6f4a061c25e370c948e83e4e2e8e11803d422332d2849d1718e1a35a3530f2f"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: reverseproxy/caddyfile.go: FileTooLong \u2014 1018 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/reverseproxy/caddyfile.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"5ec9a9978ef428bb5293ac6a7dc12b22b88051eaaa58750d73020571c22a6ad9"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: httpcaddyfile/httptype.go: FileTooLong \u2014 955 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"caddyconfig/httpcaddyfile/httptype.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"291b173cc2e8105c4f3b4c1857b614943af7bba6e32463c2498f091f3b1974e3"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: caddyhttp/matchers.go: FileTooLong \u2014 865 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/matchers.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"d3ce1d7548fe78954e8791b6da1b7e24888de51511a5880d8bf34a9f4b0f8b10"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: reverseproxy/reverseproxy.go: FileTooLong \u2014 802 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/reverseproxy/reverseproxy.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"36320261d719a77204b2b20fbb9f4e765a4436d69bd10543a49607c745e9bbf8"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: ./admin.go: FileTooLong \u2014 750 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"admin.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"52c5c92f8a3d77964b0ea2c7dcb5d0fb0471ca6d37d0032dd56d6eef8068c685"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: httpcaddyfile/builtins.go: FileTooLong \u2014 698 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"caddyconfig/httpcaddyfile/builtins.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"de3479d7eed4c7165e7104d1b390a886fb78a19351680d145571f25c773d4a4e"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: ./caddy.go: FileTooLong \u2014 626 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"caddy.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"a04682fb1aa5b7c2c6877837359baa4a5c355e58019ffb4fdff1af9f17618d08"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: httpcaddyfile/tlsapp.go: FileTooLong \u2014 626 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"caddyconfig/httpcaddyfile/tlsapp.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"68c481046f8fca27f139488695d3c400781901a3f7317682d2d47cbb6aefc50a"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: caddytls/ech.go: FileTooLong \u2014 606 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddytls/ech.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"c33d1397a8a71e0fffb74e97aa98d309d17e7b39d895e92ac2583ea006559caa"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: caddyhttp/server.go: FileTooLong \u2014 591 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/server.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"5050b26e99c5b4ee0818fbad2359d2de58692ce1f5652ec72b132d1d6354169e"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: Dispenser: TooManyMethods \u2014 35 methods. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"caddyconfig/caddyfile/dispenser.go"},"region":{"startLine":29}}}],"partialFingerprints":{"codehealthFindingId/v1":"1ec225647c6aade62ae236b344cb808eab4dfc507cae3b1bad0675d225e0b393"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: caddytls/connpolicy.go: FileTooLong \u2014 573 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddytls/connpolicy.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"5ece30e85eb6dae650566ab5ea538e737e0880d9e5e6af5fe5a78f692759af8b"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: caddytls/capools.go: FileTooLong \u2014 552 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddytls/capools.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"13940f1712e81fa7784e19da9bf3f3b510424d8b6d7968421db1f8df28ef23c4"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: FilterEncoder: TooManyMethods \u2014 32 methods. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/logging/filterencoder.go"},"region":{"startLine":40}}}],"partialFingerprints":{"codehealthFindingId/v1":"7b6bf5a28ed06dc4581936c4fa38bfdd1a5e4dedf7515139902debf047adf6f9"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: cmd/commandfuncs.go: FileTooLong \u2014 524 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/commandfuncs.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"a3b5f8f2a6fe9134879124a964133dc1539031d94bd1f248ce8546913e5ebe67"}},{"ruleId":"D3","level":"warning","message":{"text":"TooManyMethods: AppendEncoder: TooManyMethods \u2014 31 methods. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/logging/appendencoder.go"},"region":{"startLine":44}}}],"partialFingerprints":{"codehealthFindingId/v1":"44e750c9b05a37eb4d2c8c629448f601fef130612c6726dbccc8da5be2f0bbbb"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: reverseproxy/selectionpolicies.go: FileTooLong \u2014 507 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/reverseproxy/selectionpolicies.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"c8e36cf1329f4420e08118fee7a7be12340bf8addc8ea9c39051acb6b0159509"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: caddytls/tls.go: FileTooLong \u2014 505 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddytls/tls.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"bf9b4f4cbbbeafa7cf38460c9db47ba82e851775ce068e73a86394760f4ac473"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (20 lines \u00D7 2): modules/caddyhttp/intercept/intercept.go:327-346 | modules/caddyhttp/reverseproxy/caddyfile.go:947-966 \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 \u0060modules/caddyhttp/intercept/intercept.go:327\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/intercept/intercept.go"},"region":{"startLine":327}}}],"partialFingerprints":{"codehealthFindingId/v1":"f4eb363cd1a78a1831465f2dbf3e01852c43539b60da9cfec1ec7fc37ddaf2cd"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (17 lines \u00D7 2): modules/caddyhttp/matchers.go:1210-1226 | modules/caddyhttp/vars.go:272-288 \u2014 the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060modules/caddyhttp/matchers.go:1210\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/matchers.go"},"region":{"startLine":1210}}}],"partialFingerprints":{"codehealthFindingId/v1":"74811b863081ffbb67e86f690ce935a9b3ca24090626327768429287658b6339"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (17 lines \u00D7 2): modules/caddytls/fileloader.go:88-104 | modules/caddytls/storageloader.go:84-100 \u2014 the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060modules/caddytls/fileloader.go:88\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddytls/fileloader.go"},"region":{"startLine":88}}}],"partialFingerprints":{"codehealthFindingId/v1":"8cbf73676c8e65f6eac09a6c04e135ff80687d57903aa1beb8c5e37b91d08830"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (17 lines \u00D7 2): modules/logging/appendencoder.go:167-183 | modules/logging/filterencoder.go:216-232 \u2014 the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060modules/logging/appendencoder.go:167\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/logging/appendencoder.go"},"region":{"startLine":167}}}],"partialFingerprints":{"codehealthFindingId/v1":"2a9c0dfc6cfd2527072cc66adfdce5c840379cb80dfee78ca9407682a05aabe9"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15 lines \u00D7 2): modules/caddyhttp/intercept/intercept.go:250-264 | modules/caddyhttp/reverseproxy/caddyfile.go:822-836 \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 \u0060modules/caddyhttp/intercept/intercept.go:250\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/intercept/intercept.go"},"region":{"startLine":250}}}],"partialFingerprints":{"codehealthFindingId/v1":"db854671bcd110ee0b2221062fa0d3a032c90654c5e7f13a0adac5d094704d2b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15 lines \u00D7 2): modules/caddyhttp/matchers.go:1645-1659 | modules/caddytls/matchers.go:234-248 \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 \u0060modules/caddyhttp/matchers.go:1645\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/matchers.go"},"region":{"startLine":1645}}}],"partialFingerprints":{"codehealthFindingId/v1":"40fe0e4847a39af82da5098cefb86e4a62aae2b1479007846041467162f23cf5"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15 lines \u00D7 2): modules/caddyhttp/vars.go:191-205 | modules/caddyhttp/vars.go:328-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 \u0060modules/caddyhttp/vars.go:191\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/vars.go"},"region":{"startLine":191}}}],"partialFingerprints":{"codehealthFindingId/v1":"817ce3d331d7472e346f224a642c76d5fe8589fa9507cdbb07a641c0fd75e29a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): listen_unix.go:228-241 | listen_unix.go:254-267 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060listen_unix.go:228\u0060 it begins part-way through the construct above it, so those exact 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":"listen_unix.go"},"region":{"startLine":228}}}],"partialFingerprints":{"codehealthFindingId/v1":"7db62b6fd99101b7039d0548b61f34aa718f792b4960cad7390a2a7f97705a54"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): modules/caddyhttp/matchers.go:1613-1626 | modules/caddytls/matchers.go:202-215 \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 \u0060modules/caddyhttp/matchers.go:1613\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/matchers.go"},"region":{"startLine":1613}}}],"partialFingerprints":{"codehealthFindingId/v1":"ef91fe386fc06c614658143dc9af031b3961e7a8c5987bff22b66de87f564184"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): modules/caddyhttp/replacer.go:341-354 | modules/caddyhttp/replacer.go:362-375 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060modules/caddyhttp/replacer.go:341\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/replacer.go"},"region":{"startLine":341}}}],"partialFingerprints":{"codehealthFindingId/v1":"5d3b84c1750fe7ff19793ad123b210e405e41cbe08417d2f2415e9b04ffa96cf"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): modules/caddyhttp/reverseproxy/selectionpolicies.go:539-552 | modules/caddyhttp/reverseproxy/selectionpolicies.go:619-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 \u0060modules/caddyhttp/reverseproxy/selectionpolicies.go:539\u0060 it begins part-way through the construct above it, so those exact 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":"modules/caddyhttp/reverseproxy/selectionpolicies.go"},"region":{"startLine":539}}}],"partialFingerprints":{"codehealthFindingId/v1":"6f67a9c4cba3d145791d378f7faadfbf79c4202dca9e8dd7192264856cfd5284"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): modules/caddypki/adminapi.go:96-109 | modules/caddypki/adminapi.go:146-159 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060modules/caddypki/adminapi.go:96\u0060 it begins part-way through the construct above it, so those exact 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":"modules/caddypki/adminapi.go"},"region":{"startLine":96}}}],"partialFingerprints":{"codehealthFindingId/v1":"1286e2eb857c3d547c5635dbf51de7794bcf26f337e383ea085d9ec47c5d2bb0"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): modules/caddypki/command.go:109-122 | modules/caddypki/command.go:178-191 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060modules/caddypki/command.go:109\u0060 it does not close everything it opens, so those exact 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":"modules/caddypki/command.go"},"region":{"startLine":109}}}],"partialFingerprints":{"codehealthFindingId/v1":"fb936119b864f318a09d0706c298bea267096007852b1cdcdc37b4cf59c0f4eb"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): modules/caddyhttp/celmatcher.go:772-784 | modules/caddyhttp/fileserver/matcher.go:680-692 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/celmatcher.go"},"region":{"startLine":772}}}],"partialFingerprints":{"codehealthFindingId/v1":"90826fea98828cf6955b36ee38715ed4c2d04d30e9ff3b1e25691387b443df93"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): modules/caddyhttp/reverseproxy/httptransport.go:868-880 | modules/caddytls/capools.go:605-617 \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 \u0060modules/caddyhttp/reverseproxy/httptransport.go:868\u0060 it begins part-way through the construct above it, so those exact 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":"modules/caddyhttp/reverseproxy/httptransport.go"},"region":{"startLine":868}}}],"partialFingerprints":{"codehealthFindingId/v1":"95fc12939a1824049b49daafa54ba1353ad0e024aa5522e9370ae6c7c303e77c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): modules/caddyhttp/staticresp.go:420-432 | modules/caddyhttp/fileserver/command.go:193-206 \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 \u0060modules/caddyhttp/staticresp.go:420\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/staticresp.go"},"region":{"startLine":420}}}],"partialFingerprints":{"codehealthFindingId/v1":"0eb5d89d891fee19027a066ae23ef95ff1fdbdf0f3b4ae2013ff3c120468e5a6"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): modules/caddytls/acmeissuer.go:652-664 | modules/caddytls/zerosslissuer.go:226-238 \u2014 the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060modules/caddytls/acmeissuer.go:652\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddytls/acmeissuer.go"},"region":{"startLine":652}}}],"partialFingerprints":{"codehealthFindingId/v1":"98ceae16ce7462c700cd8b62dade8dc463ec6e02ab86d9dfb4c47ac72ffddff3"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): modules/caddytls/automation.go:255-267 | modules/caddytls/automation.go:402-418 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060modules/caddytls/automation.go:255\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddytls/automation.go"},"region":{"startLine":255}}}],"partialFingerprints":{"codehealthFindingId/v1":"b7747e1ec5e7f6eb10437bd70dc5573ae59382713b70569627fb47df23f7f0f1"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 3): modules/caddytls/capools.go:156-167 | modules/caddytls/capools.go:433-444 | modules/caddytls/capools.go:695-706 \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 \u0060modules/caddytls/capools.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. 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":"modules/caddytls/capools.go"},"region":{"startLine":156}}}],"partialFingerprints":{"codehealthFindingId/v1":"b8b06dda508495ec6cd2939edd7abd7bab985eb930353477d53c05a4db3a064c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): caddyconfig/httpcaddyfile/addresses.go:137-153 | caddyconfig/httpcaddyfile/addresses.go:200-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 \u0060caddyconfig/httpcaddyfile/addresses.go:137\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"caddyconfig/httpcaddyfile/addresses.go"},"region":{"startLine":137}}}],"partialFingerprints":{"codehealthFindingId/v1":"2f18bde4436a84de849481232c51498f6226e59a70e3a4c03756aa3ceed6db9d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): caddyconfig/load.go:74-85 | caddyconfig/load.go:138-149 \u2014 both copies are in the same file, so extract the block 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":"caddyconfig/load.go"},"region":{"startLine":74}}}],"partialFingerprints":{"codehealthFindingId/v1":"b023523ca823c32d8ea7a5d9f07f69868fbc84618e5cd4f62126e235dd139dbd"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): modules/caddyhttp/celmatcher.go:501-512 | modules/caddyhttp/celmatcher.go:524-535 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060modules/caddyhttp/celmatcher.go:501\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/celmatcher.go"},"region":{"startLine":501}}}],"partialFingerprints":{"codehealthFindingId/v1":"98d48abcee46ccf144000d85ec2358ca070f838db492f986473c1e7dfcf395f2"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): modules/caddyhttp/matchers.go:1310-1321 | modules/caddyhttp/vars.go:377-388 \u2014 the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060modules/caddyhttp/matchers.go:1310\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/matchers.go"},"region":{"startLine":1310}}}],"partialFingerprints":{"codehealthFindingId/v1":"f9f5c902fd26314059927fd29c8f328931043a748acf6430e4e109d6959e5ef5"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): modules/caddyhttp/matchers.go:1337-1348 | modules/caddyhttp/vars.go:404-415 \u2014 the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060modules/caddyhttp/matchers.go:1337\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/matchers.go"},"region":{"startLine":1337}}}],"partialFingerprints":{"codehealthFindingId/v1":"48eb41183de724c6d99f6fb449bce6805198bbd2f63be957c5790380110e017d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): modules/logging/appendencoder.go:82-93 | modules/logging/filterencoder.go:88-99 \u2014 the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060modules/logging/appendencoder.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":"modules/logging/appendencoder.go"},"region":{"startLine":82}}}],"partialFingerprints":{"codehealthFindingId/v1":"1723536b39412570231d87a6ab9c5193083043e387258e490bd1ff0a3ba8f70b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): caddyconfig/httpcaddyfile/builtins.go:69-80 | caddyconfig/httpcaddyfile/options.go:330-341 \u2014 the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060caddyconfig/httpcaddyfile/builtins.go:69\u0060 it begins part-way through the construct above it, so those exact 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":"caddyconfig/httpcaddyfile/builtins.go"},"region":{"startLine":69}}}],"partialFingerprints":{"codehealthFindingId/v1":"3e780d06599263d0434175e9079fd370672ca4d12ea8bb015b4b4de689e583a4"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): modules/caddyhttp/reverseproxy/caddyfile.go:1508-1519 | modules/caddyhttp/reverseproxy/caddyfile.go:1608-1619 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060modules/caddyhttp/reverseproxy/caddyfile.go:1508\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/reverseproxy/caddyfile.go"},"region":{"startLine":1508}}}],"partialFingerprints":{"codehealthFindingId/v1":"7645a27387c14e7e427e56a5ce0a6d1cf45fdadffee1994d5dbf51c88d43ff13"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 3): modules/caddyhttp/matchers.go:854-864 | modules/caddyhttp/matchers.go:1326-1336 | modules/caddyhttp/vars.go:393-403 \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 \u0060modules/caddyhttp/matchers.go:854\u0060 it does not close everything it opens, so those exact 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":"modules/caddyhttp/matchers.go"},"region":{"startLine":854}}}],"partialFingerprints":{"codehealthFindingId/v1":"d314012d60ebd7d082c8ee1dd93fd3832bb0b1869257446ebf135e6c9c0f5aa2"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 3): modules/caddypki/ca.go:113-123 | modules/caddytls/capools.go:409-419 | modules/caddytls/leafstorageloader.go:60-70 \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 \u0060modules/caddypki/ca.go:113\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddypki/ca.go"},"region":{"startLine":113}}}],"partialFingerprints":{"codehealthFindingId/v1":"d39f33b49791166fa9da11ebb61db4f8a707d402914f595a1c069512160486e4"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): caddy.go:229-239 | caddy.go:249-264 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060caddy.go:229\u0060 it does not close everything it opens, so those exact 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":"caddy.go"},"region":{"startLine":229}}}],"partialFingerprints":{"codehealthFindingId/v1":"b1e7d329a318679d2395fc023125a686841b007aa4f6e6a6e1a77c1d5efb6ac1"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): cmd/storagefuncs.go:86-96 | cmd/storagefuncs.go:158-168 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060cmd/storagefuncs.go:86\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/storagefuncs.go"},"region":{"startLine":86}}}],"partialFingerprints":{"codehealthFindingId/v1":"822fc5b37b7ca711e1a558ebdd09e6fd4d3b58cbf5ed63806432a84fa8fb86da"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): modules/caddyhttp/matchers.go:1525-1535 | modules/caddyhttp/routes.go:443-453 \u2014 the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060modules/caddyhttp/matchers.go:1525\u0060 it does not close everything it opens, so those exact 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":"modules/caddyhttp/matchers.go"},"region":{"startLine":1525}}}],"partialFingerprints":{"codehealthFindingId/v1":"2e6c58ed1990b5a31e711bbd192bbc5709f3573cc72468dc1ffc230bd7f6af4b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): modules/caddytls/acmeissuer.go:620-630 | modules/caddytls/zerosslissuer.go:200-210 \u2014 the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060modules/caddytls/acmeissuer.go:620\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddytls/acmeissuer.go"},"region":{"startLine":620}}}],"partialFingerprints":{"codehealthFindingId/v1":"07f6e65d36d3b63bb9c77c42d0851861f7b6634a463cedfcf9ac6a5c31dccedc"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): modules/caddytls/capools.go:274-284 | modules/caddytls/capools.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. Read the line range as the matched WINDOW rather than a finished unit: at \u0060modules/caddytls/capools.go:274\u0060 it begins part-way through the construct above it, so those exact 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":"modules/caddytls/capools.go"},"region":{"startLine":274}}}],"partialFingerprints":{"codehealthFindingId/v1":"d51df11628571442ea3a8672f1e8a4271d2eff37434539a20b19feedc946c7ce"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): modules/caddytls/capools.go:543-553 | modules/caddytls/capools.go:914-924 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060modules/caddytls/capools.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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddytls/capools.go"},"region":{"startLine":543}}}],"partialFingerprints":{"codehealthFindingId/v1":"e7f7f6f0ce14df4874abc8fa35fe537d98ab5548cdd0c8b4157cd6d33fcc3415"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): modules/caddytls/connpolicy.go:998-1008 | modules/caddytls/connpolicy.go:1016-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":"modules/caddytls/connpolicy.go"},"region":{"startLine":998}}}],"partialFingerprints":{"codehealthFindingId/v1":"06edbf17c04b1b5e042c0b3be5bf11804c13feb1862d85a7416ebfc18ef22e41"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): caddyconfig/httpcaddyfile/options.go:76-86 | caddyconfig/httpcaddyfile/options.go:91-101 \u2014 both copies are in the same file, so extract the block 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":"caddyconfig/httpcaddyfile/options.go"},"region":{"startLine":76}}}],"partialFingerprints":{"codehealthFindingId/v1":"cac46878aa17d6481cf30732ccb24869c53bc0f60b0f1ee8b0f67ee9f5558c6c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 3): modules/caddyhttp/matchers.go:868-877 | modules/caddyhttp/matchers.go:1341-1350 | modules/caddyhttp/vars.go:408-417 \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 \u0060modules/caddyhttp/matchers.go:868\u0060 it begins part-way through the construct above it, so those exact 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":"modules/caddyhttp/matchers.go"},"region":{"startLine":868}}}],"partialFingerprints":{"codehealthFindingId/v1":"b60252a3730008c4b740d4614a5d63820818fda186e4f1e739a54680510c3479"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 3): modules/caddyhttp/reverseproxy/caddyfile.go:1105-1114 | modules/caddyhttp/reverseproxy/caddyfile.go:1517-1526 | modules/caddyhttp/reverseproxy/caddyfile.go:1617-1626 \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 \u0060modules/caddyhttp/reverseproxy/caddyfile.go:1105\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/reverseproxy/caddyfile.go"},"region":{"startLine":1105}}}],"partialFingerprints":{"codehealthFindingId/v1":"bd3438b978200c5918a505d34b4df79af842655ee5a7eaffb85be4b84413acbe"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): cmd/packagesfuncs.go:72-81 | cmd/packagesfuncs.go:100-109 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060cmd/packagesfuncs.go:72\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"cmd/packagesfuncs.go"},"region":{"startLine":72}}}],"partialFingerprints":{"codehealthFindingId/v1":"a75b6b656c2fa9d6e23aba844f7987eef6b252c35849ccac12f68f8273e824e8"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): modules/caddyhttp/celmatcher.go:741-750 | modules/caddyhttp/fileserver/matcher.go:649-658 \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 \u0060modules/caddyhttp/celmatcher.go:741\u0060 it begins part-way through the construct above it, so those exact 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":"modules/caddyhttp/celmatcher.go"},"region":{"startLine":741}}}],"partialFingerprints":{"codehealthFindingId/v1":"d0fbac8ce0e4b07651273bbe6f3b03faeb5d26313e848f9153362b00cd0a91bd"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): modules/caddyhttp/celmatcher.go:793-802 | modules/caddyhttp/fileserver/matcher.go:701-710 \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 \u0060modules/caddyhttp/celmatcher.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. 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":"modules/caddyhttp/celmatcher.go"},"region":{"startLine":793}}}],"partialFingerprints":{"codehealthFindingId/v1":"618d99d3b7b04a651c2510290ab5e3889114a6f7b57d275471efe0eafcd8ec91"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): modules/caddyhttp/reverseproxy/upstreams.go:97-106 | modules/caddyhttp/reverseproxy/upstreams.go:332-341 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060modules/caddyhttp/reverseproxy/upstreams.go:97\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/reverseproxy/upstreams.go"},"region":{"startLine":97}}}],"partialFingerprints":{"codehealthFindingId/v1":"70dfc45d25b64a544995dc1f4b8a475811bb7e982e3dfdd4d9275a7ef3315571"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): modules/caddytls/acmeissuer.go:548-557 | modules/caddytls/acmeissuer.go:564-573 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060modules/caddytls/acmeissuer.go:548\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddytls/acmeissuer.go"},"region":{"startLine":548}}}],"partialFingerprints":{"codehealthFindingId/v1":"54501555d8022a4f35bcfd0e9f15cf5206b80b5d7fda3e03260063dff9073783"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): modules/caddytls/matchers.go:375-384 | modules/caddytls/matchers.go:490-499 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060modules/caddytls/matchers.go:375\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddytls/matchers.go"},"region":{"startLine":375}}}],"partialFingerprints":{"codehealthFindingId/v1":"86e49384a57871592d6ba503a6ae98fe1ed40a667eecd7cdadab72a626d04ed3"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): caddyconfig/httpcaddyfile/builtins.go:347-356 | caddyconfig/httpcaddyfile/builtins.go:436-445 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060caddyconfig/httpcaddyfile/builtins.go:347\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"caddyconfig/httpcaddyfile/builtins.go"},"region":{"startLine":347}}}],"partialFingerprints":{"codehealthFindingId/v1":"cd6e559eee91eb3591815fc90873c0156c1392e35937376fc348cd76cf119cf1"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): caddyconfig/httpcaddyfile/builtins.go:371-380 | caddyconfig/httpcaddyfile/builtins.go:421-430 \u2014 both copies are in the same file, so extract the block 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":"caddyconfig/httpcaddyfile/builtins.go"},"region":{"startLine":371}}}],"partialFingerprints":{"codehealthFindingId/v1":"532478659df0bddd4b977fff808990db66798d0e4d8e7f7271d81a8cb04c53ee"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): modules/caddyhttp/reverseproxy/caddyfile.go:443-452 | modules/caddyhttp/reverseproxy/caddyfile.go:459-468 \u2014 both copies are in the same file, so extract the block 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":"modules/caddyhttp/reverseproxy/caddyfile.go"},"region":{"startLine":443}}}],"partialFingerprints":{"codehealthFindingId/v1":"b7b867af29cdeb69e58b77bb2a32625e1b42c4e6f1bcda97725d8873c8e6cf93"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): modules/caddyhttp/reverseproxy/caddyfile.go:519-528 | modules/caddyhttp/reverseproxy/caddyfile.go:535-544 \u2014 both copies are in the same file, so extract the block 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":"modules/caddyhttp/reverseproxy/caddyfile.go"},"region":{"startLine":519}}}],"partialFingerprints":{"codehealthFindingId/v1":"6d854e75e2fb054ea618e497979427fa9c20ce91d7b23647e40b9a1345330198"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): modules/caddyhttp/reverseproxy/caddyfile.go:551-560 | modules/caddyhttp/reverseproxy/caddyfile.go:583-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":"modules/caddyhttp/reverseproxy/caddyfile.go"},"region":{"startLine":551}}}],"partialFingerprints":{"codehealthFindingId/v1":"306f2bc7ccfaf56b692b5fbefbe0447329b763ac3308e5add2c6a74f4bf422d5"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): modules/caddyhttp/reverseproxy/caddyfile.go:567-576 | modules/caddyhttp/reverseproxy/caddyfile.go:621-630 \u2014 both copies are in the same file, so extract the block 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":"modules/caddyhttp/reverseproxy/caddyfile.go"},"region":{"startLine":567}}}],"partialFingerprints":{"codehealthFindingId/v1":"032caa5aab84f0885c490a8a61f53475503a21b2e69eda19909aea3b859a829b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): modules/caddyhttp/reverseproxy/caddyfile.go:1283-1292 | modules/caddyhttp/reverseproxy/caddyfile.go:1296-1305 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060modules/caddyhttp/reverseproxy/caddyfile.go:1283\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/reverseproxy/caddyfile.go"},"region":{"startLine":1283}}}],"partialFingerprints":{"codehealthFindingId/v1":"f984f1bcfb12f753a731c008474a618acb01056ee733299d1839455c9b4acf83"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 3): modules/caddyhttp/reverseproxy/selectionpolicies.go:502-510 | modules/caddyhttp/reverseproxy/selectionpolicies.go:583-591 | modules/caddyhttp/reverseproxy/selectionpolicies.go:667-675 \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 \u0060modules/caddyhttp/reverseproxy/selectionpolicies.go:502\u0060 it begins part-way through the construct above it, so those exact 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":"modules/caddyhttp/reverseproxy/selectionpolicies.go"},"region":{"startLine":502}}}],"partialFingerprints":{"codehealthFindingId/v1":"94d8e15ded1e214ffc3e85787c89a17dea922381a71392f8d8ea8f16b5022420"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): caddyconfig/httpcaddyfile/httptype.go:680-688 | caddyconfig/httpcaddyfile/httptype.go:691-699 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"caddyconfig/httpcaddyfile/httptype.go"},"region":{"startLine":680}}}],"partialFingerprints":{"codehealthFindingId/v1":"65d0d7f3b60335d8e44447e15d153503491ce9478a7196d0819bcbd91a93100e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): modules/caddyhttp/celmatcher.go:535-543 | modules/caddyhttp/celmatcher.go:573-581 \u2014 both copies are in the same file, so extract the block 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":"modules/caddyhttp/celmatcher.go"},"region":{"startLine":535}}}],"partialFingerprints":{"codehealthFindingId/v1":"9cfcf3938e8020ff5d05555413bee96b1f748a8638cb396a7b12f5a38f544eea"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): modules/caddyhttp/reverseproxy/fastcgi/caddyfile.go:100-108 | modules/caddyhttp/reverseproxy/caddyfile.go:1050-1058 \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 \u0060modules/caddyhttp/reverseproxy/fastcgi/caddyfile.go:100\u0060 it does not close everything it opens, so those exact 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":"modules/caddyhttp/reverseproxy/fastcgi/caddyfile.go"},"region":{"startLine":100}}}],"partialFingerprints":{"codehealthFindingId/v1":"bfd051a248aef0969755cd13f97361a710cbbc4a42a08887a516ddcf2539b806"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): modules/caddyhttp/reverseproxy/healthchecks.go:274-282 | modules/caddyhttp/reverseproxy/healthchecks.go:302-311 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060modules/caddyhttp/reverseproxy/healthchecks.go:274\u0060 it begins part-way through the construct above it, so those exact 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":"modules/caddyhttp/reverseproxy/healthchecks.go"},"region":{"startLine":274}}}],"partialFingerprints":{"codehealthFindingId/v1":"d4d9bb72e80ab45e07deae7b8b69c50a53d6aedcdeaa1e7e5ad1c7f55cd7929b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): modules/caddyhttp/staticerror.go:65-73 | modules/caddyhttp/staticresp.go:144-152 \u2014 the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060modules/caddyhttp/staticerror.go:65\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/staticerror.go"},"region":{"startLine":65}}}],"partialFingerprints":{"codehealthFindingId/v1":"cef2dd3f8ed6e7b0d5ed764905c69b9a8d2fcdc73587350698fce3ed35dc00c5"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): modules/caddytls/capools.go:238-246 | modules/caddytls/capools.go:323-331 \u2014 both copies are in the same file, so extract the block 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":"modules/caddytls/capools.go"},"region":{"startLine":238}}}],"partialFingerprints":{"codehealthFindingId/v1":"f1d92e48848548ca4b9df877a3597f4101ce5196dc76e19297f4843b277c9113"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): modules/caddytls/leafpemloader.go:38-46 | modules/caddytls/leafstorageloader.go:74-82 \u2014 the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060modules/caddytls/leafpemloader.go:38\u0060 it begins part-way through the construct above it, so those exact 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":"modules/caddytls/leafpemloader.go"},"region":{"startLine":38}}}],"partialFingerprints":{"codehealthFindingId/v1":"918a8d84eebac8c98b81799955872c66dce97d2e48a5575d97eed3ee62292e32"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): modules/caddytls/matchers.go:332-340 | modules/caddytls/matchers.go:456-464 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060modules/caddytls/matchers.go:332\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddytls/matchers.go"},"region":{"startLine":332}}}],"partialFingerprints":{"codehealthFindingId/v1":"de0c7a22fde45ed3733d3ec673b1663ffe2c247ba5ebf8f3c0380ac545c75a5e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): modules/logging/appendencoder.go:103-111 | modules/logging/filterencoder.go:121-129 \u2014 the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060modules/logging/appendencoder.go:103\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/logging/appendencoder.go"},"region":{"startLine":103}}}],"partialFingerprints":{"codehealthFindingId/v1":"bbbf94653dc29db2a8805cf3732100f44b625107650010b9e94d5dfd294903f3"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): modules/caddypki/acmeserver/caddyfile.go:96-104 | modules/caddypki/acmeserver/caddyfile.go:115-123 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060modules/caddypki/acmeserver/caddyfile.go:96\u0060 it begins part-way through the construct above it, so those exact 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":"modules/caddypki/acmeserver/caddyfile.go"},"region":{"startLine":96}}}],"partialFingerprints":{"codehealthFindingId/v1":"71b5482f1d21ee29f7a4139509edd1e26c57eaae7be2e0b70f30b185025af432"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): modules/caddyhttp/headers/headers.go:303-311 | modules/caddyhttp/headers/headers.go:330-337 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060modules/caddyhttp/headers/headers.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."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/headers/headers.go"},"region":{"startLine":303}}}],"partialFingerprints":{"codehealthFindingId/v1":"a855dd7fc0693454ad35953bb1bbad2187d0adb36964030df72b7e467cfcffa8"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): modules/caddytls/fileloader.go:36-43 | modules/caddytls/pemloader.go:36-43 \u2014 the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060modules/caddytls/fileloader.go:36\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddytls/fileloader.go"},"region":{"startLine":36}}}],"partialFingerprints":{"codehealthFindingId/v1":"cead4b4615d96648c1022c2975ecc7e8befb836c9d4d01f2411b5fe5218d4cfa"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): modules/caddyhttp/reverseproxy/caddyfile.go:485-492 | modules/caddyhttp/reverseproxy/caddyfile.go:610-617 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/reverseproxy/caddyfile.go"},"region":{"startLine":485}}}],"partialFingerprints":{"codehealthFindingId/v1":"99309c03b9326e2cd50ce6ba501471a84dd3624de807981fbe0fa4b7db19675a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): modules/caddyhttp/reverseproxy/command.go:186-193 | modules/caddyhttp/reverseproxy/command.go:208-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 \u0060modules/caddyhttp/reverseproxy/command.go:186\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/reverseproxy/command.go"},"region":{"startLine":186}}}],"partialFingerprints":{"codehealthFindingId/v1":"bb347c9009ee0c9a312d27a799adf061f96bf5a467034d1b5771bee4625e7f0f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): caddyconfig/httpcaddyfile/httptype.go:562-568 | caddyconfig/httpcaddyfile/httptype.go:1033-1039 \u2014 both copies are in the same file, so extract the block 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":"caddyconfig/httpcaddyfile/httptype.go"},"region":{"startLine":562}}}],"partialFingerprints":{"codehealthFindingId/v1":"84796582628607fcdf28d7938afd831163bd5cf864481b0db70e72ab2a69be3c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): context.go:231-237 | context.go:249-255 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060context.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. 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":"context.go"},"region":{"startLine":231}}}],"partialFingerprints":{"codehealthFindingId/v1":"41b1f006d545cef31b3d1325b6056045778ce514d64947509f9a8c63a57d0d3b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): context.go:507-513 | context.go:535-541 \u2014 both copies are in the same file, so extract the block 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":"context.go"},"region":{"startLine":507}}}],"partialFingerprints":{"codehealthFindingId/v1":"42ec8fc378d6013895c206d014e4f4e26efc1317787688d4b404d9f91b360952"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 3): modules/caddyhttp/staticresp.go:375-380 | modules/caddyhttp/reverseproxy/command.go:190-195 | modules/caddyhttp/reverseproxy/command.go:212-217 \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 \u0060modules/caddyhttp/staticresp.go:375\u0060 it does not close everything it opens, so those exact 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":"modules/caddyhttp/staticresp.go"},"region":{"startLine":375}}}],"partialFingerprints":{"codehealthFindingId/v1":"ddbcd2ad4e7ca22fbc7c1c92520d20beb4a2c42bd9b9ec1c5dce07d0070554cf"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): caddyconfig/httpcaddyfile/httptype.go:1639-1644 | modules/caddytls/connpolicy.go:1101-1107 \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 \u0060caddyconfig/httpcaddyfile/httptype.go:1639\u0060 it does not close everything it opens, so those exact 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":"caddyconfig/httpcaddyfile/httptype.go"},"region":{"startLine":1639}}}],"partialFingerprints":{"codehealthFindingId/v1":"f9923b431ce4db78de4d48dff621e23d7702d2574235954ca9efbd781aec8219"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): modules/caddyhttp/rewrite/rewrite.go:608-613 | modules/caddyhttp/rewrite/rewrite.go:623-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 \u0060modules/caddyhttp/rewrite/rewrite.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":"modules/caddyhttp/rewrite/rewrite.go"},"region":{"startLine":608}}}],"partialFingerprints":{"codehealthFindingId/v1":"68ea60c8779983d1847351c6722fe0c5496532bf7fdf1f9e9eca5ee88642d79d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 3): modules/caddyhttp/reverseproxy/httptransport.go:268-272 | modules/caddyhttp/reverseproxy/upstreams.go:107-111 | modules/caddyhttp/reverseproxy/upstreams.go:342-346 \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 \u0060modules/caddyhttp/reverseproxy/httptransport.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":"modules/caddyhttp/reverseproxy/httptransport.go"},"region":{"startLine":268}}}],"partialFingerprints":{"codehealthFindingId/v1":"8d195f5f7bc2a9a909cb422df4c7d60ec8a901f1643639e8ff995fdf40a8c41a"}},{"ruleId":"D13","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":"860a79a8e3a2c9b70ad51a12eec54090c33a8e47795953b43a8e43e0bd4accac"},"taxa":[{"id":"CWE-259","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-798","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D13","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":"4966a80c5f75030f4a479af3b5c1d2a4e2e60c512e1dd9e400167177459970b8"},"taxa":[{"id":"CWE-259","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-798","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: caddyconfig/httpcaddyfile/httptype.go: caddyconfig/httpcaddyfile/httptype.go changed 3 times in last 90 days, max complexity 118. 1 of those changes was a fix/bug commit, and the other 2 changed it for other reasons \u2014 this file is under both repair and feature pressure. Before the next change lands here, cover the area it touches with tests, then split that area out of the file so the following change is smaller than this one \u2014 a file this often edited pays the complexity back every time."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"caddyconfig/httpcaddyfile/httptype.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"fd8400070c75068f09230ac337539a7d94ddbdfc3718ae6f21837432a3664004"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: modules/caddyhttp/app.go: modules/caddyhttp/app.go changed 5 times in last 90 days, max complexity 45. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, behind tests written first."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/app.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"b5d492d16c2fa651e7d0a2b18c14ab2c179e5a4c4c42d7af931505bcb6c6e5c1"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: modules/caddyhttp/reverseproxy/reverseproxy.go: modules/caddyhttp/reverseproxy/reverseproxy.go changed 5 times in last 90 days, max complexity 44. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, behind tests written first."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/reverseproxy/reverseproxy.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"d5f3c3fdd8ebef39f2135485aa8ac0316691c9f2245ef01fe88a445b3cef3cba"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: modules/caddyhttp/rewrite/rewrite.go: modules/caddyhttp/rewrite/rewrite.go changed 5 times in last 90 days, max complexity 34. 1 of those changes was a fix/bug commit, and the other 4 changed it for other reasons \u2014 this file is under both repair and feature pressure. Before the next change lands here, cover the area it touches with tests, then split that area out of the file so the following change is smaller than this one \u2014 a file this often edited pays the complexity back every time."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/rewrite/rewrite.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"d07662f769d58452652c3277038557fedc5afb896a598b9f24dee156964f712e"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: modules/caddyhttp/server.go: modules/caddyhttp/server.go changed 5 times in last 90 days, max complexity 33. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, behind tests written first."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/server.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"41b032c218b64387fe69f9f0dd00928cea24f69163c1ca1ce105defa8fd77b74"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: modules/caddyhttp/fileserver/staticfiles.go: modules/caddyhttp/fileserver/staticfiles.go changed 2 times in last 90 days, max complexity 70. 1 of those changes was a fix/bug commit, and the other 1 changed it for other reasons \u2014 this file is under both repair and feature pressure. Before the next change lands here, cover the area it touches with tests, then split that area out of the file so the following change is smaller than this one \u2014 a file this often edited pays the complexity back every time."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/fileserver/staticfiles.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"ec063efc9e864bb2be845086ec63aeac5a7b914ca5a97c743f41346e44c7a7e3"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: modules/caddytls/tls.go: modules/caddytls/tls.go changed 3 times in last 90 days, max complexity 45. 1 of those changes was a fix/bug commit, and the other 2 changed it for other reasons \u2014 this file is under both repair and feature pressure. Before the next change lands here, cover the area it touches with tests, then split that area out of the file so the following change is smaller than this one \u2014 a file this often edited pays the complexity back every time."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddytls/tls.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"f0012b591b72cfdfb6db487b6a8e0e7f6f57e7a8248736aed786179517b31f1d"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: caddyconfig/caddyfile/parse.go: caddyconfig/caddyfile/parse.go changed 2 times in last 90 days, max complexity 53. 1 of those changes was a fix/bug commit, and the other 1 changed it for other reasons \u2014 this file is under both repair and feature pressure. Before the next change lands here, cover the area it touches with tests, then split that area out of the file so the following change is smaller than this one \u2014 a file this often edited pays the complexity back every time."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"caddyconfig/caddyfile/parse.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"7987a7e59fd18a15ab93e6d411b3ae7b90084549af1f386730dc05c9ec2043be"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: modules/caddytls/connpolicy.go: modules/caddytls/connpolicy.go changed 3 times in last 90 days, max complexity 35. 1 of those changes was a fix/bug commit, and the other 2 changed it for other reasons \u2014 this file is under both repair and feature pressure. Before the next change lands here, cover the area it touches with tests, then split that area out of the file so the following change is smaller than this one \u2014 a file this often edited pays the complexity back every time."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddytls/connpolicy.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"5911fecaf40f5e76f0d169cebb65f22747ef461d490f8422323573534f268dff"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: caddyconfig/caddyfile/lexer.go: caddyconfig/caddyfile/lexer.go changed 2 times in last 90 days, max complexity 49. 1 of those changes was a fix/bug commit, and the other 1 changed it for other reasons \u2014 this file is under both repair and feature pressure. Before the next change lands here, cover the area it touches with tests, then split that area out of the file so the following change is smaller than this one \u2014 a file this often edited pays the complexity back every time."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"caddyconfig/caddyfile/lexer.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"c084ad72bc5fdcc7a097992a97d9f2d3ed4195e2eea9f64a29e141dbe7e0f243"}},{"ruleId":"D16","level":"note","message":{"text":"Off-boarding risk: anonymized user #1: If anonymized user #1 becomes unavailable, 1 significant file(s) lose their only recent owner: modules/caddytls/sessiontickets.go. Pair on, review, or document these before any departure."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"de04411a11d0282ea3ff531bcf7a0a5ea7b45d37cd1d89dc118f146ca74302ad"}},{"ruleId":"D16","level":"note","message":{"text":"Further sole-owners (lower concentration): 8 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold \u2014 folded into the bus-factor score and metrics (9 single-owned of 155 analysed files in total, counted over production source files of roughly 100 lines or more, excluding tests, vendored, generated and example/demo trees, largest first). They are anonymized user #2 (1 file(s)), anonymized user #3 (1 file(s)), anonymized user #4 (1 file(s)), anonymized user #5 (1 file(s)), anonymized user #6 (1 file(s)), anonymized user #7 (1 file(s)) (\u002B2 more) \u2014 spread or document their files in the same way, at lower priority than the named off-boarding risks above."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"6eac528f2429e724e1a97ed868f79eefbcf1888dab4af9a9e673429369bb5b2f"}},{"ruleId":"D19","level":"note","message":{"text":"This README lists benchmark payloads but gives no explanation of what each payload represents or how to run the benchmarks.: Describe each payload (e.g., caddy_home.html, config HTTP servers JSON) and add a short Benchmarking section explaining the test results."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"modules/caddyhttp/encode/testdata/README.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"b92f5a3b442f84e3cb30f6ec3292f290f7b76b4efaf39cd5f9546da569bd05ff"}},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"d5b8f11381d61a58459ffc7c595fd52d09c03c711894a63a9578043d2338412b"},"taxa":[{"id":"CWE-829","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"f952aba36da3ad7703428bbb3453e96d53da83b7dcb79ad152dacf32a5dfd015"},"taxa":[{"id":"CWE-78","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"367ab130f7f3ab92a28a24f26969de1847228f23a7d3ec35d59281c0ca521b07"},"taxa":[{"id":"CWE-78","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"2f4b407385fee103da4acefeaf9a4fdc079b572b5d0fded5786552d57a7d022b"},"taxa":[{"id":"CWE-94","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"c30eeba26090125d3448c5a5963c512060cbac3d4c8675aa9d2a7dad0b4593b5"},"taxa":[{"id":"CWE-78","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"a698e4c77b5b2e92ddf700f2f16989b120ee1731e878bd10649ea05df56ffb05"},"taxa":[{"id":"CWE-94","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"ab645a21c3b05f1db178aec11578b5659332ff270bbdbc9d6e90a0984e57b66c"},"taxa":[{"id":"CWE-78","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"7ab5e23ee0e98ac6c3c2a3136bef694801add48911e6fab869af806b6da6ede8"},"taxa":[{"id":"CWE-338","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"538871b19d98272b18472087689ee1f62e66904d6409309f238c8df3d57ff508"},"taxa":[{"id":"CWE-338","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"22a124134424acd0a4b78512d75fb5bcb0befd8e99ed451654aea5ea55eb8d79"},"taxa":[{"id":"CWE-22","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"c6326c3afff0df29b0441a6a8561f550038c9da7f338297c85d71b9407cfd59f"},"taxa":[{"id":"CWE-79","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"eab6d827a35516d13b8c9b9a76f8b7148bea8d6d8a9d6590e9bb9d164a8145e8"},"taxa":[{"id":"CWE-79","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"5d10de70829c4820f42dca7b8e6b0f8b2d515e23260c83a87ec424cb35a1906f"},"taxa":[{"id":"CWE-79","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"ce6db4f3918fc199cdf8c65c693193284677dcc0a434f011b0f1cc39237d5d15"},"taxa":[{"id":"CWE-79","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"ab93652173b7d5ab6ec2e45d27674105dc991e5e2b91d8bf121faaf535f8c844"},"taxa":[{"id":"CWE-79","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"8d78721808b955e3673bf8100dba51941b26d5d9338209ccac7aeaf0fab6a7a3"},"taxa":[{"id":"CWE-79","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"2b69d0512cf7f0de6b98cb3e765756a1d1e7df67e392c9ec4f5c0b067473421e"},"taxa":[{"id":"CWE-338","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"171671257c5742c66bd4fab96682059e17e3163bebad0b191929c764885a230b"},"taxa":[{"id":"CWE-338","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"425b9339e28b4499594456324a94f687bd11aab137c0ad7ef9a76d6a8ef45174"},"taxa":[{"id":"CWE-338","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"462061fe2ad6ecb0497058ac887250e4562a250adb9dc070332d5b55a67df8b7"},"taxa":[{"id":"CWE-338","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"19ff1373ff212ae822864eb25756c3df7f97d201b23a871b6eb3024ec4b90f09"},"taxa":[{"id":"CWE-338","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"f5762eef5610de3dc31c3c21f6db453c374a3cf4542ffaf466781e07578c2518"},"taxa":[{"id":"CWE-338","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"c33f9ec236879b6696a56d14b5332b92d104c6544e256ed8a81ac532ae21e9de"},"taxa":[{"id":"CWE-338","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":"56764283f0274feb53ca82768a33fdc900d2d2072a3606102ad5a3766c64b4a1"},"taxa":[{"id":"CWE-327","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"note","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"ece15196d45bccf248d0c42d3588c964579d3f7d05df4ad3515cdb3b72807e11"},"taxa":[{"id":"CWE-327","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"note","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"be72833ddcb12ac3b8b20938f3c6c61b6abc460e9c7e9215567e201c56ebca18"},"taxa":[{"id":"CWE-327","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"note","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"f19d681ac6328cc1698b284eb869cbc59c4f816ba1150875f62ca939bb456da1"},"taxa":[{"id":"CWE-327","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"note","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"4c8c8cd7453281bc1e4da411c7867b4666ae8b4f7ac6b55d83ded53506c84866"},"taxa":[{"id":"CWE-327","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"note","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"db57d03ea0cb87c68d3e94a6eadf12b6b0ad6337a69e9a3f1591e8ef9da3c41d"},"taxa":[{"id":"CWE-327","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"note","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"d3cf5e86a08a19072b8f0bd563a70b218c48f3f386ac4503ccd3db47a28ebe1b"},"taxa":[{"id":"CWE-614","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"note","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"67500e98e974dd376e21097b94687b012487a4108c41fb0f9cc25f233c0c6061"},"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":"68390c20ec26ce39e274c9559e3bfddd497a82173f26e1571574c4d0324debe5"},"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":"da2cc5810e50970dd35f5eb1d079dc0c4eea973dbd80a3255a127e4cfe0c48fd"},"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":"eb13eac6b60c203fb45aa1402697de9c4790678ac23975813d934cd8ac7d4d0a"},"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":"78f83d283cc053ed7503855b619ad4a86cffd085b8be2f42be0d68be7410066f"},"taxa":[{"id":"CWE-327","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D34","level":"note","message":{"text":"Further orphaned files (smaller): 15 of 157 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 100 lines or more, excluding tests, vendored, generated and example/demo trees, largest first). 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 largest first: modules/logging/appendencoder.go, modules/caddyhttp/reverseproxy/copyresponse.go, cmd/storagefuncs.go (and 12 more). 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":"D35","level":"error","message":{"text":"Boundary-crossing change coupling: directives.go \u2194 imports.go: \u0060caddyconfig/httpcaddyfile/directives.go\u0060 (context caddyconfig) and \u0060modules/caddyhttp/standard/imports.go\u0060 (context caddyhttp) sit in DIFFERENT parts of the tree yet change together 50% of the time (6 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well) \u2014 the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can\u0027t see."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"caddyconfig/httpcaddyfile/directives.go"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"9236948e4ba1ea874ecd8fe6b507357c257106d1e496c96b74cb238bbea3fc7c"}},{"ruleId":"D36","level":"note","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"1b213f6eedd4b140d0bc37bdf1496f72811a643f34064f12518b32e9e83bcfc7"}},{"ruleId":"D38","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"50c379534161bb30611d421e82af3666b891a67b9a6a35df5a4fc4b4977e653b"}},{"ruleId":"D38","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"67513cec8df302e3c695c940a21ce26f1e0c439713f432fd28a391e78264f4b5"}}],"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-1059","guid":"a2381a08-60f6-9554-a8b8-f3018cfaaca5","name":"Insufficient Technical Documentation","shortDescription":{"text":"Insufficient Technical Documentation"},"helpUri":"https://cwe.mitre.org/data/definitions/1059.html"},{"id":"CWE-1357","guid":"e4d2e772-757e-0a5c-bd7d-77052949d866","name":"Reliance on Insufficiently Trustworthy Component","shortDescription":{"text":"Reliance on Insufficiently Trustworthy Component"},"helpUri":"https://cwe.mitre.org/data/definitions/1357.html"},{"id":"CWE-1395","guid":"800e09e7-c11a-8654-9fa6-86f398995fed","name":"Dependency on Vulnerable Third-Party Component","shortDescription":{"text":"Dependency on Vulnerable Third-Party Component"},"helpUri":"https://cwe.mitre.org/data/definitions/1395.html"},{"id":"CWE-22","guid":"b68d9ca7-bdde-d057-a6cc-9f8b1e739552","name":"CWE-22","shortDescription":{"text":"CWE-22"},"helpUri":"https://cwe.mitre.org/data/definitions/22.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-259","guid":"ae9ad959-fbb6-9d5e-892d-3dca66da0b69","name":"Use of Hard-coded Password","shortDescription":{"text":"Use of Hard-coded Password"},"helpUri":"https://cwe.mitre.org/data/definitions/259.html"},{"id":"CWE-327","guid":"e51910ff-67b5-3c51-aa3d-92837d9eab90","name":"CWE-327","shortDescription":{"text":"CWE-327"},"helpUri":"https://cwe.mitre.org/data/definitions/327.html"},{"id":"CWE-338","guid":"e89b7604-c3f7-8b53-bc8c-4d4718c28617","name":"CWE-338","shortDescription":{"text":"CWE-338"},"helpUri":"https://cwe.mitre.org/data/definitions/338.html"},{"id":"CWE-494","guid":"b8a65e0d-e459-4a55-a931-fc1136482375","name":"Download of Code Without Integrity Check","shortDescription":{"text":"Download of Code Without Integrity Check"},"helpUri":"https://cwe.mitre.org/data/definitions/494.html"},{"id":"CWE-614","guid":"faa8a6a5-7e9d-5d5e-afc9-020ff49d250a","name":"CWE-614","shortDescription":{"text":"CWE-614"},"helpUri":"https://cwe.mitre.org/data/definitions/614.html"},{"id":"CWE-77","guid":"332c8ade-6612-9f56-a06b-d8d90b1a8750","name":"Command Injection","shortDescription":{"text":"Command Injection"},"helpUri":"https://cwe.mitre.org/data/definitions/77.html"},{"id":"CWE-78","guid":"2e31ceaf-c7ae-2e5e-9661-cfb1362789cf","name":"OS Command Injection","shortDescription":{"text":"OS Command Injection"},"helpUri":"https://cwe.mitre.org/data/definitions/78.html"},{"id":"CWE-79","guid":"fd45580b-e8c4-fc5e-8c2f-aa8fab0b4dbf","name":"Cross-site Scripting (XSS)","shortDescription":{"text":"Cross-site Scripting (XSS)"},"helpUri":"https://cwe.mitre.org/data/definitions/79.html"},{"id":"CWE-798","guid":"5e8f057d-fee3-995a-a0cb-9fc5b0d174d1","name":"Use of Hard-coded Credentials","shortDescription":{"text":"Use of Hard-coded Credentials"},"helpUri":"https://cwe.mitre.org/data/definitions/798.html"},{"id":"CWE-829","guid":"13c33925-97fb-5a5e-b40c-56d328b8a4d7","name":"CWE-829","shortDescription":{"text":"CWE-829"},"helpUri":"https://cwe.mitre.org/data/definitions/829.html"},{"id":"CWE-89","guid":"6d08fdad-37eb-c150-bbf0-d7d946863407","name":"SQL Injection","shortDescription":{"text":"SQL Injection"},"helpUri":"https://cwe.mitre.org/data/definitions/89.html"},{"id":"CWE-937","guid":"16f316ae-415c-b354-a59b-1f7905f756e9","name":"Using Components with Known Vulnerabilities","shortDescription":{"text":"Using Components with Known Vulnerabilities"},"helpUri":"https://cwe.mitre.org/data/definitions/937.html"},{"id":"CWE-94","guid":"75e7f50c-6c2f-dd52-bf40-bf6c52b861fd","name":"Code Injection","shortDescription":{"text":"Code Injection"},"helpUri":"https://cwe.mitre.org/data/definitions/94.html"}]}],"properties":{"codehealthPublication":{"public":true,"notice":"This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings \u2014 which rule fired, in which file, on which line, and how to fix it \u2014 are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.","securityFindingsRedacted":40,"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."]}]}